Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1018)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10134045: Getting RenderWidgetHostViewWin ready for a GestureRecognizer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed headers, and removed leak. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 #include "content/public/browser/notification_service.h" 39 #include "content/public/browser/notification_service.h"
40 #include "content/public/browser/notification_types.h" 40 #include "content/public/browser/notification_types.h"
41 #include "content/public/common/content_switches.h" 41 #include "content/public/common/content_switches.h"
42 #include "content/public/common/page_zoom.h" 42 #include "content/public/common/page_zoom.h"
43 #include "content/public/common/process_type.h" 43 #include "content/public/common/process_type.h"
44 #include "skia/ext/skia_utils_win.h" 44 #include "skia/ext/skia_utils_win.h"
45 #include "third_party/skia/include/core/SkRegion.h" 45 #include "third_party/skia/include/core/SkRegion.h"
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
48 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact ory.h" 48 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact ory.h"
49 #include "ui/base/gestures/gesture_recognizer.h"
49 #include "ui/base/ime/composition_text.h" 50 #include "ui/base/ime/composition_text.h"
50 #include "ui/base/l10n/l10n_util_win.h" 51 #include "ui/base/l10n/l10n_util_win.h"
51 #include "ui/base/text/text_elider.h" 52 #include "ui/base/text/text_elider.h"
52 #include "ui/base/ui_base_switches.h" 53 #include "ui/base/ui_base_switches.h"
53 #include "ui/base/view_prop.h" 54 #include "ui/base/view_prop.h"
54 #include "ui/base/win/hwnd_util.h" 55 #include "ui/base/win/hwnd_util.h"
55 #include "ui/base/win/mouse_wheel_util.h" 56 #include "ui/base/win/mouse_wheel_util.h"
56 #include "ui/gfx/canvas.h" 57 #include "ui/gfx/canvas.h"
57 #include "ui/gfx/gdi_util.h" 58 #include "ui/gfx/gdi_util.h"
58 #include "ui/gfx/rect.h" 59 #include "ui/gfx/rect.h"
59 #include "ui/gfx/screen.h" 60 #include "ui/gfx/screen.h"
61 #include "ui/views/events/event.h"
60 #include "webkit/glue/webaccessibility.h" 62 #include "webkit/glue/webaccessibility.h"
61 #include "webkit/glue/webcursor.h" 63 #include "webkit/glue/webcursor.h"
62 #include "webkit/plugins/npapi/plugin_constants_win.h" 64 #include "webkit/plugins/npapi/plugin_constants_win.h"
63 #include "webkit/plugins/npapi/webplugin.h" 65 #include "webkit/plugins/npapi/webplugin.h"
64 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 66 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
65 67
66 using base::TimeDelta; 68 using base::TimeDelta;
67 using base::TimeTicks; 69 using base::TimeTicks;
68 using content::BrowserThread; 70 using content::BrowserThread;
69 using content::RenderWidgetHost; 71 using content::RenderWidgetHost;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 is_loading_(false), 328 is_loading_(false),
327 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), 329 text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
328 is_fullscreen_(false), 330 is_fullscreen_(false),
329 ignore_mouse_movement_(true), 331 ignore_mouse_movement_(true),
330 composition_range_(ui::Range::InvalidRange()), 332 composition_range_(ui::Range::InvalidRange()),
331 touch_state_(this), 333 touch_state_(this),
332 pointer_down_context_(false), 334 pointer_down_context_(false),
333 focus_on_editable_field_(false), 335 focus_on_editable_field_(false),
334 received_focus_change_after_pointer_down_(false), 336 received_focus_change_after_pointer_down_(false),
335 touch_events_enabled_(false), 337 touch_events_enabled_(false),
338 ALLOW_THIS_IN_INITIALIZER_LIST(
339 gesture_recognizer_(ui::GestureRecognizer::Create(this))),
336 ALLOW_THIS_IN_INITIALIZER_LIST(sys_color_change_listener_(this)) { 340 ALLOW_THIS_IN_INITIALIZER_LIST(sys_color_change_listener_(this)) {
337 render_widget_host_->SetView(this); 341 render_widget_host_->SetView(this);
338 registrar_.Add(this, 342 registrar_.Add(this,
339 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 343 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
340 content::NotificationService::AllBrowserContextsAndSources()); 344 content::NotificationService::AllBrowserContextsAndSources());
341 registrar_.Add(this, 345 registrar_.Add(this,
342 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, 346 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
343 content::NotificationService::AllBrowserContextsAndSources()); 347 content::NotificationService::AllBrowserContextsAndSources());
344 } 348 }
345 349
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 } 998 }
995 999
996 void RenderWidgetHostViewWin::SetHasHorizontalScrollbar( 1000 void RenderWidgetHostViewWin::SetHasHorizontalScrollbar(
997 bool has_horizontal_scrollbar) { 1001 bool has_horizontal_scrollbar) {
998 } 1002 }
999 1003
1000 void RenderWidgetHostViewWin::SetScrollOffsetPinning( 1004 void RenderWidgetHostViewWin::SetScrollOffsetPinning(
1001 bool is_pinned_to_left, bool is_pinned_to_right) { 1005 bool is_pinned_to_left, bool is_pinned_to_right) {
1002 } 1006 }
1003 1007
1008 bool RenderWidgetHostViewWin::DispatchLongPressGestureEvent(
tfarina 2012/05/04 00:15:32 these new methods here are not in the same order t
girard 2012/05/04 00:58:30 Done.
1009 ui::GestureEvent* event) {
1010 // TODO: Implement.
1011 return false;
1012 }
1013
1014 bool RenderWidgetHostViewWin::DispatchCancelTouchEvent(
1015 ui::TouchEvent* event) {
1016 // TODO: Implement.
1017 return false;
1018 }
1019
1020 ui::TouchEvent* RenderWidgetHostViewWin::CreateTouchEvent(
1021 ui::EventType type,
1022 const gfx::Point& location,
1023 int touch_id,
1024 base::TimeDelta time_stamp) {
1025 return new views::TouchEvent(
1026 type, location.x(), location.y(), 0, touch_id, 0, 0, 0, 0);
1027 }
1028
1029 ui::GestureEvent* RenderWidgetHostViewWin::CreateGestureEvent(
1030 ui::EventType type,
1031 const gfx::Point& location,
1032 int flags,
1033 const base::Time time,
1034 float param_first,
1035 float param_second,
1036 unsigned int touch_id_bitfield) {
1037 return new views::GestureEvent(type, location.x(), location.y(), flags, time,
1038 param_first, param_second, touch_id_bitfield);
tfarina 2012/05/04 00:15:32 fix indentation here, it should be 4 spaces only.
girard 2012/05/04 00:58:30 Done.
1039 }
1040
1004 /////////////////////////////////////////////////////////////////////////////// 1041 ///////////////////////////////////////////////////////////////////////////////
1005 // RenderWidgetHostViewWin, private: 1042 // RenderWidgetHostViewWin, private:
1006 1043
1007 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { 1044 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) {
1008 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale 1045 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale
1009 // of a browser process. 1046 // of a browser process.
1010 OnInputLangChange(0, 0); 1047 OnInputLangChange(0, 0);
1011 // Marks that window as supporting mouse-wheel messages rerouting so it is 1048 // Marks that window as supporting mouse-wheel messages rerouting so it is
1012 // scrolled when under the mouse pointer even if inactive. 1049 // scrolled when under the mouse pointer even if inactive.
1013 props_.push_back(ui::SetWindowSupportsRerouteMouseWheel(m_hWnd)); 1050 props_.push_back(ui::SetWindowSupportsRerouteMouseWheel(m_hWnd));
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 void RenderWidgetHostViewWin::ResetPointerDownContext() { 2734 void RenderWidgetHostViewWin::ResetPointerDownContext() {
2698 // If the default focus on the page is on an edit field and we did not 2735 // 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 2736 // 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 2737 // that the pointer down message occurred on the edit field and we should
2701 // display the on screen keyboard 2738 // display the on screen keyboard
2702 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 2739 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
2703 DisplayOnScreenKeyboardIfNeeded(); 2740 DisplayOnScreenKeyboardIfNeeded();
2704 received_focus_change_after_pointer_down_ = false; 2741 received_focus_change_after_pointer_down_ = false;
2705 pointer_down_context_ = false; 2742 pointer_down_context_ = false;
2706 } 2743 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698