summaryrefslogtreecommitdiffstats
path: root/ios/chrome/browser/ui/commands/generic_chrome_command.mm
blob: d2512b99c784def3d748fecfdf82ec5249bbb6ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "ios/chrome/browser/ui/commands/generic_chrome_command.h"

#import <UIKit/UIKit.h>

#include "base/logging.h"
#import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h"

@implementation GenericChromeCommand

@synthesize tag = _tag;

- (instancetype)initWithTag:(NSInteger)tag {
  self = [super init];
  if (self) {
    _tag = tag;
  }
  return self;
}

- (void)executeOnMainWindow {
  UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow];
  DCHECK(mainWindow);
  [mainWindow chromeExecuteCommand:self];
}

@end