Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm

Issue 2829003002: Add CommandDispatcher to BrowserViewController. (Closed)
Patch Set: rohit comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm b/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm
index bb5bf3ca4e062da477abb909acaf5ee0f1330149..57c3eb39426826bacc380bfa2b70e0bad43bc2cc 100644
--- a/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm
+++ b/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm
@@ -16,6 +16,7 @@
#import "ios/chrome/browser/ui/ntp/google_landing_data_source.h"
#import "ios/chrome/browser/ui/rtl_geometry.h"
#include "ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h"
+#import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h"
#import "ios/chrome/browser/ui/uikit_ui_util.h"
#include "ui/base/l10n/l10n_util.h"
@@ -43,8 +44,6 @@ enum {
base::scoped_nsobject<UIButton> _backButton;
base::scoped_nsobject<UIButton> _forwardButton;
base::scoped_nsobject<UIButton> _omniboxFocuser;
-
- base::WeakNSProtocol<id<GoogleLandingDataSource>> _dataSource;
}
// |YES| if the google landing toolbar can show the forward arrow.
@@ -57,14 +56,13 @@ enum {
@implementation NewTabPageToolbarController
+@synthesize dispatcher = _dispatcher;
@synthesize canGoForward = _canGoForward;
@synthesize canGoBack = _canGoBack;
-- (instancetype)initWithToolbarDataSource:
- (id<GoogleLandingDataSource>)dataSource {
+- (instancetype)init {
self = [super initWithStyle:ToolbarControllerStyleLightMode];
if (self) {
- _dataSource.reset(dataSource);
[self.backgroundView setHidden:YES];
CGFloat boundingWidth = self.view.bounds.size.width;
@@ -217,11 +215,11 @@ enum {
}
- (void)focusOmnibox:(id)sender {
- [_dataSource focusFakebox];
+ [self.dispatcher focusFakebox];
}
- (IBAction)stackButtonTouchDown:(id)sender {
- [_dataSource prepareToEnterTabSwitcher:self];
+ [self.dispatcher prepareToEnterTabSwitcher:self];
}
@end
« no previous file with comments | « ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.h ('k') | ios/chrome/browser/ui/toolbar/web_toolbar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698