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

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

Issue 2475443003: Drag-and-drop: Move startDrag out of WebView/RenderView. (Closed)
Patch Set: Created 4 years, 1 month 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 15
16 #include "base/callback.h" 16 #include "base/callback.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/memory/ref_counted.h" 19 #include "base/memory/ref_counted.h"
20 #include "base/observer_list.h" 20 #include "base/observer_list.h"
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "build/build_config.h" 22 #include "build/build_config.h"
23 #include "content/common/content_export.h" 23 #include "content/common/content_export.h"
24 #include "content/common/cursors/webcursor.h" 24 #include "content/common/cursors/webcursor.h"
25 #include "content/common/drag_event_source_info.h"
25 #include "content/common/edit_command.h" 26 #include "content/common/edit_command.h"
26 #include "content/common/input/synthetic_gesture_params.h" 27 #include "content/common/input/synthetic_gesture_params.h"
27 #include "content/public/common/screen_info.h" 28 #include "content/public/common/screen_info.h"
28 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega te.h" 29 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega te.h"
29 #include "content/renderer/gpu/render_widget_compositor_delegate.h" 30 #include "content/renderer/gpu/render_widget_compositor_delegate.h"
30 #include "content/renderer/input/render_widget_input_handler.h" 31 #include "content/renderer/input/render_widget_input_handler.h"
31 #include "content/renderer/input/render_widget_input_handler_delegate.h" 32 #include "content/renderer/input/render_widget_input_handler_delegate.h"
32 #include "content/renderer/message_delivery_policy.h" 33 #include "content/renderer/message_delivery_policy.h"
33 #include "content/renderer/mouse_lock_dispatcher.h" 34 #include "content/renderer/mouse_lock_dispatcher.h"
34 #include "content/renderer/render_widget_mouse_lock_dispatcher.h" 35 #include "content/renderer/render_widget_mouse_lock_dispatcher.h"
(...skipping 23 matching lines...) Expand all
58 namespace IPC { 59 namespace IPC {
59 class SyncMessage; 60 class SyncMessage;
60 class SyncMessageFilter; 61 class SyncMessageFilter;
61 } 62 }
62 63
63 namespace blink { 64 namespace blink {
64 namespace scheduler { 65 namespace scheduler {
65 class RenderWidgetSchedulingState; 66 class RenderWidgetSchedulingState;
66 } 67 }
67 struct WebDeviceEmulationParams; 68 struct WebDeviceEmulationParams;
69 class WebDragData;
68 class WebFrameWidget; 70 class WebFrameWidget;
69 class WebGestureEvent; 71 class WebGestureEvent;
72 class WebImage;
70 class WebLocalFrame; 73 class WebLocalFrame;
71 class WebMouseEvent; 74 class WebMouseEvent;
72 class WebNode; 75 class WebNode;
73 struct WebPoint; 76 struct WebPoint;
74 } 77 }
75 78
76 namespace cc { 79 namespace cc {
77 class CompositorFrameSink; 80 class CompositorFrameSink;
78 class FrameSinkId; 81 class FrameSinkId;
79 class SwapPromise; 82 class SwapPromise;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 void didOverscroll(const blink::WebFloatSize& overscrollDelta, 283 void didOverscroll(const blink::WebFloatSize& overscrollDelta,
281 const blink::WebFloatSize& accumulatedOverscroll, 284 const blink::WebFloatSize& accumulatedOverscroll,
282 const blink::WebFloatPoint& position, 285 const blink::WebFloatPoint& position,
283 const blink::WebFloatSize& velocity) override; 286 const blink::WebFloatSize& velocity) override;
284 void showImeIfNeeded() override; 287 void showImeIfNeeded() override;
285 void convertViewportToWindow(blink::WebRect* rect) override; 288 void convertViewportToWindow(blink::WebRect* rect) override;
286 void convertWindowToViewport(blink::WebFloatRect* rect) override; 289 void convertWindowToViewport(blink::WebFloatRect* rect) override;
287 bool requestPointerLock() override; 290 bool requestPointerLock() override;
288 void requestPointerUnlock() override; 291 void requestPointerUnlock() override;
289 bool isPointerLocked() override; 292 bool isPointerLocked() override;
293 void startDragging(blink::WebLocalFrame* frame,
294 const blink::WebDragData& data,
295 blink::WebDragOperationsMask mask,
296 const blink::WebImage& image,
297 const blink::WebPoint& imageOffset) override;
290 298
291 // Override point to obtain that the current input method state and caret 299 // Override point to obtain that the current input method state and caret
292 // position. 300 // position.
293 virtual ui::TextInputType GetTextInputType(); 301 virtual ui::TextInputType GetTextInputType();
294 302
295 #if defined(OS_ANDROID) 303 #if defined(OS_ANDROID)
296 // Notifies that a tap was not consumed, so showing a UI for the unhandled 304 // Notifies that a tap was not consumed, so showing a UI for the unhandled
297 // tap may be needed. 305 // tap may be needed.
298 // Performs various checks on the given WebNode to apply heuristics to 306 // Performs various checks on the given WebNode to apply heuristics to
299 // determine if triggering is appropriate. 307 // determine if triggering is appropriate.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 return mouse_lock_dispatcher_.get(); 393 return mouse_lock_dispatcher_.get();
386 } 394 }
387 395
388 // TODO(ekaramad): The reference to the focused pepper plugin will be removed 396 // TODO(ekaramad): The reference to the focused pepper plugin will be removed
389 // from RenderWidget. The purpose of having the reference here was to make IME 397 // from RenderWidget. The purpose of having the reference here was to make IME
390 // work for OOPIF (https://crbug.com/643727). 398 // work for OOPIF (https://crbug.com/643727).
391 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) { 399 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) {
392 focused_pepper_plugin_ = plugin; 400 focused_pepper_plugin_ = plugin;
393 } 401 }
394 402
403 void set_possible_drag_event_info(ui::DragDropTypes::DragEventSource source,
404 gfx::Point location) {
405 possible_drag_event_info_.event_source = source;
406 possible_drag_event_info_.event_location = location;
407 }
408
395 // When emulated, this returns original device scale factor. 409 // When emulated, this returns original device scale factor.
396 float GetOriginalDeviceScaleFactor() const; 410 float GetOriginalDeviceScaleFactor() const;
397 411
398 protected: 412 protected:
399 // Friend RefCounted so that the dtor can be non-public. Using this class 413 // Friend RefCounted so that the dtor can be non-public. Using this class
400 // without ref-counting is an error. 414 // without ref-counting is an error.
401 friend class base::RefCounted<RenderWidget>; 415 friend class base::RefCounted<RenderWidget>;
402 416
403 // For unit tests. 417 // For unit tests.
404 friend class RenderWidgetTest; 418 friend class RenderWidgetTest;
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 #endif 828 #endif
815 829
816 // This reference is set by the RenderFrame and is used to query the IME- 830 // This reference is set by the RenderFrame and is used to query the IME-
817 // related state from the plugin to later send to the browser. 831 // related state from the plugin to later send to the browser.
818 PepperPluginInstanceImpl* focused_pepper_plugin_; 832 PepperPluginInstanceImpl* focused_pepper_plugin_;
819 833
820 // Stores edit commands associated to the next key event. 834 // Stores edit commands associated to the next key event.
821 // Will be cleared as soon as the next key event is processed. 835 // Will be cleared as soon as the next key event is processed.
822 EditCommands edit_commands_; 836 EditCommands edit_commands_;
823 837
838 // This field stores drag/drop related info for the event that is currently
839 // being handled. If the current event results in starting a drag/drop
840 // session, this info is sent to the browser along with other drag/drop info.
841 DragEventSourceInfo possible_drag_event_info_;
842
824 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 843 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
825 }; 844 };
826 845
827 } // namespace content 846 } // namespace content
828 847
829 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 848 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698