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" | |
13 #include "app/view_prop.h" | 12 #include "app/view_prop.h" |
14 #include "base/command_line.h" | 13 #include "base/command_line.h" |
15 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
16 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
17 #include "base/process_util.h" | 16 #include "base/process_util.h" |
18 #include "base/scoped_comptr_win.h" | 17 #include "base/scoped_comptr_win.h" |
19 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
20 #include "base/win/scoped_gdi_object.h" | 19 #include "base/win/scoped_gdi_object.h" |
21 #include "chrome/browser/accessibility/browser_accessibility_win.h" | 20 #include "chrome/browser/accessibility/browser_accessibility_win.h" |
22 #include "chrome/browser/accessibility/browser_accessibility_manager.h" | 21 #include "chrome/browser/accessibility/browser_accessibility_manager.h" |
(...skipping 12 matching lines...) Expand all Loading... |
35 #include "chrome/common/plugin_messages.h" | 34 #include "chrome/common/plugin_messages.h" |
36 #include "chrome/common/render_messages.h" | 35 #include "chrome/common/render_messages.h" |
37 #include "gfx/canvas.h" | 36 #include "gfx/canvas.h" |
38 #include "gfx/canvas_skia.h" | 37 #include "gfx/canvas_skia.h" |
39 #include "gfx/gdi_util.h" | 38 #include "gfx/gdi_util.h" |
40 #include "gfx/rect.h" | 39 #include "gfx/rect.h" |
41 #include "grit/webkit_resources.h" | 40 #include "grit/webkit_resources.h" |
42 #include "skia/ext/skia_utils_win.h" | 41 #include "skia/ext/skia_utils_win.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" |
| 44 #include "ui/base/win/hwnd_util.h" |
45 #include "views/accessibility/view_accessibility.h" | 45 #include "views/accessibility/view_accessibility.h" |
46 #include "views/focus/focus_manager.h" | 46 #include "views/focus/focus_manager.h" |
47 #include "views/focus/focus_util_win.h" | 47 #include "views/focus/focus_util_win.h" |
48 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! | 48 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! |
49 #include "views/widget/widget_win.h" | 49 #include "views/widget/widget_win.h" |
50 #include "webkit/glue/webaccessibility.h" | 50 #include "webkit/glue/webaccessibility.h" |
51 #include "webkit/glue/webcursor.h" | 51 #include "webkit/glue/webcursor.h" |
52 #include "webkit/plugins/npapi/plugin_constants_win.h" | 52 #include "webkit/plugins/npapi/plugin_constants_win.h" |
53 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 53 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
54 #include "webkit/plugins/npapi/webplugin.h" | 54 #include "webkit/plugins/npapi/webplugin.h" |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 // an event to the renderer which would then eventually send over | 1441 // an event to the renderer which would then eventually send over |
1442 // a setFocus call to the plugin widget. This would ensure that | 1442 // a setFocus call to the plugin widget. This would ensure that |
1443 // the renderer (webkit) knows about the plugin widget receiving | 1443 // the renderer (webkit) knows about the plugin widget receiving |
1444 // focus. | 1444 // focus. |
1445 // TODO(iyengar) Do the right thing as per the above comment. | 1445 // TODO(iyengar) Do the right thing as per the above comment. |
1446 POINT cursor_pos = {0}; | 1446 POINT cursor_pos = {0}; |
1447 ::GetCursorPos(&cursor_pos); | 1447 ::GetCursorPos(&cursor_pos); |
1448 ::ScreenToClient(m_hWnd, &cursor_pos); | 1448 ::ScreenToClient(m_hWnd, &cursor_pos); |
1449 HWND child_window = ::RealChildWindowFromPoint(m_hWnd, cursor_pos); | 1449 HWND child_window = ::RealChildWindowFromPoint(m_hWnd, cursor_pos); |
1450 if (::IsWindow(child_window) && child_window != m_hWnd) { | 1450 if (::IsWindow(child_window) && child_window != m_hWnd) { |
1451 if (app::win::GetClassName(child_window) == | 1451 if (ui::GetClassName(child_window) == |
1452 webkit::npapi::kWrapperNativeWindowClassName) | 1452 webkit::npapi::kWrapperNativeWindowClassName) |
1453 child_window = ::GetWindow(child_window, GW_CHILD); | 1453 child_window = ::GetWindow(child_window, GW_CHILD); |
1454 | 1454 |
1455 ::SetFocus(child_window); | 1455 ::SetFocus(child_window); |
1456 return MA_NOACTIVATE; | 1456 return MA_NOACTIVATE; |
1457 } | 1457 } |
1458 } | 1458 } |
1459 handled = FALSE; | 1459 handled = FALSE; |
1460 render_widget_host_->OnMouseActivate(); | 1460 render_widget_host_->OnMouseActivate(); |
1461 return MA_ACTIVATE; | 1461 return MA_ACTIVATE; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 } | 1807 } |
1808 | 1808 |
1809 // static | 1809 // static |
1810 RenderWidgetHostView* | 1810 RenderWidgetHostView* |
1811 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1811 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1812 gfx::NativeView native_view) { | 1812 gfx::NativeView native_view) { |
1813 return ::IsWindow(native_view) ? | 1813 return ::IsWindow(native_view) ? |
1814 reinterpret_cast<RenderWidgetHostView*>( | 1814 reinterpret_cast<RenderWidgetHostView*>( |
1815 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1815 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
1816 } | 1816 } |
OLD | NEW |