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/browser_view_controller_dependency_factory.h" | 5 #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h" |
6 | 6 |
7 #import <PassKit/PassKit.h> | 7 #import <PassKit/PassKit.h> |
8 | 8 |
9 #include "base/ios/ios_util.h" | 9 #include "base/ios/ios_util.h" |
10 #include "components/infobars/core/infobar_manager.h" | 10 #include "components/infobars/core/infobar_manager.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 - (ToolbarModelIOS*)newToolbarModelIOSWithDelegate: | 76 - (ToolbarModelIOS*)newToolbarModelIOSWithDelegate: |
77 (ToolbarModelDelegateIOS*)delegate { | 77 (ToolbarModelDelegateIOS*)delegate { |
78 return new ToolbarModelImplIOS(delegate); | 78 return new ToolbarModelImplIOS(delegate); |
79 } | 79 } |
80 | 80 |
81 - (WebToolbarController*) | 81 - (WebToolbarController*) |
82 newWebToolbarControllerWithDelegate:(id<WebToolbarDelegate>)delegate | 82 newWebToolbarControllerWithDelegate:(id<WebToolbarDelegate>)delegate |
83 urlLoader:(id<UrlLoader>)urlLoader | 83 urlLoader:(id<UrlLoader>)urlLoader |
84 preloadProvider:(id<PreloadProvider>)preload { | 84 preloadProvider:(id<PreloadProvider>)preload |
| 85 dispatcher:(id<BrowserCommands>)dispatcher { |
85 return [[WebToolbarController alloc] initWithDelegate:delegate | 86 return [[WebToolbarController alloc] initWithDelegate:delegate |
86 urlLoader:urlLoader | 87 urlLoader:urlLoader |
87 browserState:browserState_ | 88 browserState:browserState_ |
88 preloadProvider:preload]; | 89 preloadProvider:preload |
| 90 dispatcher:dispatcher]; |
89 } | 91 } |
90 | 92 |
91 - (KeyCommandsProvider*)newKeyCommandsProvider { | 93 - (KeyCommandsProvider*)newKeyCommandsProvider { |
92 return [[KeyCommandsProvider alloc] init]; | 94 return [[KeyCommandsProvider alloc] init]; |
93 } | 95 } |
94 | 96 |
95 - (void)showSnackbarWithMessage:(NSString*)text { | 97 - (void)showSnackbarWithMessage:(NSString*)text { |
96 MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text]; | 98 MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text]; |
97 message.accessibilityLabel = text; | 99 message.accessibilityLabel = text; |
98 message.duration = 2.0; | 100 message.duration = 2.0; |
99 message.category = kBrowserViewControllerSnackbarCategory; | 101 message.category = kBrowserViewControllerSnackbarCategory; |
100 [MDCSnackbarManager showMessage:message]; | 102 [MDCSnackbarManager showMessage:message]; |
101 } | 103 } |
102 | 104 |
103 - (AlertCoordinator*)alertCoordinatorWithTitle:(NSString*)title | 105 - (AlertCoordinator*)alertCoordinatorWithTitle:(NSString*)title |
104 message:(NSString*)message | 106 message:(NSString*)message |
105 viewController: | 107 viewController: |
106 (UIViewController*)viewController { | 108 (UIViewController*)viewController { |
107 AlertCoordinator* alertCoordinator = | 109 AlertCoordinator* alertCoordinator = |
108 [[AlertCoordinator alloc] initWithBaseViewController:viewController | 110 [[AlertCoordinator alloc] initWithBaseViewController:viewController |
109 title:title | 111 title:title |
110 message:message]; | 112 message:message]; |
111 [alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_OK) | 113 [alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_OK) |
112 action:nil | 114 action:nil |
113 style:UIAlertActionStyleDefault]; | 115 style:UIAlertActionStyleDefault]; |
114 return alertCoordinator; | 116 return alertCoordinator; |
115 } | 117 } |
116 | 118 |
117 @end | 119 @end |
OLD | NEW |