| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 | 834 |
| 835 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { | 835 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { |
| 836 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale | 836 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale |
| 837 // of a browser process. | 837 // of a browser process. |
| 838 OnInputLangChange(0, 0); | 838 OnInputLangChange(0, 0); |
| 839 // Marks that window as supporting mouse-wheel messages rerouting so it is | 839 // Marks that window as supporting mouse-wheel messages rerouting so it is |
| 840 // scrolled when under the mouse pointer even if inactive. | 840 // scrolled when under the mouse pointer even if inactive. |
| 841 props_.push_back(views::SetWindowSupportsRerouteMouseWheel(m_hWnd)); | 841 props_.push_back(views::SetWindowSupportsRerouteMouseWheel(m_hWnd)); |
| 842 props_.push_back(new ViewProp(m_hWnd, kRenderWidgetHostViewKey, | 842 props_.push_back(new ViewProp(m_hWnd, kRenderWidgetHostViewKey, |
| 843 static_cast<RenderWidgetHostView*>(this))); | 843 static_cast<RenderWidgetHostView*>(this))); |
| 844 // Save away our HWND in the parent window as a property so that the |
| 845 // accessibility code can find it. |
| 846 accessibility_prop_.reset(new ViewProp(GetParent(), |
| 847 kViewsNativeHostPropForAccessibility, |
| 848 m_hWnd)); |
| 849 |
| 844 return 0; | 850 return 0; |
| 845 } | 851 } |
| 846 | 852 |
| 847 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, | 853 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, |
| 848 HWND window) { | 854 HWND window) { |
| 849 // If the container is a popup, clicking elsewhere on screen should close the | 855 // If the container is a popup, clicking elsewhere on screen should close the |
| 850 // popup. | 856 // popup. |
| 851 if (close_on_deactivate_ && action == WA_INACTIVE) { | 857 if (close_on_deactivate_ && action == WA_INACTIVE) { |
| 852 // Send a windows message so that any derived classes | 858 // Send a windows message so that any derived classes |
| 853 // will get a change to override the default handling | 859 // will get a change to override the default handling |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1814 } | 1820 } |
| 1815 | 1821 |
| 1816 // static | 1822 // static |
| 1817 RenderWidgetHostView* | 1823 RenderWidgetHostView* |
| 1818 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1824 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 1819 gfx::NativeView native_view) { | 1825 gfx::NativeView native_view) { |
| 1820 return ::IsWindow(native_view) ? | 1826 return ::IsWindow(native_view) ? |
| 1821 reinterpret_cast<RenderWidgetHostView*>( | 1827 reinterpret_cast<RenderWidgetHostView*>( |
| 1822 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1828 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
| 1823 } | 1829 } |
| OLD | NEW |