OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/app/chrome_test_util.h" | 5 #import "ios/chrome/test/app/chrome_test_util.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #import "breakpad/src/client/ios/BreakpadController.h" | 8 #import "breakpad/src/client/ios/BreakpadController.h" |
9 #include "components/metrics/metrics_pref_names.h" | 9 #include "components/metrics/metrics_pref_names.h" |
10 #include "components/metrics/metrics_service.h" | 10 #include "components/metrics/metrics_service.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ios::ChromeBrowserState* GetCurrentIncognitoBrowserState() { | 126 ios::ChromeBrowserState* GetCurrentIncognitoBrowserState() { |
127 return GetBrowserState(true); | 127 return GetBrowserState(true); |
128 } | 128 } |
129 | 129 |
130 NSUInteger GetRegisteredKeyCommandsCount() { | 130 NSUInteger GetRegisteredKeyCommandsCount() { |
131 BrowserViewController* mainBVC = | 131 BrowserViewController* mainBVC = |
132 GetMainController().browserViewInformation.mainBVC; | 132 GetMainController().browserViewInformation.mainBVC; |
133 return mainBVC.keyCommands.count; | 133 return mainBVC.keyCommands.count; |
134 } | 134 } |
135 | 135 |
| 136 id<BrowserCommands> BrowserCommandDispatcherForMainBVC() { |
| 137 BrowserViewController* mainBVC = |
| 138 GetMainController().browserViewInformation.mainBVC; |
| 139 return mainBVC.browserCommandDispatcher; |
| 140 } |
| 141 |
136 void RunCommandWithActiveViewController(GenericChromeCommand* command) { | 142 void RunCommandWithActiveViewController(GenericChromeCommand* command) { |
137 [GetActiveViewController() chromeExecuteCommand:command]; | 143 [GetActiveViewController() chromeExecuteCommand:command]; |
138 } | 144 } |
139 | 145 |
140 void RemoveAllInfoBars() { | 146 void RemoveAllInfoBars() { |
141 infobars::InfoBarManager* info_bar_manager = [GetCurrentTab() infoBarManager]; | 147 infobars::InfoBarManager* info_bar_manager = [GetCurrentTab() infoBarManager]; |
142 if (info_bar_manager) { | 148 if (info_bar_manager) { |
143 info_bar_manager->RemoveAllInfoBars(false /* animate */); | 149 info_bar_manager->RemoveAllInfoBars(false /* animate */); |
144 } | 150 } |
145 } | 151 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 void OpenChromeFromExternalApp(const GURL& url) { | 224 void OpenChromeFromExternalApp(const GURL& url) { |
219 [[[UIApplication sharedApplication] delegate] | 225 [[[UIApplication sharedApplication] delegate] |
220 applicationWillResignActive:[UIApplication sharedApplication]]; | 226 applicationWillResignActive:[UIApplication sharedApplication]]; |
221 [GetMainController() setStartupParametersWithURL:url]; | 227 [GetMainController() setStartupParametersWithURL:url]; |
222 | 228 |
223 [[[UIApplication sharedApplication] delegate] | 229 [[[UIApplication sharedApplication] delegate] |
224 applicationDidBecomeActive:[UIApplication sharedApplication]]; | 230 applicationDidBecomeActive:[UIApplication sharedApplication]]; |
225 } | 231 } |
226 | 232 |
227 } // namespace chrome_test_util | 233 } // namespace chrome_test_util |
OLD | NEW |