| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <peninputpanel_i.c> | 8 #include <peninputpanel_i.c> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "ui/base/l10n/l10n_util_win.h" | 50 #include "ui/base/l10n/l10n_util_win.h" |
| 51 #include "ui/base/text/text_elider.h" | 51 #include "ui/base/text/text_elider.h" |
| 52 #include "ui/base/ui_base_switches.h" | 52 #include "ui/base/ui_base_switches.h" |
| 53 #include "ui/base/view_prop.h" | 53 #include "ui/base/view_prop.h" |
| 54 #include "ui/base/win/hwnd_util.h" | 54 #include "ui/base/win/hwnd_util.h" |
| 55 #include "ui/base/win/mouse_wheel_util.h" | 55 #include "ui/base/win/mouse_wheel_util.h" |
| 56 #include "ui/gfx/canvas.h" | 56 #include "ui/gfx/canvas.h" |
| 57 #include "ui/gfx/gdi_util.h" | 57 #include "ui/gfx/gdi_util.h" |
| 58 #include "ui/gfx/rect.h" | 58 #include "ui/gfx/rect.h" |
| 59 #include "ui/gfx/screen.h" | 59 #include "ui/gfx/screen.h" |
| 60 #include "ui/views/events/event.h" |
| 60 #include "webkit/glue/webaccessibility.h" | 61 #include "webkit/glue/webaccessibility.h" |
| 61 #include "webkit/glue/webcursor.h" | 62 #include "webkit/glue/webcursor.h" |
| 62 #include "webkit/plugins/npapi/plugin_constants_win.h" | 63 #include "webkit/plugins/npapi/plugin_constants_win.h" |
| 63 #include "webkit/plugins/npapi/webplugin.h" | 64 #include "webkit/plugins/npapi/webplugin.h" |
| 64 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 65 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 65 | 66 |
| 66 using base::TimeDelta; | 67 using base::TimeDelta; |
| 67 using base::TimeTicks; | 68 using base::TimeTicks; |
| 68 using content::BrowserThread; | 69 using content::BrowserThread; |
| 69 using content::RenderWidgetHost; | 70 using content::RenderWidgetHost; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 is_loading_(false), | 327 is_loading_(false), |
| 327 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 328 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
| 328 is_fullscreen_(false), | 329 is_fullscreen_(false), |
| 329 ignore_mouse_movement_(true), | 330 ignore_mouse_movement_(true), |
| 330 composition_range_(ui::Range::InvalidRange()), | 331 composition_range_(ui::Range::InvalidRange()), |
| 331 touch_state_(this), | 332 touch_state_(this), |
| 332 pointer_down_context_(false), | 333 pointer_down_context_(false), |
| 333 focus_on_editable_field_(false), | 334 focus_on_editable_field_(false), |
| 334 received_focus_change_after_pointer_down_(false), | 335 received_focus_change_after_pointer_down_(false), |
| 335 touch_events_enabled_(false), | 336 touch_events_enabled_(false), |
| 337 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 338 gesture_recognizer_(ui::GestureRecognizer::Create(this))), |
| 336 ALLOW_THIS_IN_INITIALIZER_LIST(sys_color_change_listener_(this)) { | 339 ALLOW_THIS_IN_INITIALIZER_LIST(sys_color_change_listener_(this)) { |
| 337 render_widget_host_->SetView(this); | 340 render_widget_host_->SetView(this); |
| 338 registrar_.Add(this, | 341 registrar_.Add(this, |
| 339 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, | 342 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, |
| 340 content::NotificationService::AllBrowserContextsAndSources()); | 343 content::NotificationService::AllBrowserContextsAndSources()); |
| 341 registrar_.Add(this, | 344 registrar_.Add(this, |
| 342 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 345 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 343 content::NotificationService::AllBrowserContextsAndSources()); | 346 content::NotificationService::AllBrowserContextsAndSources()); |
| 344 } | 347 } |
| 345 | 348 |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 } | 997 } |
| 995 | 998 |
| 996 void RenderWidgetHostViewWin::SetHasHorizontalScrollbar( | 999 void RenderWidgetHostViewWin::SetHasHorizontalScrollbar( |
| 997 bool has_horizontal_scrollbar) { | 1000 bool has_horizontal_scrollbar) { |
| 998 } | 1001 } |
| 999 | 1002 |
| 1000 void RenderWidgetHostViewWin::SetScrollOffsetPinning( | 1003 void RenderWidgetHostViewWin::SetScrollOffsetPinning( |
| 1001 bool is_pinned_to_left, bool is_pinned_to_right) { | 1004 bool is_pinned_to_left, bool is_pinned_to_right) { |
| 1002 } | 1005 } |
| 1003 | 1006 |
| 1007 bool RenderWidgetHostViewWin::DispatchLongPressGestureEvent( |
| 1008 ui::GestureEvent* event) { |
| 1009 // TODO: Implement. |
| 1010 return false; |
| 1011 } |
| 1012 |
| 1013 bool RenderWidgetHostViewWin::DispatchCancelTouchEvent( |
| 1014 ui::TouchEvent* event) { |
| 1015 // TODO: Implement. |
| 1016 return false; |
| 1017 } |
| 1018 |
| 1019 ui::TouchEvent* RenderWidgetHostViewWin::CreateTouchEvent( |
| 1020 ui::EventType type, |
| 1021 const gfx::Point& location, |
| 1022 int touch_id, |
| 1023 base::TimeDelta time_stamp) { |
| 1024 return new views::TouchEvent( |
| 1025 type, location.x(), location.y(), 0, touch_id, 0, 0, 0, 0); |
| 1026 } |
| 1027 |
| 1028 ui::GestureEvent* RenderWidgetHostViewWin::CreateGestureEvent( |
| 1029 ui::EventType type, |
| 1030 const gfx::Point& location, |
| 1031 int flags, |
| 1032 const base::Time time, |
| 1033 float param_first, |
| 1034 float param_second, |
| 1035 unsigned int touch_id_bitfield) { |
| 1036 return new views::GestureEvent(type, location.x(), location.y(), flags, time, |
| 1037 param_first, param_second, touch_id_bitfield); |
| 1038 } |
| 1039 |
| 1004 /////////////////////////////////////////////////////////////////////////////// | 1040 /////////////////////////////////////////////////////////////////////////////// |
| 1005 // RenderWidgetHostViewWin, private: | 1041 // RenderWidgetHostViewWin, private: |
| 1006 | 1042 |
| 1007 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { | 1043 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { |
| 1008 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale | 1044 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale |
| 1009 // of a browser process. | 1045 // of a browser process. |
| 1010 OnInputLangChange(0, 0); | 1046 OnInputLangChange(0, 0); |
| 1011 // Marks that window as supporting mouse-wheel messages rerouting so it is | 1047 // Marks that window as supporting mouse-wheel messages rerouting so it is |
| 1012 // scrolled when under the mouse pointer even if inactive. | 1048 // scrolled when under the mouse pointer even if inactive. |
| 1013 props_.push_back(ui::SetWindowSupportsRerouteMouseWheel(m_hWnd)); | 1049 props_.push_back(ui::SetWindowSupportsRerouteMouseWheel(m_hWnd)); |
| (...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2697 void RenderWidgetHostViewWin::ResetPointerDownContext() { | 2733 void RenderWidgetHostViewWin::ResetPointerDownContext() { |
| 2698 // If the default focus on the page is on an edit field and we did not | 2734 // If the default focus on the page is on an edit field and we did not |
| 2699 // receive a focus change in the context of a pointer down message, it means | 2735 // receive a focus change in the context of a pointer down message, it means |
| 2700 // that the pointer down message occurred on the edit field and we should | 2736 // that the pointer down message occurred on the edit field and we should |
| 2701 // display the on screen keyboard | 2737 // display the on screen keyboard |
| 2702 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 2738 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
| 2703 DisplayOnScreenKeyboardIfNeeded(); | 2739 DisplayOnScreenKeyboardIfNeeded(); |
| 2704 received_focus_change_after_pointer_down_ = false; | 2740 received_focus_change_after_pointer_down_ = false; |
| 2705 pointer_down_context_ = false; | 2741 pointer_down_context_ = false; |
| 2706 } | 2742 } |
| OLD | NEW |