Index: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm |
diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm |
index b5dbd4ed881e35f8c51b6506d6eab33cba4f65be..7fc525774ecd9176f3c461d1b03e28cf7d9b0ba5 100644 |
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm |
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm |
@@ -174,6 +174,12 @@ class DevtoolsNotificationBridge : public content::NotificationObserver { |
InfoBubbleView* view = self.bubble; |
[view setArrowLocation:arrowLocation]; |
+ // alternative1: call [view setAnchorPoint:anchoredAt] here, drop the |
+ // onWindowChanged diff chunk. (or some kind of positionWindow call). |
+ |
+ // alternative2: hook into that setArrowLocation above in the bubble |
+ // controller (also: alignment), and keep the window position consistent. |
+ |
extensionView_ = host->view()->GetNativeView(); |
container_.reset(new ExtensionPopupContainer(self)); |
static_cast<ExtensionViewMac*>(host->view()) |
@@ -403,6 +409,11 @@ class DevtoolsNotificationBridge : public content::NotificationObserver { |
} |
- (void)onWindowChanged { |
+ // The window is positioned before creating the host, to ensure the host is |
+ // created with the correct screen information. |
+ if (!host_) |
+ return; |
+ |
ExtensionViewMac* extensionView = |
static_cast<ExtensionViewMac*>(host_->view()); |
// Let the extension view know, so that it can tell plugins. |