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 94d0dca5f38b18171b6e6272a14f0257a599f7dd..8679332639a343d8cc6811d7d04b92dc4ab83a62 100644 |
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm |
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm |
@@ -59,6 +59,10 @@ CGFloat Clamp(CGFloat value, CGFloat min, CGFloat max) { |
// Called when the extension view is shown. |
- (void)onViewDidShow; |
+ |
+// Called when the window moves or resizes. Notifies the extension. |
+- (void)onWindowChanged; |
+ |
@end |
class ExtensionPopupContainer : public ExtensionViewMac::Container { |
@@ -170,9 +174,10 @@ class DevtoolsNotificationBridge : public content::NotificationObserver { |
InfoBubbleView* view = self.bubble; |
[view setArrowLocation:arrowLocation]; |
- extensionView_ = host->view()->native_view(); |
+ extensionView_ = host->view()->GetNativeView(); |
container_.reset(new ExtensionPopupContainer(self)); |
- host->view()->set_container(container_.get()); |
+ static_cast<ExtensionViewMac*>(host->view()) |
+ ->set_container(container_.get()); |
NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
[center addObserver:self |
@@ -223,7 +228,7 @@ class DevtoolsNotificationBridge : public content::NotificationObserver { |
if (gPopup == self) |
gPopup = nil; |
if (host_->view()) |
- host_->view()->set_container(NULL); |
+ static_cast<ExtensionViewMac*>(host_->view())->set_container(NULL); |
host_.reset(); |
} |
@@ -382,16 +387,20 @@ class DevtoolsNotificationBridge : public content::NotificationObserver { |
[self onSizeChanged:pendingSize_]; |
} |
-- (void)windowDidResize:(NSNotification*)notification { |
+- (void)onWindowChanged { |
+ ExtensionViewMac* extensionView = |
+ static_cast<ExtensionViewMac*>(host_->view()); |
// Let the extension view know, so that it can tell plugins. |
- if (host_->view()) |
- host_->view()->WindowFrameChanged(); |
+ if (extensionView) |
+ extensionView->WindowFrameChanged(); |
+} |
+ |
+- (void)windowDidResize:(NSNotification*)notification { |
+ [self onWindowChanged]; |
} |
- (void)windowDidMove:(NSNotification*)notification { |
- // Let the extension view know, so that it can tell plugins. |
- if (host_->view()) |
- host_->view()->WindowFrameChanged(); |
+ [self onWindowChanged]; |
} |
// Private (TestingAPI) |