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

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

Issue 1858773006: [Extensions UI] Use the ExtensionMessageBubbleBridge for Views platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm
diff --git a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm
index 05cb927a990c9f4891975ed0a1199ae73a558142..014f5c0d844ad36c0b54b41c45c899b6df0b9968 100644
--- a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm
+++ b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm
@@ -63,8 +63,10 @@ CGFloat kMinWidth = 320.0;
- (id)initWithParentWindow:(NSWindow*)parentWindow
anchorPoint:(NSPoint)anchorPoint
- delegate:(std::unique_ptr<ToolbarActionsBarBubbleDelegate>)
- delegate {
+ anchoredToAction:(BOOL)anchoredToAction
+ delegate:
+ (std::unique_ptr<ToolbarActionsBarBubbleDelegate>)
+ delegate {
base::scoped_nsobject<InfoBubbleWindow> window(
[[InfoBubbleWindow alloc]
initWithContentRect:ui::kWindowSizeDeterminedLater
@@ -75,6 +77,7 @@ CGFloat kMinWidth = 320.0;
parentWindow:parentWindow
anchoredAt:anchorPoint])) {
acknowledged_ = NO;
+ anchoredToAction_ = anchoredToAction;
delegate_ = std::move(delegate);
ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance();
@@ -87,6 +90,8 @@ CGFloat kMinWidth = 320.0;
if (!g_animations_enabled)
[window setAllowedAnimations:info_bubble::kAnimateNone];
+ [self setShouldCloseOnResignKey:delegate_->ShouldCloseOnDeactivate()];
+
[self layout];
[[self window] makeFirstResponder:
@@ -229,7 +234,7 @@ CGFloat kMinWidth = 320.0;
std::max(std::max(kMinWidth, buttonStripWidth), headingWidth);
NSTextField* content =
- [self addTextFieldWithString:delegate_->GetBodyText()
+ [self addTextFieldWithString:delegate_->GetBodyText(anchoredToAction_)
fontSize:12.0
alignment:NSLeftTextAlignment];
[content setFrame:NSMakeRect(0, 0, windowWidth, 0)];

Powered by Google App Engine
This is Rietveld 408576698