summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller.mm
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 15:52:13 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 15:52:13 +0000
commit1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467 (patch)
tree95f198cfa03484708e1df0d75a909e4e99ad3134 /chrome/browser/cocoa/browser_window_controller.mm
parent0e4898dee7088bf0e0e775ededf342fad6fe9606 (diff)
downloadchromium_src-1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467.zip
chromium_src-1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467.tar.gz
chromium_src-1e6e3c99f8ca2ef9d8e86ddddec20dadc0fbf467.tar.bz2
Send window frame information to Mac plugins via IPC
Sends any window frame and relevent content view location changes to the plugin process via IPC, so that the plugin process always knows where the plugin is rather than only knowing when the mouse is within the plugin area. This will be necessary for supporting NPN_ConvertPoint, and for supporting Java2 as currently implemented. Related changes: - Now that window information is being sent on init and un-hide, use that to get correct initial window focus information. - Add a missing window focus change notification uncovered by the above. - Use live mouse location for idle events, instead of a cached location, now that we have live plugin frame information. - Refactor and simplify the logic for moving the plugin. Note that containing_window_frame_ is currently unused, but will be shortly for NPN_ConvertPoint, and is so closely related to the added IPC that I added it now rather than having to immediately change the new messages and functions. BUG=34046,31858,31543,29457 TEST=Mouse tracking in Carbon plugins should still work correctly, even across window moves, info/bookmark bar show/hides, etc. (Automated tests of location tracking will follow shortly with full NPN_ConvertPoint implementation.) Review URL: http://codereview.chromium.org/573015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index ae59e2f..d7058e9 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -1701,6 +1701,12 @@ willPositionSheet:(NSWindow*)sheet
if (statusBubble_) {
statusBubble_->UpdateSizeAndPosition();
}
+
+ // Let the selected RenderWidgetHostView know, so that it can tell plugins.
+ if (TabContents* contents = browser_->GetSelectedTabContents()) {
+ if (RenderWidgetHostView* rwhv = contents->render_widget_host_view())
+ rwhv->WindowFrameChanged();
+ }
}
// Handle the openLearnMoreAboutCrashLink: action from SadTabController when
@@ -1738,6 +1744,12 @@ willPositionSheet:(NSWindow*)sheet
(windowTopGrowth_ > 0 && NSMinY(windowFrame) != NSMinY(workarea)) ||
(windowBottomGrowth_ > 0 && NSMaxY(windowFrame) != NSMaxY(workarea)))
[self resetWindowGrowthState];
+
+ // Let the selected RenderWidgetHostView know, so that it can tell plugins.
+ if (TabContents* contents = browser_->GetSelectedTabContents()) {
+ if (RenderWidgetHostView* rwhv = contents->render_widget_host_view())
+ rwhv->WindowFrameChanged();
+ }
}
// Delegate method called when window will be resized; not called for
@@ -2114,10 +2126,21 @@ willPositionSheet:(NSWindow*)sheet
width:(CGFloat)width {
NSView* tabContentView = [self tabContentArea];
NSRect tabContentFrame = [tabContentView frame];
+
+ bool contentShifted = NSMaxY(tabContentFrame) != maxY;
+
tabContentFrame.origin.y = minY;
tabContentFrame.size.height = maxY - minY;
tabContentFrame.size.width = width;
[tabContentView setFrame:tabContentFrame];
+
+ // If the relayout shifts the content area up or down, let the renderer know.
+ if (contentShifted) {
+ if (TabContents* contents = browser_->GetSelectedTabContents()) {
+ if (RenderWidgetHostView* rwhv = contents->render_widget_host_view())
+ rwhv->WindowFrameChanged();
+ }
+ }
}
- (BOOL)shouldShowBookmarkBar {