summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 22:12:06 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 22:12:06 +0000
commitb601329bf3f082a7f40b6d665c6d666a041dac36 (patch)
tree637666faf0d1eaa3588e7cf650741ae29797a4a6
parentc14d8e77a710ccb632e9113b3e8e5b6228025434 (diff)
downloadchromium_src-b601329bf3f082a7f40b6d665c6d666a041dac36.zip
chromium_src-b601329bf3f082a7f40b6d665c6d666a041dac36.tar.gz
chromium_src-b601329bf3f082a7f40b6d665c6d666a041dac36.tar.bz2
Don't send frame update messages for non-browser RWHVs
BUG=35141 TEST=Trigger an autocomplete popup; watch the renderer not crash. Review URL: http://codereview.chromium.org/594015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38520 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index c804892..6e6df70 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -124,9 +124,9 @@ RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
void RenderWidgetHostViewMac::InitAsPopup(
RenderWidgetHostView* parent_host_view,
const gfx::Rect& pos) {
- [parent_host_view->GetNativeView() addSubview:cocoa_view_];
[cocoa_view_ setCloseOnDeactivate:YES];
[cocoa_view_ setCanBeKeyView:activatable_ ? YES : NO];
+ [parent_host_view->GetNativeView() addSubview:cocoa_view_];
// TODO(avi):Why the hell are these screen coordinates? The Windows code calls
// ::MoveWindow() which indicates they should be local, but when running it I
@@ -1544,11 +1544,15 @@ extern NSString *NSTextInputReplacementRangeAttributeName;
// If we move into a new window, refresh the frame information. We don't need
// to do it if it was the same window as it used to be in, since that case
// is covered by DidBecomeSelected.
- NSWindow* newWindow = [self window];
- // Pointer comparison only, since we don't know if lastWindow_ is still valid.
- if (newWindow && (newWindow != lastWindow_)) {
- lastWindow_ = newWindow;
- renderWidgetHostView_->WindowFrameChanged();
+ // We only want to do this for real browser views, not popups.
+ if (canBeKeyView_) {
+ NSWindow* newWindow = [self window];
+ // Pointer comparison only, since we don't know if lastWindow_ is still
+ // valid.
+ if (newWindow && (newWindow != lastWindow_)) {
+ lastWindow_ = newWindow;
+ renderWidgetHostView_->WindowFrameChanged();
+ }
}
}