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_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 texture_mailbox.sync_point(), | 1784 texture_mailbox.sync_point(), |
1785 video_frame.get(), | 1785 video_frame.get(), |
1786 finished_callback); | 1786 finished_callback); |
1787 } | 1787 } |
1788 | 1788 |
1789 void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) { | 1789 void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) { |
1790 GetScreenInfoForWindow(results, window_->GetRootWindow() ? window_ : NULL); | 1790 GetScreenInfoForWindow(results, window_->GetRootWindow() ? window_ : NULL); |
1791 } | 1791 } |
1792 | 1792 |
1793 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { | 1793 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { |
| 1794 gfx::Rect rect = window_->GetToplevelWindow()->GetBoundsInScreen(); |
| 1795 |
1794 #if defined(OS_WIN) | 1796 #if defined(OS_WIN) |
1795 // aura::Window::GetBoundsInScreen doesn't take non-client area into | 1797 rect = gfx::win::ScreenToDIPRect(rect); |
1796 // account. | 1798 #endif |
1797 RECT window_rect = {0}; | |
1798 | 1799 |
1799 aura::Window* top_level = window_->GetToplevelWindow(); | 1800 return rect; |
1800 aura::WindowTreeHost* host = top_level->GetHost(); | |
1801 if (!host) | |
1802 return top_level->GetBoundsInScreen(); | |
1803 HWND hwnd = host->GetAcceleratedWidget(); | |
1804 ::GetWindowRect(hwnd, &window_rect); | |
1805 gfx::Rect rect(window_rect); | |
1806 | |
1807 // Maximized windows are outdented from the work area by the frame thickness | |
1808 // even though this "frame" is not painted. This confuses code (and people) | |
1809 // that think of a maximized window as corresponding exactly to the work area. | |
1810 // Correct for this by subtracting the frame thickness back off. | |
1811 if (::IsZoomed(hwnd)) { | |
1812 rect.Inset(GetSystemMetrics(SM_CXSIZEFRAME), | |
1813 GetSystemMetrics(SM_CYSIZEFRAME)); | |
1814 } | |
1815 | |
1816 return gfx::win::ScreenToDIPRect(rect); | |
1817 #else | |
1818 return window_->GetToplevelWindow()->GetBoundsInScreen(); | |
1819 #endif | |
1820 } | 1801 } |
1821 | 1802 |
1822 void RenderWidgetHostViewAura::GestureEventAck( | 1803 void RenderWidgetHostViewAura::GestureEventAck( |
1823 const blink::WebGestureEvent& event, | 1804 const blink::WebGestureEvent& event, |
1824 InputEventAckState ack_result) { | 1805 InputEventAckState ack_result) { |
1825 if (touch_editing_client_) | 1806 if (touch_editing_client_) |
1826 touch_editing_client_->GestureEventAck(event.type); | 1807 touch_editing_client_->GestureEventAck(event.type); |
1827 } | 1808 } |
1828 | 1809 |
1829 void RenderWidgetHostViewAura::ProcessAckedTouchEvent( | 1810 void RenderWidgetHostViewAura::ProcessAckedTouchEvent( |
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3219 RenderWidgetHost* widget) { | 3200 RenderWidgetHost* widget) { |
3220 return new RenderWidgetHostViewAura(widget); | 3201 return new RenderWidgetHostViewAura(widget); |
3221 } | 3202 } |
3222 | 3203 |
3223 // static | 3204 // static |
3224 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3205 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3225 GetScreenInfoForWindow(results, NULL); | 3206 GetScreenInfoForWindow(results, NULL); |
3226 } | 3207 } |
3227 | 3208 |
3228 } // namespace content | 3209 } // namespace content |
OLD | NEW |