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 <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 #if defined(OS_ANDROID) | 114 #if defined(OS_ANDROID) |
115 class WebHitTestResult; | 115 class WebHitTestResult; |
116 #endif | 116 #endif |
117 } // namespace blink | 117 } // namespace blink |
118 | 118 |
119 namespace ui { | 119 namespace ui { |
120 struct SelectedFileInfo; | 120 struct SelectedFileInfo; |
121 } | 121 } |
122 | 122 |
123 namespace content { | 123 namespace content { |
| 124 |
124 class BrowserPluginManager; | 125 class BrowserPluginManager; |
125 class DevToolsAgent; | 126 class DevToolsAgent; |
126 class DocumentState; | 127 class DocumentState; |
127 class ExternalPopupMenu; | |
128 class FaviconHelper; | 128 class FaviconHelper; |
129 class HistoryController; | 129 class HistoryController; |
130 class HistoryEntry; | 130 class HistoryEntry; |
131 class ImageResourceFetcher; | 131 class ImageResourceFetcher; |
132 class MouseLockDispatcher; | 132 class MouseLockDispatcher; |
133 class NavigationState; | 133 class NavigationState; |
134 class PepperPluginInstanceImpl; | 134 class PepperPluginInstanceImpl; |
135 class RenderViewImplTest; | 135 class RenderViewImplTest; |
136 class RenderViewObserver; | 136 class RenderViewObserver; |
137 class RenderViewTest; | 137 class RenderViewTest; |
138 class RendererDateTimePicker; | 138 class RendererDateTimePicker; |
139 class RendererWebColorChooserImpl; | 139 class RendererWebColorChooserImpl; |
140 class SpeechRecognitionDispatcher; | 140 class SpeechRecognitionDispatcher; |
141 class WebPluginDelegateProxy; | 141 class WebPluginDelegateProxy; |
142 struct DropData; | 142 struct DropData; |
143 struct FaviconURL; | 143 struct FaviconURL; |
144 struct FileChooserParams; | 144 struct FileChooserParams; |
145 struct RenderViewImplParams; | 145 struct RenderViewImplParams; |
146 | 146 |
147 #if defined(OS_ANDROID) | 147 #if defined(OS_ANDROID) |
148 class WebMediaPlayerProxyAndroid; | 148 class WebMediaPlayerProxyAndroid; |
149 #endif | 149 #endif |
150 | 150 |
151 // | 151 // |
152 // RenderView is an object that manages a WebView object, and provides a | 152 // RenderView is an object that manages a WebView object, and provides a |
153 // communication interface with an embedding application process | 153 // communication interface with an embedding application process. |
154 // | 154 // |
155 class CONTENT_EXPORT RenderViewImpl | 155 class CONTENT_EXPORT RenderViewImpl |
156 : public RenderWidget, | 156 : public RenderWidget, |
157 NON_EXPORTED_BASE(public blink::WebViewClient), | 157 NON_EXPORTED_BASE(public blink::WebViewClient), |
158 NON_EXPORTED_BASE(public blink::WebPageSerializerClient), | 158 NON_EXPORTED_BASE(public blink::WebPageSerializerClient), |
159 public RenderView, | 159 public RenderView, |
160 public base::SupportsWeakPtr<RenderViewImpl> { | 160 public base::SupportsWeakPtr<RenderViewImpl> { |
161 public: | 161 public: |
162 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView | 162 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView |
163 // responsible for creating this RenderView. Note that if the original opener | 163 // responsible for creating this RenderView. Note that if the original opener |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // no other waiting items in the queue. | 240 // no other waiting items in the queue. |
241 // | 241 // |
242 // Returns true if the chooser was successfully scheduled. False means we | 242 // Returns true if the chooser was successfully scheduled. False means we |
243 // didn't schedule anything. | 243 // didn't schedule anything. |
244 bool ScheduleFileChooser(const FileChooserParams& params, | 244 bool ScheduleFileChooser(const FileChooserParams& params, |
245 blink::WebFileChooserCompletion* completion); | 245 blink::WebFileChooserCompletion* completion); |
246 | 246 |
247 #if defined(OS_ANDROID) | 247 #if defined(OS_ANDROID) |
248 void DismissDateTimeDialog(); | 248 void DismissDateTimeDialog(); |
249 #endif | 249 #endif |
250 #if defined(OS_MACOSX) || defined(OS_ANDROID) | |
251 void DidHideExternalPopupMenu(); | |
252 #endif | |
253 | 250 |
254 bool is_loading() const { return frames_in_progress_ != 0; } | 251 bool is_loading() const { return frames_in_progress_ != 0; } |
255 | 252 |
256 void FrameDidStartLoading(blink::WebFrame* frame); | 253 void FrameDidStartLoading(blink::WebFrame* frame); |
257 void FrameDidStopLoading(blink::WebFrame* frame); | 254 void FrameDidStopLoading(blink::WebFrame* frame); |
258 | 255 |
259 // Plugin-related functions -------------------------------------------------- | 256 // Plugin-related functions -------------------------------------------------- |
260 | 257 |
261 #if defined(ENABLE_PLUGINS) | 258 #if defined(ENABLE_PLUGINS) |
262 // Get/set the plugin which will be used as to handle document find requests. | 259 // Get/set the plugin which will be used as to handle document find requests. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 366 |
370 // blink::WebViewClient implementation -------------------------------------- | 367 // blink::WebViewClient implementation -------------------------------------- |
371 | 368 |
372 virtual blink::WebView* createView(blink::WebLocalFrame* creator, | 369 virtual blink::WebView* createView(blink::WebLocalFrame* creator, |
373 const blink::WebURLRequest& request, | 370 const blink::WebURLRequest& request, |
374 const blink::WebWindowFeatures& features, | 371 const blink::WebWindowFeatures& features, |
375 const blink::WebString& frame_name, | 372 const blink::WebString& frame_name, |
376 blink::WebNavigationPolicy policy, | 373 blink::WebNavigationPolicy policy, |
377 bool suppress_opener); | 374 bool suppress_opener); |
378 virtual blink::WebWidget* createPopupMenu(blink::WebPopupType popup_type); | 375 virtual blink::WebWidget* createPopupMenu(blink::WebPopupType popup_type); |
379 virtual blink::WebExternalPopupMenu* createExternalPopupMenu( | |
380 const blink::WebPopupMenuInfo& popup_menu_info, | |
381 blink::WebExternalPopupMenuClient* popup_menu_client); | |
382 virtual blink::WebStorageNamespace* createSessionStorageNamespace(); | 376 virtual blink::WebStorageNamespace* createSessionStorageNamespace(); |
383 virtual void printPage(blink::WebLocalFrame* frame); | 377 virtual void printPage(blink::WebLocalFrame* frame); |
384 virtual bool enumerateChosenDirectory( | 378 virtual bool enumerateChosenDirectory( |
385 const blink::WebString& path, | 379 const blink::WebString& path, |
386 blink::WebFileChooserCompletion* chooser_completion); | 380 blink::WebFileChooserCompletion* chooser_completion); |
387 virtual void didCancelCompositionOnSelectionChange(); | 381 virtual void didCancelCompositionOnSelectionChange(); |
388 virtual bool handleCurrentKeyboardEvent(); | 382 virtual bool handleCurrentKeyboardEvent(); |
389 virtual bool runFileChooser( | 383 virtual bool runFileChooser( |
390 const blink::WebFileChooserParams& params, | 384 const blink::WebFileChooserParams& params, |
391 blink::WebFileChooserCompletion* chooser_completion); | 385 blink::WebFileChooserCompletion* chooser_completion); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 virtual void SetScreenMetricsEmulationParameters( | 552 virtual void SetScreenMetricsEmulationParameters( |
559 float device_scale_factor, | 553 float device_scale_factor, |
560 const gfx::Point& root_layer_offset, | 554 const gfx::Point& root_layer_offset, |
561 float root_layer_scale) OVERRIDE; | 555 float root_layer_scale) OVERRIDE; |
562 | 556 |
563 // Do not delete directly. This class is reference counted. | 557 // Do not delete directly. This class is reference counted. |
564 virtual ~RenderViewImpl(); | 558 virtual ~RenderViewImpl(); |
565 | 559 |
566 private: | 560 private: |
567 // For unit tests. | 561 // For unit tests. |
568 friend class ExternalPopupMenuTest; | |
569 friend class PepperDeviceTest; | 562 friend class PepperDeviceTest; |
570 friend class RenderViewImplTest; | 563 friend class RenderViewImplTest; |
571 friend class RenderViewTest; | 564 friend class RenderViewTest; |
572 friend class RendererAccessibilityTest; | 565 friend class RendererAccessibilityTest; |
573 | 566 |
574 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate | 567 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate |
575 // utility functions needed in both classes, while we move frame specific | 568 // utility functions needed in both classes, while we move frame specific |
576 // code away from this class. | 569 // code away from this class. |
577 friend class RenderFrameImpl; | 570 friend class RenderFrameImpl; |
578 | 571 |
579 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); | |
580 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); | |
581 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); | |
582 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); | |
583 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); | 572 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); |
584 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 573 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
585 DidFailProvisionalLoadWithErrorForError); | 574 DidFailProvisionalLoadWithErrorForError); |
586 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 575 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
587 DidFailProvisionalLoadWithErrorForCancellation); | 576 DidFailProvisionalLoadWithErrorForCancellation); |
588 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 577 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
589 DontIgnoreBackAfterNavEntryLimit); | 578 DontIgnoreBackAfterNavEntryLimit); |
590 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition); | 579 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition); |
591 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters); | 580 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters); |
592 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad); | 581 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 void OnUpdateWebPreferences(const WebPreferences& prefs); | 722 void OnUpdateWebPreferences(const WebPreferences& prefs); |
734 void OnZoom(PageZoom zoom); | 723 void OnZoom(PageZoom zoom); |
735 void OnEnableViewSourceMode(); | 724 void OnEnableViewSourceMode(); |
736 void OnWindowSnapshotCompleted(const int snapshot_id, | 725 void OnWindowSnapshotCompleted(const int snapshot_id, |
737 const gfx::Size& size, const std::vector<unsigned char>& png); | 726 const gfx::Size& size, const std::vector<unsigned char>& png); |
738 void OnForceRedraw(int request_id); | 727 void OnForceRedraw(int request_id); |
739 void OnSelectWordAroundCaret(); | 728 void OnSelectWordAroundCaret(); |
740 #if defined(OS_ANDROID) | 729 #if defined(OS_ANDROID) |
741 void OnActivateNearestFindResult(int request_id, float x, float y); | 730 void OnActivateNearestFindResult(int request_id, float x, float y); |
742 void OnFindMatchRects(int current_version); | 731 void OnFindMatchRects(int current_version); |
743 void OnSelectPopupMenuItems(bool canceled, | |
744 const std::vector<int>& selected_indices); | |
745 void OnUndoScrollFocusedEditableNodeIntoRect(); | 732 void OnUndoScrollFocusedEditableNodeIntoRect(); |
746 void OnUpdateTopControlsState(bool enable_hiding, | 733 void OnUpdateTopControlsState(bool enable_hiding, |
747 bool enable_showing, | 734 bool enable_showing, |
748 bool animate); | 735 bool animate); |
749 void OnExtractSmartClipData(const gfx::Rect& rect); | 736 void OnExtractSmartClipData(const gfx::Rect& rect); |
750 #elif defined(OS_MACOSX) | 737 #elif defined(OS_MACOSX) |
751 void OnGetRenderedText(); | 738 void OnGetRenderedText(); |
752 void OnPluginImeCompositionCompleted(const base::string16& text, | 739 void OnPluginImeCompositionCompleted(const base::string16& text, |
753 int plugin_id); | 740 int plugin_id); |
754 void OnSelectPopupMenuItem(int selected_index); | |
755 void OnSetInLiveResize(bool in_live_resize); | 741 void OnSetInLiveResize(bool in_live_resize); |
756 void OnSetWindowVisibility(bool visible); | 742 void OnSetWindowVisibility(bool visible); |
757 void OnWindowFrameChanged(const gfx::Rect& window_frame, | 743 void OnWindowFrameChanged(const gfx::Rect& window_frame, |
758 const gfx::Rect& view_frame); | 744 const gfx::Rect& view_frame); |
759 #endif | 745 #endif |
760 | 746 |
761 // Adding a new message handler? Please add it in alphabetical order above | 747 // Adding a new message handler? Please add it in alphabetical order above |
762 // and put it in the same position in the .cc file. | 748 // and put it in the same position in the .cc file. |
763 | 749 |
764 // Misc private functions ---------------------------------------------------- | 750 // Misc private functions ---------------------------------------------------- |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 | 1089 |
1104 // The SessionStorage namespace that we're assigned to has an ID, and that ID | 1090 // The SessionStorage namespace that we're assigned to has an ID, and that ID |
1105 // is passed to us upon creation. WebKit asks for this ID upon first use and | 1091 // is passed to us upon creation. WebKit asks for this ID upon first use and |
1106 // uses it whenever asking the browser process to allocate new storage areas. | 1092 // uses it whenever asking the browser process to allocate new storage areas. |
1107 int64 session_storage_namespace_id_; | 1093 int64 session_storage_namespace_id_; |
1108 | 1094 |
1109 // Stores edit commands associated to the next key event. | 1095 // Stores edit commands associated to the next key event. |
1110 // Shall be cleared as soon as the next key event is processed. | 1096 // Shall be cleared as soon as the next key event is processed. |
1111 EditCommands edit_commands_; | 1097 EditCommands edit_commands_; |
1112 | 1098 |
1113 #if defined(OS_MACOSX) || defined(OS_ANDROID) | |
1114 // The external popup for the currently showing select popup. | |
1115 scoped_ptr<ExternalPopupMenu> external_popup_menu_; | |
1116 #endif | |
1117 | |
1118 // All the registered observers. We expect this list to be small, so vector | 1099 // All the registered observers. We expect this list to be small, so vector |
1119 // is fine. | 1100 // is fine. |
1120 ObserverList<RenderViewObserver> observers_; | 1101 ObserverList<RenderViewObserver> observers_; |
1121 | 1102 |
1122 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. | 1103 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
1123 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | 1104 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
1124 | 1105 |
1125 // State associated with the GetWindowSnapshot function. | 1106 // State associated with the GetWindowSnapshot function. |
1126 int next_snapshot_id_; | 1107 int next_snapshot_id_; |
1127 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap; | 1108 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap; |
(...skipping 19 matching lines...) Expand all Loading... |
1147 // use the Observer interface to filter IPC messages and receive frame change | 1128 // use the Observer interface to filter IPC messages and receive frame change |
1148 // notifications. | 1129 // notifications. |
1149 // --------------------------------------------------------------------------- | 1130 // --------------------------------------------------------------------------- |
1150 | 1131 |
1151 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1132 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1152 }; | 1133 }; |
1153 | 1134 |
1154 } // namespace content | 1135 } // namespace content |
1155 | 1136 |
1156 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1137 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |