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

Side by Side Diff: content/renderer/render_widget.h

Issue 2479663002: Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Check for layerTreeView while setting handlers. Created 3 years, 11 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 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <deque> 11 #include <deque>
12 #include <map> 12 #include <map>
13 #include <memory> 13 #include <memory>
14 #include <queue> 14 #include <queue>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "base/callback.h" 18 #include "base/callback.h"
19 #include "base/compiler_specific.h" 19 #include "base/compiler_specific.h"
20 #include "base/macros.h" 20 #include "base/macros.h"
21 #include "base/memory/ref_counted.h" 21 #include "base/memory/ref_counted.h"
22 #include "base/memory/weak_ptr.h"
22 #include "base/observer_list.h" 23 #include "base/observer_list.h"
23 #include "base/time/time.h" 24 #include "base/time/time.h"
24 #include "build/build_config.h" 25 #include "build/build_config.h"
25 #include "content/common/content_export.h" 26 #include "content/common/content_export.h"
26 #include "content/common/cursors/webcursor.h" 27 #include "content/common/cursors/webcursor.h"
27 #include "content/common/drag_event_source_info.h" 28 #include "content/common/drag_event_source_info.h"
28 #include "content/common/edit_command.h" 29 #include "content/common/edit_command.h"
29 #include "content/common/input/synthetic_gesture_params.h" 30 #include "content/common/input/synthetic_gesture_params.h"
30 #include "content/public/common/drop_data.h" 31 #include "content/public/common/drop_data.h"
31 #include "content/public/common/screen_info.h" 32 #include "content/public/common/screen_info.h"
(...skipping 30 matching lines...) Expand all
62 class GURL; 63 class GURL;
63 64
64 namespace IPC { 65 namespace IPC {
65 class SyncMessageFilter; 66 class SyncMessageFilter;
66 } 67 }
67 68
68 namespace blink { 69 namespace blink {
69 namespace scheduler { 70 namespace scheduler {
70 class RenderWidgetSchedulingState; 71 class RenderWidgetSchedulingState;
71 } 72 }
73 struct WebActiveWheelFlingParameters;
72 struct WebDeviceEmulationParams; 74 struct WebDeviceEmulationParams;
73 class WebDragData; 75 class WebDragData;
74 class WebFrameWidget; 76 class WebFrameWidget;
75 class WebGestureEvent; 77 class WebGestureEvent;
76 class WebImage; 78 class WebImage;
77 class WebInputMethodController; 79 class WebInputMethodController;
78 class WebLocalFrame; 80 class WebLocalFrame;
79 class WebMouseEvent; 81 class WebMouseEvent;
80 class WebNode; 82 class WebNode;
81 struct WebPoint; 83 struct WebPoint;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) { 406 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) {
405 focused_pepper_plugin_ = plugin; 407 focused_pepper_plugin_ = plugin;
406 } 408 }
407 409
408 // When emulated, this returns original device scale factor. 410 // When emulated, this returns original device scale factor.
409 float GetOriginalDeviceScaleFactor() const; 411 float GetOriginalDeviceScaleFactor() const;
410 412
411 // Helper to convert |point| using ConvertWindowToViewport(). 413 // Helper to convert |point| using ConvertWindowToViewport().
412 gfx::Point ConvertWindowPointToViewport(const gfx::Point& point); 414 gfx::Point ConvertWindowPointToViewport(const gfx::Point& point);
413 415
416 virtual void TransferActiveWheelFlingAnimation(
417 const blink::WebActiveWheelFlingParameters& params) {}
418
414 protected: 419 protected:
415 // Friend RefCounted so that the dtor can be non-public. Using this class 420 // Friend RefCounted so that the dtor can be non-public. Using this class
416 // without ref-counting is an error. 421 // without ref-counting is an error.
417 friend class base::RefCounted<RenderWidget>; 422 friend class base::RefCounted<RenderWidget>;
418 423
419 // For unit tests. 424 // For unit tests.
420 friend class RenderWidgetTest; 425 friend class RenderWidgetTest;
421 426
422 enum ResizeAck { 427 enum ResizeAck {
423 SEND_RESIZE_ACK, 428 SEND_RESIZE_ACK,
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 787
783 std::unique_ptr<blink::scheduler::RenderWidgetSchedulingState> 788 std::unique_ptr<blink::scheduler::RenderWidgetSchedulingState>
784 render_widget_scheduling_state_; 789 render_widget_scheduling_state_;
785 790
786 // Mouse Lock dispatcher attached to this view. 791 // Mouse Lock dispatcher attached to this view.
787 std::unique_ptr<RenderWidgetMouseLockDispatcher> mouse_lock_dispatcher_; 792 std::unique_ptr<RenderWidgetMouseLockDispatcher> mouse_lock_dispatcher_;
788 793
789 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. 794 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
790 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; 795 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
791 796
797 bool has_added_input_handler_;
798
792 private: 799 private:
793 // Applies/Removes the DevTools device emulation transformation to/from a 800 // Applies/Removes the DevTools device emulation transformation to/from a
794 // window rect. 801 // window rect.
795 void ScreenRectToEmulatedIfNeeded(blink::WebRect* window_rect) const; 802 void ScreenRectToEmulatedIfNeeded(blink::WebRect* window_rect) const;
796 void EmulatedToScreenRectIfNeeded(blink::WebRect* window_rect) const; 803 void EmulatedToScreenRectIfNeeded(blink::WebRect* window_rect) const;
797 804
798 bool CreateWidget(int32_t opener_id, 805 bool CreateWidget(int32_t opener_id,
799 blink::WebPopupType popup_type, 806 blink::WebPopupType popup_type,
800 int32_t* routing_id); 807 int32_t* routing_id);
801 808
(...skipping 28 matching lines...) Expand all
830 837
831 // Stores edit commands associated to the next key event. 838 // Stores edit commands associated to the next key event.
832 // Will be cleared as soon as the next key event is processed. 839 // Will be cleared as soon as the next key event is processed.
833 EditCommands edit_commands_; 840 EditCommands edit_commands_;
834 841
835 // This field stores drag/drop related info for the event that is currently 842 // This field stores drag/drop related info for the event that is currently
836 // being handled. If the current event results in starting a drag/drop 843 // being handled. If the current event results in starting a drag/drop
837 // session, this info is sent to the browser along with other drag/drop info. 844 // session, this info is sent to the browser along with other drag/drop info.
838 DragEventSourceInfo possible_drag_event_info_; 845 DragEventSourceInfo possible_drag_event_info_;
839 846
847 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
848
840 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 849 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
841 }; 850 };
842 851
843 } // namespace content 852 } // namespace content
844 853
845 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 854 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698