Chromium Code Reviews| Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm |
| 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 c804892e202721ebc7424786e2bff54aad798371..6e6df703f6455116e3e213acd66a149d5148de07 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_]; |
|
rohitrao (ping after 24h)
2010/02/09 21:56:50
Why did this move?
|
| // 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(); |
| + } |
| } |
| } |