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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/l10n_util_win.h" | 10 #include "app/l10n_util_win.h" |
11 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 12 #include "app/win/hwnd_util.h" |
12 #include "app/view_prop.h" | 13 #include "app/view_prop.h" |
13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
14 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
15 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
16 #include "base/process_util.h" | 17 #include "base/process_util.h" |
17 #include "base/scoped_comptr_win.h" | 18 #include "base/scoped_comptr_win.h" |
18 #include "base/thread.h" | 19 #include "base/thread.h" |
19 #include "base/win_util.h" | 20 #include "base/win_util.h" |
20 #include "base/win/scoped_gdi_object.h" | 21 #include "base/win/scoped_gdi_object.h" |
21 #include "chrome/browser/accessibility/browser_accessibility_win.h" | 22 #include "chrome/browser/accessibility/browser_accessibility_win.h" |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 // an event to the renderer which would then eventually send over | 1442 // an event to the renderer which would then eventually send over |
1442 // a setFocus call to the plugin widget. This would ensure that | 1443 // a setFocus call to the plugin widget. This would ensure that |
1443 // the renderer (webkit) knows about the plugin widget receiving | 1444 // the renderer (webkit) knows about the plugin widget receiving |
1444 // focus. | 1445 // focus. |
1445 // TODO(iyengar) Do the right thing as per the above comment. | 1446 // TODO(iyengar) Do the right thing as per the above comment. |
1446 POINT cursor_pos = {0}; | 1447 POINT cursor_pos = {0}; |
1447 ::GetCursorPos(&cursor_pos); | 1448 ::GetCursorPos(&cursor_pos); |
1448 ::ScreenToClient(m_hWnd, &cursor_pos); | 1449 ::ScreenToClient(m_hWnd, &cursor_pos); |
1449 HWND child_window = ::RealChildWindowFromPoint(m_hWnd, cursor_pos); | 1450 HWND child_window = ::RealChildWindowFromPoint(m_hWnd, cursor_pos); |
1450 if (::IsWindow(child_window) && child_window != m_hWnd) { | 1451 if (::IsWindow(child_window) && child_window != m_hWnd) { |
1451 if (win_util::GetClassName(child_window) == | 1452 if (app::win::GetClassName(child_window) == |
1452 webkit::npapi::kWrapperNativeWindowClassName) | 1453 webkit::npapi::kWrapperNativeWindowClassName) |
1453 child_window = ::GetWindow(child_window, GW_CHILD); | 1454 child_window = ::GetWindow(child_window, GW_CHILD); |
1454 | 1455 |
1455 ::SetFocus(child_window); | 1456 ::SetFocus(child_window); |
1456 return MA_NOACTIVATE; | 1457 return MA_NOACTIVATE; |
1457 } | 1458 } |
1458 } | 1459 } |
1459 handled = FALSE; | 1460 handled = FALSE; |
1460 render_widget_host_->OnMouseActivate(); | 1461 render_widget_host_->OnMouseActivate(); |
1461 return MA_ACTIVATE; | 1462 return MA_ACTIVATE; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 } | 1808 } |
1808 | 1809 |
1809 // static | 1810 // static |
1810 RenderWidgetHostView* | 1811 RenderWidgetHostView* |
1811 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1812 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1812 gfx::NativeView native_view) { | 1813 gfx::NativeView native_view) { |
1813 return ::IsWindow(native_view) ? | 1814 return ::IsWindow(native_view) ? |
1814 reinterpret_cast<RenderWidgetHostView*>( | 1815 reinterpret_cast<RenderWidgetHostView*>( |
1815 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1816 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
1816 } | 1817 } |
OLD | NEW |