Index: ios/chrome/browser/ui/commands/generic_chrome_command.mm |
diff --git a/ios/chrome/browser/ui/commands/generic_chrome_command.mm b/ios/chrome/browser/ui/commands/generic_chrome_command.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bc737a6fef3f45bf5e3c891d4604d36cb9bb9985 |
--- /dev/null |
+++ b/ios/chrome/browser/ui/commands/generic_chrome_command.mm |
@@ -0,0 +1,36 @@ |
+// 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 { |
+ NSInteger _tag; |
+} |
+ |
+@synthesize tag = _tag; |
+ |
+- (instancetype)init { |
+ return [self initWithTag:0]; |
+} |
+ |
+- (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 |