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

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

Issue 2586373003: MacViews: Allow toolkit-views for "Global Error" bubbles. (Closed)
Patch Set: addObserverForName Created 3 years, 11 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.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
index 73ce5ce87c0c62be5763220118adefc2bda2eb73..6568fcadda869523ce28469bcb37c5553c968ead 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -965,18 +965,28 @@ class NotificationBridge : public AppMenuIconController::Delegate {
return locationBarView_->GetBubblePointForDecoration(
locationBarView_->star_decoration());
- // Grab bottom middle of hotdogs.
- NSRect frame = appMenuButton_.frame;
- NSPoint point = NSMakePoint(NSMidX(frame), NSMinY(frame));
- // Inset to account for the whitespace around the hotdogs.
- point.y += app_menu_controller::kAppMenuBubblePointOffsetY;
- return [self.view convertPoint:point toView:nil];
+ return [self appMenuBubblePoint];
}
- (NSPoint)saveCreditCardBubblePoint {
return locationBarView_->GetSaveCreditCardBubblePoint();
}
+- (NSPoint)appMenuBubblePoint {
+ NSRect frame = appMenuButton_.frame;
+ NSPoint point;
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ // Use the bottom right for MD-style anchoring (no arrow).
+ point = NSMakePoint(NSMaxX(frame), NSMinY(frame));
+ } else {
+ // Grab bottom middle of hotdogs.
+ point = NSMakePoint(NSMidX(frame), NSMinY(frame));
+ // Inset to account for the whitespace around the hotdogs.
+ point.y += app_menu_controller::kAppMenuBubblePointOffsetY;
+ }
+ return [self.view convertPoint:point toView:nil];
+}
+
- (CGFloat)baseToolbarHeight {
// Height of the toolbar in pixels when the bookmark bar is closed.
const CGFloat kBaseToolbarHeightNormal = 37;
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller.h ('k') | chrome/browser/ui/views/global_error_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698