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

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

Issue 363233002: Abstract base 'ExtensionView' to Fix DEPS violation in extension_view_host.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Init() must be done after assigning Created 6 years, 6 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/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)

Powered by Google App Engine
This is Rietveld 408576698