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

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

Issue 501583003: Move external popup menus from WebViewClient to WebFrameClient, part 3/3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nicer ipc Created 6 years, 3 months 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 | Annotate | Revision Log
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 <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
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
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
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
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 void OnZoom(PageZoom zoom); 723 void OnZoom(PageZoom zoom);
735 void OnEnableViewSourceMode(); 724 void OnEnableViewSourceMode();
736 void OnDisownOpener(); 725 void OnDisownOpener();
737 void OnWindowSnapshotCompleted(const int snapshot_id, 726 void OnWindowSnapshotCompleted(const int snapshot_id,
738 const gfx::Size& size, const std::vector<unsigned char>& png); 727 const gfx::Size& size, const std::vector<unsigned char>& png);
739 void OnForceRedraw(int request_id); 728 void OnForceRedraw(int request_id);
740 void OnSelectWordAroundCaret(); 729 void OnSelectWordAroundCaret();
741 #if defined(OS_ANDROID) 730 #if defined(OS_ANDROID)
742 void OnActivateNearestFindResult(int request_id, float x, float y); 731 void OnActivateNearestFindResult(int request_id, float x, float y);
743 void OnFindMatchRects(int current_version); 732 void OnFindMatchRects(int current_version);
744 void OnSelectPopupMenuItems(bool canceled,
745 const std::vector<int>& selected_indices);
746 void OnUndoScrollFocusedEditableNodeIntoRect(); 733 void OnUndoScrollFocusedEditableNodeIntoRect();
747 void OnUpdateTopControlsState(bool enable_hiding, 734 void OnUpdateTopControlsState(bool enable_hiding,
748 bool enable_showing, 735 bool enable_showing,
749 bool animate); 736 bool animate);
750 void OnExtractSmartClipData(const gfx::Rect& rect); 737 void OnExtractSmartClipData(const gfx::Rect& rect);
751 #elif defined(OS_MACOSX) 738 #elif defined(OS_MACOSX)
752 void OnGetRenderedText(); 739 void OnGetRenderedText();
753 void OnPluginImeCompositionCompleted(const base::string16& text, 740 void OnPluginImeCompositionCompleted(const base::string16& text,
754 int plugin_id); 741 int plugin_id);
755 void OnSelectPopupMenuItem(int selected_index);
756 void OnSetInLiveResize(bool in_live_resize); 742 void OnSetInLiveResize(bool in_live_resize);
757 void OnSetWindowVisibility(bool visible); 743 void OnSetWindowVisibility(bool visible);
758 void OnWindowFrameChanged(const gfx::Rect& window_frame, 744 void OnWindowFrameChanged(const gfx::Rect& window_frame,
759 const gfx::Rect& view_frame); 745 const gfx::Rect& view_frame);
760 #endif 746 #endif
761 747
762 // Adding a new message handler? Please add it in alphabetical order above 748 // Adding a new message handler? Please add it in alphabetical order above
763 // and put it in the same position in the .cc file. 749 // and put it in the same position in the .cc file.
764 750
765 // Misc private functions ---------------------------------------------------- 751 // Misc private functions ----------------------------------------------------
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 1090
1105 // The SessionStorage namespace that we're assigned to has an ID, and that ID 1091 // The SessionStorage namespace that we're assigned to has an ID, and that ID
1106 // is passed to us upon creation. WebKit asks for this ID upon first use and 1092 // is passed to us upon creation. WebKit asks for this ID upon first use and
1107 // uses it whenever asking the browser process to allocate new storage areas. 1093 // uses it whenever asking the browser process to allocate new storage areas.
1108 int64 session_storage_namespace_id_; 1094 int64 session_storage_namespace_id_;
1109 1095
1110 // Stores edit commands associated to the next key event. 1096 // Stores edit commands associated to the next key event.
1111 // Shall be cleared as soon as the next key event is processed. 1097 // Shall be cleared as soon as the next key event is processed.
1112 EditCommands edit_commands_; 1098 EditCommands edit_commands_;
1113 1099
1114 #if defined(OS_MACOSX) || defined(OS_ANDROID)
1115 // The external popup for the currently showing select popup.
1116 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
1117 #endif
1118
1119 // All the registered observers. We expect this list to be small, so vector 1100 // All the registered observers. We expect this list to be small, so vector
1120 // is fine. 1101 // is fine.
1121 ObserverList<RenderViewObserver> observers_; 1102 ObserverList<RenderViewObserver> observers_;
1122 1103
1123 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. 1104 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
1124 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; 1105 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
1125 1106
1126 // State associated with the GetWindowSnapshot function. 1107 // State associated with the GetWindowSnapshot function.
1127 int next_snapshot_id_; 1108 int next_snapshot_id_;
1128 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap; 1109 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap;
(...skipping 19 matching lines...) Expand all
1148 // use the Observer interface to filter IPC messages and receive frame change 1129 // use the Observer interface to filter IPC messages and receive frame change
1149 // notifications. 1130 // notifications.
1150 // --------------------------------------------------------------------------- 1131 // ---------------------------------------------------------------------------
1151 1132
1152 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 1133 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1153 }; 1134 };
1154 1135
1155 } // namespace content 1136 } // namespace content
1156 1137
1157 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 1138 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698