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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.h

Issue 1305143008: [Mac] Implement LocationBarViewMac::UpdateLocationBarVisibility() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer feedback Created 5 years, 2 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: chrome/browser/ui/cocoa/toolbar/toolbar_controller.h
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h
index 1740e00d5c97f683a7d63ec7c4b1b2a923aa059e..b85fdb6eec4034cb450bf95be5a641752164f0a3 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.h
@@ -82,10 +82,6 @@ class NotificationBridge;
BOOL hasLocationBar_; // If |hasToolbar_| is YES, this must also be YES.
BOOL locationBarAtMinSize_; // If the location bar is at the minimum size.
- // We have an extra retain in the locationBar_.
- // See comments in awakeFromNib for more info.
- base::scoped_nsobject<AutocompleteTextField> locationBarRetainer_;
-
// Tracking area for mouse enter/exit/moved in the toolbar.
ui::ScopedCrTrackingArea trackingArea_;
@@ -99,10 +95,12 @@ class NotificationBridge;
// Initialize the toolbar and register for command updates. The profile is
// needed for initializing the location bar. The browser is needed for
-// the toolbar model and back/forward menus.
+// the toolbar model and back/forward menus. The resizeDelegate is used
+// to smoothly animate height changes for the toolbar.
- (id)initWithCommands:(CommandUpdater*)commands
profile:(Profile*)profile
- browser:(Browser*)browser;
+ browser:(Browser*)browser
+ resizeDelegate:(id<ViewResizer>)resizeDelegate;
// Get the C++ bridge object representing the location bar for this tab.
- (LocationBarViewMac*)locationBarBridge;
@@ -167,6 +165,16 @@ class NotificationBridge;
// Create and add the Browser Action buttons to the toolbar view.
- (void)createBrowserActionButtons;
+// Updates the visibility of the toolbar if the requested visibility differs
+// from the current visibility, with an optional animation.
+- (void)updateVisibility:(BOOL)visible withAnimation:(BOOL)animate;
+
+// Hide the back, forward, reload, home, and wrench buttons of the toolbar,
tapted 2015/10/20 06:31:08 nit: no comma after `toolbar,`. Or a new sentence,
dominickn 2015/10/26 02:53:04 Done.
+// so that the location bar occupies the entire width. There is no way to
+// undo this operation, and once it is called, no other modifications to
+// the toolbar or location bar width should be made.
tapted 2015/10/20 06:31:08 what if the window is resized?
dominickn 2015/10/26 02:53:04 That *just works*. Have updated the comment.
+- (void)showLocationBarOnly;
tapted 2015/10/20 06:31:09 move this declaration to `@interface ToolbarContro
dominickn 2015/10/26 02:53:04 Done.
+
// Return the BrowserActionsController for this toolbar.
- (BrowserActionsController*)browserActionsController;
@@ -186,6 +194,7 @@ class NotificationBridge;
- (id)initWithCommands:(CommandUpdater*)commands
profile:(Profile*)profile
browser:(Browser*)browser
+ resizeDelegate:(id<ViewResizer>)resizeDelegate
nibFileNamed:(NSString*)nibName;
@end

Powered by Google App Engine
This is Rietveld 408576698