| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
| 6 | 6 |
| 7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
| 8 #import <objc/runtime.h> | 8 #import <objc/runtime.h> |
| 9 #include <OpenGL/gl.h> | 9 #include <OpenGL/gl.h> |
| 10 #include <QuartzCore/QuartzCore.h> | 10 #include <QuartzCore/QuartzCore.h> |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 return; | 794 return; |
| 795 } | 795 } |
| 796 | 796 |
| 797 render_widget_host_->WasHidden(); | 797 render_widget_host_->WasHidden(); |
| 798 browser_compositor_->SetRenderWidgetHostIsHidden(true); | 798 browser_compositor_->SetRenderWidgetHostIsHidden(true); |
| 799 } | 799 } |
| 800 | 800 |
| 801 void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) { | 801 void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) { |
| 802 gfx::Rect rect = GetViewBounds(); | 802 gfx::Rect rect = GetViewBounds(); |
| 803 rect.set_size(size); | 803 rect.set_size(size); |
| 804 SetBounds(rect); | 804 RequestTopLevelBoundsInScreen(rect); |
| 805 } | 805 } |
| 806 | 806 |
| 807 void RenderWidgetHostViewMac::SetBounds(const gfx::Rect& rect) { | 807 void RenderWidgetHostViewMac::RequestTopLevelBoundsInScreen( |
| 808 // |rect.size()| is view coordinates, |rect.origin| is screen coordinates, | 808 const gfx::Rect& rect) { |
| 809 // TODO(thakis): fix, http://crbug.com/73362 | 809 // TODO(miu): Fix: Some callers pass-in |rect.size()| as view coordinates, |
| 810 // but the interface requires |rect| to be in screen coordinates. |
| 811 // http://crbug.com/73362 |
| 812 |
| 810 if (render_widget_host_->is_hidden()) | 813 if (render_widget_host_->is_hidden()) |
| 811 return; | 814 return; |
| 812 | 815 |
| 813 // During the initial creation of the RenderWidgetHostView in | 816 // During the initial creation of the RenderWidgetHostView in |
| 814 // WebContentsImpl::CreateRenderViewForRenderManager, SetSize is called with | 817 // WebContentsImpl::CreateRenderViewForRenderManager, SetSize is called with |
| 815 // an empty size. In the Windows code flow, it is not ignored because | 818 // an empty size. In the Windows code flow, it is not ignored because |
| 816 // subsequent sizing calls from the OS flow through TCVW::WasSized which calls | 819 // subsequent sizing calls from the OS flow through TCVW::WasSized which calls |
| 817 // SetSize() again. On Cocoa, we rely on the Cocoa view struture and resizer | 820 // SetSize() again. On Cocoa, we rely on the Cocoa view struture and resizer |
| 818 // flags to keep things sized properly. On the other hand, if the size is not | 821 // flags to keep things sized properly. On the other hand, if the size is not |
| 819 // empty then this is a valid request for a pop-up. | 822 // empty then this is a valid request for a pop-up. |
| (...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3473 | 3476 |
| 3474 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3477 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3475 // regions that are not draggable. (See ControlRegionView in | 3478 // regions that are not draggable. (See ControlRegionView in |
| 3476 // native_app_window_cocoa.mm). This requires the render host view to be | 3479 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3477 // draggable by default. | 3480 // draggable by default. |
| 3478 - (BOOL)mouseDownCanMoveWindow { | 3481 - (BOOL)mouseDownCanMoveWindow { |
| 3479 return YES; | 3482 return YES; |
| 3480 } | 3483 } |
| 3481 | 3484 |
| 3482 @end | 3485 @end |
| OLD | NEW |