| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" | 5 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" |
| 6 | 6 |
| 7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" | 10 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" |
| 11 | 11 |
| 12 @implementation GenericChromeCommand | 12 @implementation GenericChromeCommand |
| 13 | 13 |
| 14 @synthesize tag = _tag; | 14 @synthesize tag = _tag; |
| 15 | 15 |
| 16 - (instancetype)init { |
| 17 NOTREACHED(); |
| 18 return nil; |
| 19 } |
| 20 |
| 16 - (instancetype)initWithTag:(NSInteger)tag { | 21 - (instancetype)initWithTag:(NSInteger)tag { |
| 17 self = [super init]; | 22 self = [super init]; |
| 18 if (self) { | 23 if (self) { |
| 19 _tag = tag; | 24 _tag = tag; |
| 20 } | 25 } |
| 21 return self; | 26 return self; |
| 22 } | 27 } |
| 23 | 28 |
| 24 - (void)executeOnMainWindow { | 29 - (void)executeOnMainWindow { |
| 25 UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow]; | 30 UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow]; |
| 26 DCHECK(mainWindow); | 31 DCHECK(mainWindow); |
| 27 [mainWindow chromeExecuteCommand:self]; | 32 [mainWindow chromeExecuteCommand:self]; |
| 28 } | 33 } |
| 29 | 34 |
| 30 @end | 35 @end |
| OLD | NEW |