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

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

Issue 2475443003: Drag-and-drop: Move startDrag out of WebView/RenderView. (Closed)
Patch Set: Addressed comments by dcheng@. 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/public/browser/render_widget_host.h ('k') | content/renderer/render_view_impl.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_VIEW_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_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 <set> 14 #include <set>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/id_map.h" 19 #include "base/id_map.h"
20 #include "base/macros.h" 20 #include "base/macros.h"
21 #include "base/memory/weak_ptr.h" 21 #include "base/memory/weak_ptr.h"
22 #include "base/observer_list.h" 22 #include "base/observer_list.h"
23 #include "base/process/process.h" 23 #include "base/process/process.h"
24 #include "base/strings/string16.h" 24 #include "base/strings/string16.h"
25 #include "base/timer/timer.h" 25 #include "base/timer/timer.h"
26 #include "build/build_config.h" 26 #include "build/build_config.h"
27 #include "cc/input/browser_controls_state.h" 27 #include "cc/input/browser_controls_state.h"
28 #include "cc/resources/shared_bitmap.h" 28 #include "cc/resources/shared_bitmap.h"
29 #include "content/common/content_export.h" 29 #include "content/common/content_export.h"
30 #include "content/common/drag_event_source_info.h"
31 #include "content/common/frame_message_enums.h" 30 #include "content/common/frame_message_enums.h"
32 #include "content/common/navigation_gesture.h" 31 #include "content/common/navigation_gesture.h"
33 #include "content/common/page_message_enums.h" 32 #include "content/common/page_message_enums.h"
34 #include "content/common/view_message_enums.h" 33 #include "content/common/view_message_enums.h"
35 #include "content/public/common/browser_controls_state.h" 34 #include "content/public/common/browser_controls_state.h"
36 #include "content/public/common/drop_data.h" 35 #include "content/public/common/drop_data.h"
37 #include "content/public/common/page_zoom.h" 36 #include "content/public/common/page_zoom.h"
38 #include "content/public/common/referrer.h" 37 #include "content/public/common/referrer.h"
39 #include "content/public/common/renderer_preferences.h" 38 #include "content/public/common/renderer_preferences.h"
40 #include "content/public/common/web_preferences.h" 39 #include "content/public/common/web_preferences.h"
(...skipping 29 matching lines...) Expand all
70 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the 69 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the
71 // root. VS warns when we inherit the WebWidgetClient method implementations 70 // root. VS warns when we inherit the WebWidgetClient method implementations
72 // from RenderWidget. It's safe to ignore that warning. 71 // from RenderWidget. It's safe to ignore that warning.
73 #pragma warning(disable: 4250) 72 #pragma warning(disable: 4250)
74 #endif 73 #endif
75 74
76 namespace blink { 75 namespace blink {
77 class WebApplicationCacheHost; 76 class WebApplicationCacheHost;
78 class WebDataSource; 77 class WebDataSource;
79 class WebDateTimeChooserCompletion; 78 class WebDateTimeChooserCompletion;
80 class WebDragData;
81 class WebGestureEvent; 79 class WebGestureEvent;
82 class WebIconURL; 80 class WebIconURL;
83 class WebImage; 81 class WebImage;
82 class WebPeerConnection00Handler;
83 class WebPeerConnection00HandlerClient;
nasko 2016/11/07 23:44:27 Are those part of the removed header?
paulmeyer 2016/11/08 17:07:29 Actually, I don't know where those came from. Remo
84 class WebMouseEvent; 84 class WebMouseEvent;
85 class WebSpeechRecognizer; 85 class WebSpeechRecognizer;
86 class WebStorageNamespace; 86 class WebStorageNamespace;
87 class WebURLRequest; 87 class WebURLRequest;
88 struct WebActiveWheelFlingParameters; 88 struct WebActiveWheelFlingParameters;
89 struct WebDateTimeChooserParams; 89 struct WebDateTimeChooserParams;
90 struct WebMediaPlayerAction; 90 struct WebMediaPlayerAction;
91 struct WebPluginAction; 91 struct WebPluginAction;
92 struct WebPoint; 92 struct WebPoint;
93 struct WebWindowFeatures; 93 struct WebWindowFeatures;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 const blink::WebString& main_text, 306 const blink::WebString& main_text,
307 blink::WebTextDirection main_text_hint, 307 blink::WebTextDirection main_text_hint,
308 const blink::WebString& sub_text, 308 const blink::WebString& sub_text,
309 blink::WebTextDirection hint) override; 309 blink::WebTextDirection hint) override;
310 void hideValidationMessage() override; 310 void hideValidationMessage() override;
311 void moveValidationMessage( 311 void moveValidationMessage(
312 const blink::WebRect& anchor_in_viewport) override; 312 const blink::WebRect& anchor_in_viewport) override;
313 void setStatusText(const blink::WebString& text) override; 313 void setStatusText(const blink::WebString& text) override;
314 void setMouseOverURL(const blink::WebURL& url) override; 314 void setMouseOverURL(const blink::WebURL& url) override;
315 void setKeyboardFocusURL(const blink::WebURL& url) override; 315 void setKeyboardFocusURL(const blink::WebURL& url) override;
316 void startDragging(blink::WebLocalFrame* frame,
317 const blink::WebDragData& data,
318 blink::WebDragOperationsMask mask,
319 const blink::WebImage& image,
320 const blink::WebPoint& imageOffset) override;
321 bool acceptsLoadDrops() override; 316 bool acceptsLoadDrops() override;
322 void focusNext() override; 317 void focusNext() override;
323 void focusPrevious() override; 318 void focusPrevious() override;
324 void focusedNodeChanged(const blink::WebNode& fromNode, 319 void focusedNodeChanged(const blink::WebNode& fromNode,
325 const blink::WebNode& toNode) override; 320 const blink::WebNode& toNode) override;
326 void didUpdateLayout() override; 321 void didUpdateLayout() override;
327 #if defined(OS_ANDROID) 322 #if defined(OS_ANDROID)
328 bool didTapMultipleTargets( 323 bool didTapMultipleTargets(
329 const blink::WebSize& inner_viewport_offset, 324 const blink::WebSize& inner_viewport_offset,
330 const blink::WebRect& touch_rect, 325 const blink::WebRect& touch_rect,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 // Do not delete directly. This class is reference counted. 417 // Do not delete directly. This class is reference counted.
423 ~RenderViewImpl() override; 418 ~RenderViewImpl() override;
424 419
425 private: 420 private:
426 // For unit tests. 421 // For unit tests.
427 friend class DevToolsAgentTest; 422 friend class DevToolsAgentTest;
428 friend class RenderViewImplScaleFactorTest; 423 friend class RenderViewImplScaleFactorTest;
429 friend class RenderViewImplTest; 424 friend class RenderViewImplTest;
430 friend class RenderViewTest; 425 friend class RenderViewTest;
431 friend class RendererAccessibilityTest; 426 friend class RendererAccessibilityTest;
427 friend class RenderWidget;
432 428
433 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate 429 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate
434 // utility functions needed in both classes, while we move frame specific 430 // utility functions needed in both classes, while we move frame specific
435 // code away from this class. 431 // code away from this class.
436 friend class RenderFrameImpl; 432 friend class RenderFrameImpl;
437 433
438 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, RenderFrameMessageAfterDetach); 434 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, RenderFrameMessageAfterDetach);
439 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); 435 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI);
440 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, 436 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
441 DidFailProvisionalLoadWithErrorForError); 437 DidFailProvisionalLoadWithErrorForError);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 CONNECTION_ERROR, 486 CONNECTION_ERROR,
491 }; 487 };
492 488
493 // RenderWidgetOwnerDelegate implementation ---------------------------------- 489 // RenderWidgetOwnerDelegate implementation ----------------------------------
494 490
495 void RenderWidgetDidSetColorProfile( 491 void RenderWidgetDidSetColorProfile(
496 const std::vector<char>& color_profile) override; 492 const std::vector<char>& color_profile) override;
497 void RenderWidgetFocusChangeComplete() override; 493 void RenderWidgetFocusChangeComplete() override;
498 bool DoesRenderWidgetHaveTouchEventHandlersAt( 494 bool DoesRenderWidgetHaveTouchEventHandlersAt(
499 const gfx::Point& point) const override; 495 const gfx::Point& point) const override;
500 bool RenderWidgetWillHandleGestureEvent(
501 const blink::WebGestureEvent& event) override;
502 bool RenderWidgetWillHandleMouseEvent( 496 bool RenderWidgetWillHandleMouseEvent(
503 const blink::WebMouseEvent& event) override; 497 const blink::WebMouseEvent& event) override;
504 498
505 // Old WebFrameClient implementations ---------------------------------------- 499 // Old WebFrameClient implementations ----------------------------------------
506 500
507 // RenderViewImpl used to be a WebFrameClient, but now RenderFrameImpl is the 501 // RenderViewImpl used to be a WebFrameClient, but now RenderFrameImpl is the
508 // WebFrameClient. However, many implementations of WebFrameClient methods 502 // WebFrameClient. However, many implementations of WebFrameClient methods
509 // still live here and are called from RenderFrameImpl. These implementations 503 // still live here and are called from RenderFrameImpl. These implementations
510 // are to be moved to RenderFrameImpl <http://crbug.com/361761>. 504 // are to be moved to RenderFrameImpl <http://crbug.com/361761>.
511 505
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 840
847 // The SessionStorage namespace that we're assigned to has an ID, and that ID 841 // The SessionStorage namespace that we're assigned to has an ID, and that ID
848 // is passed to us upon creation. WebKit asks for this ID upon first use and 842 // is passed to us upon creation. WebKit asks for this ID upon first use and
849 // uses it whenever asking the browser process to allocate new storage areas. 843 // uses it whenever asking the browser process to allocate new storage areas.
850 int64_t session_storage_namespace_id_; 844 int64_t session_storage_namespace_id_;
851 845
852 // All the registered observers. We expect this list to be small, so vector 846 // All the registered observers. We expect this list to be small, so vector
853 // is fine. 847 // is fine.
854 base::ObserverList<RenderViewObserver> observers_; 848 base::ObserverList<RenderViewObserver> observers_;
855 849
856 // This field stores drag/drop related info for the event that is currently
857 // being handled. If the current event results in starting a drag/drop
858 // session, this info is sent to the browser along with other drag/drop info.
859 DragEventSourceInfo possible_drag_event_info_;
860
861 // NOTE: stats_collection_observer_ should be the last members because their 850 // NOTE: stats_collection_observer_ should be the last members because their
862 // constructors call the AddObservers method of RenderViewImpl. 851 // constructors call the AddObservers method of RenderViewImpl.
863 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; 852 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_;
864 853
865 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; 854 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap;
866 BitmapMap disambiguation_bitmaps_; 855 BitmapMap disambiguation_bitmaps_;
867 856
868 bool has_added_input_handler_; 857 bool has_added_input_handler_;
869 858
870 // --------------------------------------------------------------------------- 859 // ---------------------------------------------------------------------------
871 // ADDING NEW DATA? Please see if it fits appropriately in one of the above 860 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
872 // sections rather than throwing it randomly at the end. If you're adding a 861 // sections rather than throwing it randomly at the end. If you're adding a
873 // bunch of stuff, you should probably create a helper class and put your 862 // bunch of stuff, you should probably create a helper class and put your
874 // data and methods on that to avoid bloating RenderView more. You can 863 // data and methods on that to avoid bloating RenderView more. You can
875 // use the Observer interface to filter IPC messages and receive frame change 864 // use the Observer interface to filter IPC messages and receive frame change
876 // notifications. 865 // notifications.
877 // --------------------------------------------------------------------------- 866 // ---------------------------------------------------------------------------
878 867
879 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 868 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
880 }; 869 };
881 870
882 } // namespace content 871 } // namespace content
883 872
884 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 873 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW
« no previous file with comments | « content/public/browser/render_widget_host.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698