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

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

Issue 2485693003: Drag-and-drop: DragEnter, DragOver, DragLeave, DragDrop (Closed)
Patch Set: Rebased. More fixes. 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
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // TODO(ekaramad): The reference to the focused pepper plugin will be removed 405 // TODO(ekaramad): The reference to the focused pepper plugin will be removed
405 // from RenderWidget. The purpose of having the reference here was to make IME 406 // from RenderWidget. The purpose of having the reference here was to make IME
406 // work for OOPIF (https://crbug.com/643727). 407 // work for OOPIF (https://crbug.com/643727).
407 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) { 408 void set_focused_pepper_plugin(PepperPluginInstanceImpl* plugin) {
408 focused_pepper_plugin_ = plugin; 409 focused_pepper_plugin_ = plugin;
409 } 410 }
410 411
411 // When emulated, this returns original device scale factor. 412 // When emulated, this returns original device scale factor.
412 float GetOriginalDeviceScaleFactor() const; 413 float GetOriginalDeviceScaleFactor() const;
413 414
415 // Helper to convert |point| using ConvertWindowToViewport().
416 gfx::Point ConvertWindowPointToViewport(const gfx::Point& point);
417
414 protected: 418 protected:
415 // Friend RefCounted so that the dtor can be non-public. Using this class 419 // Friend RefCounted so that the dtor can be non-public. Using this class
416 // without ref-counting is an error. 420 // without ref-counting is an error.
417 friend class base::RefCounted<RenderWidget>; 421 friend class base::RefCounted<RenderWidget>;
418 422
419 // For unit tests. 423 // For unit tests.
420 friend class RenderWidgetTest; 424 friend class RenderWidgetTest;
421 425
422 using CreateWidgetCallback = base::OnceCallback<bool()>; 426 using CreateWidgetCallback = base::OnceCallback<bool()>;
423 427
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 virtual void OnDeviceScaleFactorChanged(); 510 virtual void OnDeviceScaleFactorChanged();
507 511
508 void OnRepaint(gfx::Size size_to_paint); 512 void OnRepaint(gfx::Size size_to_paint);
509 void OnSyntheticGestureCompleted(); 513 void OnSyntheticGestureCompleted();
510 void OnSetTextDirection(blink::WebTextDirection direction); 514 void OnSetTextDirection(blink::WebTextDirection direction);
511 void OnGetFPS(); 515 void OnGetFPS();
512 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, 516 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect,
513 const gfx::Rect& window_screen_rect); 517 const gfx::Rect& window_screen_rect);
514 void OnUpdateWindowScreenRect(const gfx::Rect& window_screen_rect); 518 void OnUpdateWindowScreenRect(const gfx::Rect& window_screen_rect);
515 void OnHandleCompositorProto(const std::vector<uint8_t>& proto); 519 void OnHandleCompositorProto(const std::vector<uint8_t>& proto);
520 // Real data that is dragged is not included at DragEnter time.
521 void OnDragTargetDragEnter(
522 const std::vector<DropData::Metadata>& drop_meta_data,
523 const gfx::Point& client_pt,
524 const gfx::Point& screen_pt,
525 blink::WebDragOperationsMask operations_allowed,
526 int key_modifiers);
527 void OnDragTargetDragOver(const gfx::Point& client_pt,
528 const gfx::Point& screen_pt,
529 blink::WebDragOperationsMask operations_allowed,
530 int key_modifiers);
531 void OnDragTargetDragLeave();
532 void OnDragTargetDrop(const DropData& drop_data,
533 const gfx::Point& client_pt,
534 const gfx::Point& screen_pt,
535 int key_modifiers);
516 536
517 #if defined(OS_ANDROID) 537 #if defined(OS_ANDROID)
518 // Called when we send IME event that expects an ACK. 538 // Called when we send IME event that expects an ACK.
519 void OnImeEventSentForAck(const blink::WebTextInputInfo& info); 539 void OnImeEventSentForAck(const blink::WebTextInputInfo& info);
520 540
521 // Called by the browser process for every required IME acknowledgement. 541 // Called by the browser process for every required IME acknowledgement.
522 void OnImeEventAck(); 542 void OnImeEventAck();
523 543
524 // Called by the browser process to update text input state. 544 // Called by the browser process to update text input state.
525 void OnRequestTextInputStateUpdate(); 545 void OnRequestTextInputStateUpdate();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 // being handled. If the current event results in starting a drag/drop 853 // being handled. If the current event results in starting a drag/drop
834 // session, this info is sent to the browser along with other drag/drop info. 854 // session, this info is sent to the browser along with other drag/drop info.
835 DragEventSourceInfo possible_drag_event_info_; 855 DragEventSourceInfo possible_drag_event_info_;
836 856
837 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 857 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
838 }; 858 };
839 859
840 } // namespace content 860 } // namespace content
841 861
842 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 862 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698