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
parent c14d8e77
......@@ -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();
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment