| 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_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
| 6 | 6 |
| 7 #include <InputScope.h> | 7 #include <InputScope.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 // messages even if we are not in the foreground. So here we check if | 1868 // messages even if we are not in the foreground. So here we check if |
| 1869 // we have any owned popup windows in the foreground and dismiss them. | 1869 // we have any owned popup windows in the foreground and dismiss them. |
| 1870 if (m_hWnd != GetForegroundWindow()) { | 1870 if (m_hWnd != GetForegroundWindow()) { |
| 1871 HWND toplevel_hwnd = ::GetAncestor(m_hWnd, GA_ROOT); | 1871 HWND toplevel_hwnd = ::GetAncestor(m_hWnd, GA_ROOT); |
| 1872 EnumThreadWindows( | 1872 EnumThreadWindows( |
| 1873 GetCurrentThreadId(), | 1873 GetCurrentThreadId(), |
| 1874 DismissOwnedPopups, | 1874 DismissOwnedPopups, |
| 1875 reinterpret_cast<LPARAM>(toplevel_hwnd)); | 1875 reinterpret_cast<LPARAM>(toplevel_hwnd)); |
| 1876 } | 1876 } |
| 1877 | 1877 |
| 1878 // This is a bit of a hack, but will work for now since we don't want to | 1878 if (render_widget_host_) { |
| 1879 // pollute this object with WebContentsImpl-specific functionality... | |
| 1880 bool handled_by_WebContentsImpl = false; | |
| 1881 if (!is_fullscreen_ && GetParent()) { | |
| 1882 // Use a special reflected message to break recursion. If we send | |
| 1883 // WM_MOUSEWHEEL, the focus manager subclass of web contents will | |
| 1884 // route it back here. | |
| 1885 MSG new_message = {0}; | |
| 1886 new_message.hwnd = m_hWnd; | |
| 1887 new_message.message = message; | |
| 1888 new_message.wParam = wparam; | |
| 1889 new_message.lParam = lparam; | |
| 1890 | |
| 1891 handled_by_WebContentsImpl = | |
| 1892 !!::SendMessage(GetParent(), base::win::kReflectedMessage, 0, | |
| 1893 reinterpret_cast<LPARAM>(&new_message)); | |
| 1894 } | |
| 1895 | |
| 1896 if (!handled_by_WebContentsImpl && render_widget_host_) { | |
| 1897 render_widget_host_->ForwardWheelEvent( | 1879 render_widget_host_->ForwardWheelEvent( |
| 1898 WebInputEventFactory::mouseWheelEvent(m_hWnd, message, wparam, | 1880 WebInputEventFactory::mouseWheelEvent(m_hWnd, message, wparam, |
| 1899 lparam)); | 1881 lparam)); |
| 1900 } | 1882 } |
| 1901 handled = TRUE; | 1883 handled = TRUE; |
| 1902 return 0; | 1884 return 0; |
| 1903 } | 1885 } |
| 1904 | 1886 |
| 1905 WebTouchState::WebTouchState(const RenderWidgetHostViewWin* window) | 1887 WebTouchState::WebTouchState(const RenderWidgetHostViewWin* window) |
| 1906 : window_(window) { } | 1888 : window_(window) { } |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3067 return new RenderWidgetHostViewWin(widget); | 3049 return new RenderWidgetHostViewWin(widget); |
| 3068 } | 3050 } |
| 3069 | 3051 |
| 3070 // static | 3052 // static |
| 3071 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3053 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 3072 WebKit::WebScreenInfo* results) { | 3054 WebKit::WebScreenInfo* results) { |
| 3073 GetScreenInfoForWindow(results, 0); | 3055 GetScreenInfoForWindow(results, 0); |
| 3074 } | 3056 } |
| 3075 | 3057 |
| 3076 } // namespace content | 3058 } // namespace content |
| OLD | NEW |