| OLD | NEW |
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 namespace base { | 79 namespace base { |
| 81 class CommandLine; | 80 class CommandLine; |
| 82 } | 81 } |
| 83 | 82 |
| 84 namespace blink { | 83 namespace blink { |
| 85 class WebApplicationCacheHost; | 84 class WebApplicationCacheHost; |
| 86 class WebApplicationCacheHostClient; | 85 class WebApplicationCacheHostClient; |
| 87 class WebDOMMessageEvent; | 86 class WebDOMMessageEvent; |
| 88 class WebDataSource; | 87 class WebDataSource; |
| 89 class WebDateTimeChooserCompletion; | 88 class WebDateTimeChooserCompletion; |
| 90 class WebDragData; | |
| 91 class WebGestureEvent; | 89 class WebGestureEvent; |
| 92 class WebIconURL; | 90 class WebIconURL; |
| 93 class WebImage; | |
| 94 class WebPeerConnection00Handler; | 91 class WebPeerConnection00Handler; |
| 95 class WebPeerConnection00HandlerClient; | 92 class WebPeerConnection00HandlerClient; |
| 96 class WebMouseEvent; | 93 class WebMouseEvent; |
| 97 class WebPeerConnectionHandler; | 94 class WebPeerConnectionHandler; |
| 98 class WebPeerConnectionHandlerClient; | 95 class WebPeerConnectionHandlerClient; |
| 99 class WebSpeechRecognizer; | 96 class WebSpeechRecognizer; |
| 100 class WebStorageNamespace; | 97 class WebStorageNamespace; |
| 101 class WebTouchEvent; | 98 class WebTouchEvent; |
| 102 class WebURLRequest; | 99 class WebURLRequest; |
| 103 struct WebActiveWheelFlingParameters; | 100 struct WebActiveWheelFlingParameters; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 const blink::WebString& main_text, | 329 const blink::WebString& main_text, |
| 333 blink::WebTextDirection main_text_hint, | 330 blink::WebTextDirection main_text_hint, |
| 334 const blink::WebString& sub_text, | 331 const blink::WebString& sub_text, |
| 335 blink::WebTextDirection hint) override; | 332 blink::WebTextDirection hint) override; |
| 336 void hideValidationMessage() override; | 333 void hideValidationMessage() override; |
| 337 void moveValidationMessage( | 334 void moveValidationMessage( |
| 338 const blink::WebRect& anchor_in_viewport) override; | 335 const blink::WebRect& anchor_in_viewport) override; |
| 339 void setStatusText(const blink::WebString& text) override; | 336 void setStatusText(const blink::WebString& text) override; |
| 340 void setMouseOverURL(const blink::WebURL& url) override; | 337 void setMouseOverURL(const blink::WebURL& url) override; |
| 341 void setKeyboardFocusURL(const blink::WebURL& url) override; | 338 void setKeyboardFocusURL(const blink::WebURL& url) override; |
| 342 void startDragging(blink::WebLocalFrame* frame, | |
| 343 const blink::WebDragData& data, | |
| 344 blink::WebDragOperationsMask mask, | |
| 345 const blink::WebImage& image, | |
| 346 const blink::WebPoint& imageOffset) override; | |
| 347 bool acceptsLoadDrops() override; | 339 bool acceptsLoadDrops() override; |
| 348 void focusNext() override; | 340 void focusNext() override; |
| 349 void focusPrevious() override; | 341 void focusPrevious() override; |
| 350 void focusedNodeChanged(const blink::WebNode& fromNode, | 342 void focusedNodeChanged(const blink::WebNode& fromNode, |
| 351 const blink::WebNode& toNode) override; | 343 const blink::WebNode& toNode) override; |
| 352 void didUpdateLayout() override; | 344 void didUpdateLayout() override; |
| 353 #if defined(OS_ANDROID) | 345 #if defined(OS_ANDROID) |
| 354 bool didTapMultipleTargets( | 346 bool didTapMultipleTargets( |
| 355 const blink::WebSize& inner_viewport_offset, | 347 const blink::WebSize& inner_viewport_offset, |
| 356 const blink::WebRect& touch_rect, | 348 const blink::WebRect& touch_rect, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // Do not delete directly. This class is reference counted. | 440 // Do not delete directly. This class is reference counted. |
| 449 ~RenderViewImpl() override; | 441 ~RenderViewImpl() override; |
| 450 | 442 |
| 451 private: | 443 private: |
| 452 // For unit tests. | 444 // For unit tests. |
| 453 friend class DevToolsAgentTest; | 445 friend class DevToolsAgentTest; |
| 454 friend class RenderViewImplScaleFactorTest; | 446 friend class RenderViewImplScaleFactorTest; |
| 455 friend class RenderViewImplTest; | 447 friend class RenderViewImplTest; |
| 456 friend class RenderViewTest; | 448 friend class RenderViewTest; |
| 457 friend class RendererAccessibilityTest; | 449 friend class RendererAccessibilityTest; |
| 450 friend class RenderWidget; |
| 458 | 451 |
| 459 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate | 452 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate |
| 460 // utility functions needed in both classes, while we move frame specific | 453 // utility functions needed in both classes, while we move frame specific |
| 461 // code away from this class. | 454 // code away from this class. |
| 462 friend class RenderFrameImpl; | 455 friend class RenderFrameImpl; |
| 463 | 456 |
| 464 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, RenderFrameMessageAfterDetach); | 457 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, RenderFrameMessageAfterDetach); |
| 465 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); | 458 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); |
| 466 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 459 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 467 DidFailProvisionalLoadWithErrorForError); | 460 DidFailProvisionalLoadWithErrorForError); |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 | 865 |
| 873 // The SessionStorage namespace that we're assigned to has an ID, and that ID | 866 // The SessionStorage namespace that we're assigned to has an ID, and that ID |
| 874 // is passed to us upon creation. WebKit asks for this ID upon first use and | 867 // is passed to us upon creation. WebKit asks for this ID upon first use and |
| 875 // uses it whenever asking the browser process to allocate new storage areas. | 868 // uses it whenever asking the browser process to allocate new storage areas. |
| 876 int64_t session_storage_namespace_id_; | 869 int64_t session_storage_namespace_id_; |
| 877 | 870 |
| 878 // All the registered observers. We expect this list to be small, so vector | 871 // All the registered observers. We expect this list to be small, so vector |
| 879 // is fine. | 872 // is fine. |
| 880 base::ObserverList<RenderViewObserver> observers_; | 873 base::ObserverList<RenderViewObserver> observers_; |
| 881 | 874 |
| 882 // This field stores drag/drop related info for the event that is currently | |
| 883 // being handled. If the current event results in starting a drag/drop | |
| 884 // session, this info is sent to the browser along with other drag/drop info. | |
| 885 DragEventSourceInfo possible_drag_event_info_; | |
| 886 | |
| 887 // NOTE: stats_collection_observer_ should be the last members because their | 875 // NOTE: stats_collection_observer_ should be the last members because their |
| 888 // constructors call the AddObservers method of RenderViewImpl. | 876 // constructors call the AddObservers method of RenderViewImpl. |
| 889 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; | 877 std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; |
| 890 | 878 |
| 891 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; | 879 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap; |
| 892 BitmapMap disambiguation_bitmaps_; | 880 BitmapMap disambiguation_bitmaps_; |
| 893 | 881 |
| 894 bool has_added_input_handler_; | 882 bool has_added_input_handler_; |
| 895 | 883 |
| 896 // --------------------------------------------------------------------------- | 884 // --------------------------------------------------------------------------- |
| 897 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 885 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
| 898 // sections rather than throwing it randomly at the end. If you're adding a | 886 // sections rather than throwing it randomly at the end. If you're adding a |
| 899 // bunch of stuff, you should probably create a helper class and put your | 887 // bunch of stuff, you should probably create a helper class and put your |
| 900 // data and methods on that to avoid bloating RenderView more. You can | 888 // data and methods on that to avoid bloating RenderView more. You can |
| 901 // use the Observer interface to filter IPC messages and receive frame change | 889 // use the Observer interface to filter IPC messages and receive frame change |
| 902 // notifications. | 890 // notifications. |
| 903 // --------------------------------------------------------------------------- | 891 // --------------------------------------------------------------------------- |
| 904 | 892 |
| 905 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 893 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 906 }; | 894 }; |
| 907 | 895 |
| 908 } // namespace content | 896 } // namespace content |
| 909 | 897 |
| 910 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 898 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |