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

Unified Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 636283004: To ensure that the location bar will not reach the minimum width. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make naming consistent. Created 6 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/extensions/browser_actions_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
index 4e91304d984bd5a5db803745d28ff5f043b782cd..76a374c07de9c44b375d21fddbdd4e41f57e1497 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
@@ -119,6 +119,10 @@ const CGFloat kBrowserActionBubbleYOffset = 3.0;
// toolbar know that the drag has finished.
- (void)containerDragFinished:(NSNotification*)notification;
+// Sends a notification for the toolbar to determine whether the container can
+// translate with a delta on x-axis.
+- (void)containerWillTranslateOnX:(NSNotification*)notification;
+
// Adjusts the position of the surrounding action buttons depending on where the
// button is within the container.
- (void)actionButtonDragging:(NSNotification*)notification;
@@ -305,6 +309,11 @@ class ExtensionServiceObserverBridge
selector:@selector(containerDragFinished:)
name:kBrowserActionGrippyDragFinishedNotification
object:containerView_];
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(containerWillTranslateOnX:)
+ name:kBrowserActionGrippyWillDragNotification
+ object:containerView_];
// Listen for a finished drag from any button to make sure each open window
// stays in sync.
[[NSNotificationCenter defaultCenter]
@@ -670,6 +679,13 @@ class ExtensionServiceObserverBridge
object:self];
}
+- (void)containerWillTranslateOnX:(NSNotification*)notification {
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:kBrowserActionGrippyWillDragNotification
+ object:self
+ userInfo:notification.userInfo];
+}
+
- (void)actionButtonDragging:(NSNotification*)notification {
if (![self chevronIsHidden])
[self setChevronHidden:YES inFrame:[containerView_ frame] animate:YES];

Powered by Google App Engine
This is Rietveld 408576698