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

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

Issue 2485693003: Drag-and-drop: DragEnter, DragOver, DragLeave, DragDrop (Closed)
Patch Set: No longer using GetSiteInstance() in RenderWidgetHostImpl. 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/drag_event_source_info.h"
26 #include "content/common/edit_command.h" 26 #include "content/common/edit_command.h"
27 #include "content/common/input/synthetic_gesture_params.h" 27 #include "content/common/input/synthetic_gesture_params.h"
28 #include "content/public/common/drop_data.h"
28 #include "content/public/common/screen_info.h" 29 #include "content/public/common/screen_info.h"
29 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega te.h" 30 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega te.h"
30 #include "content/renderer/gpu/render_widget_compositor_delegate.h" 31 #include "content/renderer/gpu/render_widget_compositor_delegate.h"
31 #include "content/renderer/input/render_widget_input_handler.h" 32 #include "content/renderer/input/render_widget_input_handler.h"
32 #include "content/renderer/input/render_widget_input_handler_delegate.h" 33 #include "content/renderer/input/render_widget_input_handler_delegate.h"
33 #include "content/renderer/message_delivery_policy.h" 34 #include "content/renderer/message_delivery_policy.h"
34 #include "content/renderer/mouse_lock_dispatcher.h" 35 #include "content/renderer/mouse_lock_dispatcher.h"
35 #include "content/renderer/render_widget_mouse_lock_dispatcher.h" 36 #include "content/renderer/render_widget_mouse_lock_dispatcher.h"
36 #include "ipc/ipc_listener.h" 37 #include "ipc/ipc_listener.h"
37 #include "ipc/ipc_sender.h" 38 #include "ipc/ipc_sender.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // TODO(ekaramad): The reference to the focused pepper plugin will be removed 398 // TODO(ekaramad): The reference to the focused pepper plugin will be removed
398 // from RenderWidget. The purpose of having the reference here was to make IME 399 // from RenderWidget. The purpose of having the reference here was to make IME
399 // work for OOPIF (https://crbug.com/643727). 400 // work for OOPIF (https://crbug.com/643727).
400 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) { 401 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) {
401 focused_pepper_plugin_ = plugin; 402 focused_pepper_plugin_ = plugin;
402 } 403 }
403 404
404 // When emulated, this returns original device scale factor. 405 // When emulated, this returns original device scale factor.
405 float GetOriginalDeviceScaleFactor() const; 406 float GetOriginalDeviceScaleFactor() const;
406 407
408 // Helper to convert |point| using ConvertWindowToViewport().
409 gfx::Point ConvertWindowPointToViewport(const gfx::Point& point);
410
407 protected: 411 protected:
408 // Friend RefCounted so that the dtor can be non-public. Using this class 412 // Friend RefCounted so that the dtor can be non-public. Using this class
409 // without ref-counting is an error. 413 // without ref-counting is an error.
410 friend class base::RefCounted<RenderWidget>; 414 friend class base::RefCounted<RenderWidget>;
411 415
412 // For unit tests. 416 // For unit tests.
413 friend class RenderWidgetTest; 417 friend class RenderWidgetTest;
414 418
415 using CreateWidgetCallback = base::OnceCallback<bool()>; 419 using CreateWidgetCallback = base::OnceCallback<bool()>;
416 420
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 504
501 void OnRepaint(gfx::Size size_to_paint); 505 void OnRepaint(gfx::Size size_to_paint);
502 void OnSyntheticGestureCompleted(); 506 void OnSyntheticGestureCompleted();
503 void OnSetTextDirection(blink::WebTextDirection direction); 507 void OnSetTextDirection(blink::WebTextDirection direction);
504 void OnGetFPS(); 508 void OnGetFPS();
505 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, 509 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
506 const gfx::Rect& window_screen_rect); 510 const gfx::Rect& window_screen_rect);
507 void OnUpdateWindowScreenRect(const gfx::Rect& window_screen_rect); 511 void OnUpdateWindowScreenRect(const gfx::Rect& window_screen_rect);
508 void OnSetFrameSinkId(const cc::FrameSinkId& frame_sink_id); 512 void OnSetFrameSinkId(const cc::FrameSinkId& frame_sink_id);
509 void OnHandleCompositorProto(const std::vector<uint8_t>& proto); 513 void OnHandleCompositorProto(const std::vector<uint8_t>& proto);
514 // Real data that is dragged is not included at DragEnter time.
515 void OnDragTargetDragEnter(
516 const std::vector<DropData::Metadata>& drop_meta_data,
517 const gfx::Point& client_pt,
518 const gfx::Point& screen_pt,
519 blink::WebDragOperationsMask operations_allowed,
520 int key_modifiers);
521 void OnDragTargetDragOver(const gfx::Point& client_pt,
522 const gfx::Point& screen_pt,
523 blink::WebDragOperationsMask operations_allowed,
524 int key_modifiers);
525 void OnDragTargetDragLeave();
526 void OnDragTargetDrop(const DropData& drop_data,
527 const gfx::Point& client_pt,
528 const gfx::Point& screen_pt,
529 int key_modifiers);
510 530
511 #if defined(OS_ANDROID) 531 #if defined(OS_ANDROID)
512 // Called when we send IME event that expects an ACK. 532 // Called when we send IME event that expects an ACK.
513 void OnImeEventSentForAck(const blink::WebTextInputInfo& info); 533 void OnImeEventSentForAck(const blink::WebTextInputInfo& info);
514 534
515 // Called by the browser process for every required IME acknowledgement. 535 // Called by the browser process for every required IME acknowledgement.
516 void OnImeEventAck(); 536 void OnImeEventAck();
517 537
518 // Called by the browser process to update text input state. 538 // Called by the browser process to update text input state.
519 void OnRequestTextInputStateUpdate(); 539 void OnRequestTextInputStateUpdate();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 // being handled. If the current event results in starting a drag/drop 847 // being handled. If the current event results in starting a drag/drop
828 // session, this info is sent to the browser along with other drag/drop info. 848 // session, this info is sent to the browser along with other drag/drop info.
829 DragEventSourceInfo possible_drag_event_info_; 849 DragEventSourceInfo possible_drag_event_info_;
830 850
831 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 851 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
832 }; 852 };
833 853
834 } // namespace content 854 } // namespace content
835 855
836 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 856 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698