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

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

Issue 6764001: Update the code to have the SpellCheckProvider implement WebSpellCheckClient, in preparation for ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_H_ 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_H_
6 #define CONTENT_RENDERER_RENDER_VIEW_H_ 6 #define CONTENT_RENDERER_RENDER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 class WebImage; 140 class WebImage;
141 class WebInputElement; 141 class WebInputElement;
142 class WebKeyboardEvent; 142 class WebKeyboardEvent;
143 class WebMediaPlayer; 143 class WebMediaPlayer;
144 class WebMediaPlayerClient; 144 class WebMediaPlayerClient;
145 class WebMouseEvent; 145 class WebMouseEvent;
146 class WebPlugin; 146 class WebPlugin;
147 class WebSpeechInputController; 147 class WebSpeechInputController;
148 class WebSpeechInputListener; 148 class WebSpeechInputListener;
149 class WebStorageNamespace; 149 class WebStorageNamespace;
150 class WebTextCheckingCompletion;
151 class WebURLRequest; 150 class WebURLRequest;
152 class WebView; 151 class WebView;
153 struct WebContextMenuData; 152 struct WebContextMenuData;
154 struct WebFileChooserParams; 153 struct WebFileChooserParams;
155 struct WebFindOptions; 154 struct WebFindOptions;
156 struct WebMediaPlayerAction; 155 struct WebMediaPlayerAction;
157 struct WebPluginParams; 156 struct WebPluginParams;
158 struct WebPoint; 157 struct WebPoint;
159 struct WebWindowFeatures; 158 struct WebWindowFeatures;
160 } 159 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 virtual WebKit::WebNotificationPresenter* notificationPresenter(); 395 virtual WebKit::WebNotificationPresenter* notificationPresenter();
397 virtual void didStartLoading(); 396 virtual void didStartLoading();
398 virtual void didStopLoading(); 397 virtual void didStopLoading();
399 virtual void didChangeLoadProgress(WebKit::WebFrame* frame, 398 virtual void didChangeLoadProgress(WebKit::WebFrame* frame,
400 double load_progress); 399 double load_progress);
401 virtual bool isSmartInsertDeleteEnabled(); 400 virtual bool isSmartInsertDeleteEnabled();
402 virtual bool isSelectTrailingWhitespaceEnabled(); 401 virtual bool isSelectTrailingWhitespaceEnabled();
403 virtual void didChangeSelection(bool is_selection_empty); 402 virtual void didChangeSelection(bool is_selection_empty);
404 virtual void didExecuteCommand(const WebKit::WebString& command_name); 403 virtual void didExecuteCommand(const WebKit::WebString& command_name);
405 virtual bool handleCurrentKeyboardEvent(); 404 virtual bool handleCurrentKeyboardEvent();
406 virtual void spellCheck(const WebKit::WebString& text,
407 int& offset,
408 int& length);
409 virtual void requestCheckingOfText(
410 const WebKit::WebString& text,
411 WebKit::WebTextCheckingCompletion* completion);
412 virtual WebKit::WebString autoCorrectWord(
413 const WebKit::WebString& misspelled_word);
414 virtual void showSpellingUI(bool show);
415 virtual bool isShowingSpellingUI();
416 virtual void updateSpellingUIWithMisspelledWord(
417 const WebKit::WebString& word);
418 virtual void continuousSpellCheckingEnabledStateChanged();
419 virtual bool runFileChooser( 405 virtual bool runFileChooser(
420 const WebKit::WebFileChooserParams& params, 406 const WebKit::WebFileChooserParams& params,
421 WebKit::WebFileChooserCompletion* chooser_completion); 407 WebKit::WebFileChooserCompletion* chooser_completion);
422 virtual void runModalAlertDialog(WebKit::WebFrame* frame, 408 virtual void runModalAlertDialog(WebKit::WebFrame* frame,
423 const WebKit::WebString& message); 409 const WebKit::WebString& message);
424 virtual bool runModalConfirmDialog(WebKit::WebFrame* frame, 410 virtual bool runModalConfirmDialog(WebKit::WebFrame* frame,
425 const WebKit::WebString& message); 411 const WebKit::WebString& message);
426 virtual bool runModalPromptDialog(WebKit::WebFrame* frame, 412 virtual bool runModalPromptDialog(WebKit::WebFrame* frame,
427 const WebKit::WebString& message, 413 const WebKit::WebString& message,
428 const WebKit::WebString& default_value, 414 const WebKit::WebString& default_value,
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 void SendPendingAccessibilityNotifications(); 763 void SendPendingAccessibilityNotifications();
778 764
779 // IPC message handlers ------------------------------------------------------ 765 // IPC message handlers ------------------------------------------------------
780 // 766 //
781 // The documentation for these functions should be in 767 // The documentation for these functions should be in
782 // render_messages_internal.h for the message that the function is handling. 768 // render_messages_internal.h for the message that the function is handling.
783 769
784 void OnAccessibilityDoDefaultAction(int acc_obj_id); 770 void OnAccessibilityDoDefaultAction(int acc_obj_id);
785 void OnAccessibilityNotificationsAck(); 771 void OnAccessibilityNotificationsAck();
786 void OnAllowBindings(int enabled_bindings_flags); 772 void OnAllowBindings(int enabled_bindings_flags);
787 void OnAdvanceToNextMisspelling();
788 void OnAllowScriptToClose(bool script_can_close); 773 void OnAllowScriptToClose(bool script_can_close);
789 void OnAsyncFileOpened(base::PlatformFileError error_code, 774 void OnAsyncFileOpened(base::PlatformFileError error_code,
790 IPC::PlatformFileForTransit file_for_transit, 775 IPC::PlatformFileForTransit file_for_transit,
791 int message_id); 776 int message_id);
792 void OnCancelDownload(int32 download_id); 777 void OnCancelDownload(int32 download_id);
793 void OnClearFocusedNode(); 778 void OnClearFocusedNode();
794 void OnClosePage(const ViewMsg_ClosePage_Params& params); 779 void OnClosePage(const ViewMsg_ClosePage_Params& params);
795 #if defined(ENABLE_FLAPPER_HACKS) 780 #if defined(ENABLE_FLAPPER_HACKS)
796 void OnConnectTcpACK(int request_id, 781 void OnConnectTcpACK(int request_id,
797 IPC::PlatformFileForTransit socket_for_transit, 782 IPC::PlatformFileForTransit socket_for_transit,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 void OnSetupDevToolsClient(); 875 void OnSetupDevToolsClient();
891 #if defined(OS_MACOSX) 876 #if defined(OS_MACOSX)
892 void OnSetWindowVisibility(bool visible); 877 void OnSetWindowVisibility(bool visible);
893 #endif 878 #endif
894 void OnSetZoomLevel(double zoom_level); 879 void OnSetZoomLevel(double zoom_level);
895 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); 880 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
896 void OnShouldClose(); 881 void OnShouldClose();
897 void OnStop(); 882 void OnStop();
898 void OnStopFinding(const ViewMsg_StopFinding_Params& params); 883 void OnStopFinding(const ViewMsg_StopFinding_Params& params);
899 void OnThemeChanged(); 884 void OnThemeChanged();
900 void OnToggleSpellCheck();
901 void OnToggleSpellPanel(bool is_currently_visible);
902 void OnUndo(); 885 void OnUndo();
903 void OnUpdateBrowserWindowId(int window_id); 886 void OnUpdateBrowserWindowId(int window_id);
904 void OnUpdateTargetURLAck(); 887 void OnUpdateTargetURLAck();
905 void OnUpdateWebPreferences(const WebPreferences& prefs); 888 void OnUpdateWebPreferences(const WebPreferences& prefs);
906 #if defined(OS_MACOSX) 889 #if defined(OS_MACOSX)
907 void OnWindowFrameChanged(const gfx::Rect& window_frame, 890 void OnWindowFrameChanged(const gfx::Rect& window_frame,
908 const gfx::Rect& view_frame); 891 const gfx::Rect& view_frame);
909 void OnSelectPopupMenuItem(int selected_index); 892 void OnSelectPopupMenuItem(int selected_index);
910 #endif 893 #endif
911 void OnZoom(PageZoom::Function function); 894 void OnZoom(PageZoom::Function function);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 const SkBitmap& image); 958 const SkBitmap& image);
976 959
977 // Requests to download an image. When done, the RenderView is 960 // Requests to download an image. When done, the RenderView is
978 // notified by way of DidDownloadImage. Returns true if the request was 961 // notified by way of DidDownloadImage. Returns true if the request was
979 // successfully started, false otherwise. id is used to uniquely identify the 962 // successfully started, false otherwise. id is used to uniquely identify the
980 // request and passed back to the DidDownloadImage method. If the image has 963 // request and passed back to the DidDownloadImage method. If the image has
981 // multiple frames, the frame whose size is image_size is returned. If the 964 // multiple frames, the frame whose size is image_size is returned. If the
982 // image doesn't have a frame at the specified size, the first is returned. 965 // image doesn't have a frame at the specified size, the first is returned.
983 bool DownloadImage(int id, const GURL& image_url, int image_size); 966 bool DownloadImage(int id, const GURL& image_url, int image_size);
984 967
985 // Initializes the document_tag_ member if necessary.
986 void EnsureDocumentTag();
987
988 // Backend for the IPC Message ExecuteCode in addition to being used 968 // Backend for the IPC Message ExecuteCode in addition to being used
989 // internally by other RenderView functions. 969 // internally by other RenderView functions.
990 void ExecuteCodeImpl(WebKit::WebFrame* frame, 970 void ExecuteCodeImpl(WebKit::WebFrame* frame,
991 const ExtensionMsg_ExecuteCode_Params& params); 971 const ExtensionMsg_ExecuteCode_Params& params);
992 972
993 // Get all child frames of parent_frame, returned by frames_vector. 973 // Get all child frames of parent_frame, returned by frames_vector.
994 bool GetAllChildFrames(WebKit::WebFrame* parent_frame, 974 bool GetAllChildFrames(WebKit::WebFrame* parent_frame,
995 std::vector<WebKit::WebFrame* >* frames_vector) const; 975 std::vector<WebKit::WebFrame* >* frames_vector) const;
996 976
997 GURL GetAlternateErrorPageURL(const GURL& failed_url, 977 GURL GetAlternateErrorPageURL(const GURL& failed_url,
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 1158
1179 // The last gotten main frame's encoding. 1159 // The last gotten main frame's encoding.
1180 std::string last_encoding_name_; 1160 std::string last_encoding_name_;
1181 1161
1182 int history_list_offset_; 1162 int history_list_offset_;
1183 int history_list_length_; 1163 int history_list_length_;
1184 1164
1185 // True if the page has any frame-level unload or beforeunload listeners. 1165 // True if the page has any frame-level unload or beforeunload listeners.
1186 bool has_unload_listener_; 1166 bool has_unload_listener_;
1187 1167
1188 #if defined(OS_MACOSX)
1189 // True if the current RenderView has been assigned a document tag.
1190 bool has_document_tag_;
1191 #endif
1192
1193 int document_tag_;
1194
1195 // UI state ------------------------------------------------------------------ 1168 // UI state ------------------------------------------------------------------
1196 1169
1197 // The state of our target_url transmissions. When we receive a request to 1170 // The state of our target_url transmissions. When we receive a request to
1198 // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK 1171 // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK
1199 // comes back - if a new request comes in before the ACK, we store the new 1172 // comes back - if a new request comes in before the ACK, we store the new
1200 // URL in pending_target_url_ and set the status to TARGET_PENDING. If an 1173 // URL in pending_target_url_ and set the status to TARGET_PENDING. If an
1201 // ACK comes back and we are in TARGET_PENDING, we send the stored URL and 1174 // ACK comes back and we are in TARGET_PENDING, we send the stored URL and
1202 // revert to TARGET_INFLIGHT. 1175 // revert to TARGET_INFLIGHT.
1203 // 1176 //
1204 // We don't need a queue of URLs to send, as only the latest is useful. 1177 // We don't need a queue of URLs to send, as only the latest is useful.
(...skipping 11 matching lines...) Expand all
1216 1189
1217 // The URL the user's mouse is hovering over. 1190 // The URL the user's mouse is hovering over.
1218 GURL mouse_over_url_; 1191 GURL mouse_over_url_;
1219 1192
1220 // The URL that has keyboard focus. 1193 // The URL that has keyboard focus.
1221 GURL focus_url_; 1194 GURL focus_url_;
1222 1195
1223 // The next target URL we want to send to the browser. 1196 // The next target URL we want to send to the browser.
1224 GURL pending_target_url_; 1197 GURL pending_target_url_;
1225 1198
1226 // True if the browser is showing the spelling panel for us.
1227 bool spelling_panel_visible_;
1228
1229 // The text selection the last time DidChangeSelection got called. 1199 // The text selection the last time DidChangeSelection got called.
1230 std::string last_selection_; 1200 std::string last_selection_;
1231 1201
1232 // View ---------------------------------------------------------------------- 1202 // View ----------------------------------------------------------------------
1233 1203
1234 // Type of view attached with RenderView. See view_types.h 1204 // Type of view attached with RenderView. See view_types.h
1235 ViewType::Type view_type_; 1205 ViewType::Type view_type_;
1236 1206
1237 // Id number of browser window which RenderView is attached to. This is used 1207 // Id number of browser window which RenderView is attached to. This is used
1238 // for extensions. 1208 // for extensions.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 1260
1291 // The geolocation dispatcher attached to this view, lazily initialized. 1261 // The geolocation dispatcher attached to this view, lazily initialized.
1292 GeolocationDispatcher* geolocation_dispatcher_; 1262 GeolocationDispatcher* geolocation_dispatcher_;
1293 1263
1294 // The speech dispatcher attached to this view, lazily initialized. 1264 // The speech dispatcher attached to this view, lazily initialized.
1295 SpeechInputDispatcher* speech_input_dispatcher_; 1265 SpeechInputDispatcher* speech_input_dispatcher_;
1296 1266
1297 // Device orientation dispatcher attached to this view; lazily initialized. 1267 // Device orientation dispatcher attached to this view; lazily initialized.
1298 DeviceOrientationDispatcher* device_orientation_dispatcher_; 1268 DeviceOrientationDispatcher* device_orientation_dispatcher_;
1299 1269
1300 // PrintWebViewHelper handles printing. Weak pointer since it implements 1270 // PrintWebViewHelper handles printing
1301 // RenderViewObserver interface.
1302 PrintWebViewHelper* print_helper_; 1271 PrintWebViewHelper* print_helper_;
1303 1272
1304 // Weak pointer since it implements RenderViewObserver interface.
1305 SearchBox* searchbox_; 1273 SearchBox* searchbox_;
1306 1274
1307 // spellcheck provider which is registered as a view observer. 1275 // spellcheck provider which is registered as a view observer.
1308 // Note that RenderViewObserver subclasses like this will be deleted
1309 // automatically during RenderView destruction.
1310 SpellCheckProvider* spellcheck_provider_; 1276 SpellCheckProvider* spellcheck_provider_;
1311 1277
1312 scoped_refptr<AudioMessageFilter> audio_message_filter_; 1278 scoped_refptr<AudioMessageFilter> audio_message_filter_;
1313 1279
1314 // Handles accessibility requests into the renderer side, as well as 1280 // Handles accessibility requests into the renderer side, as well as
1315 // maintains the cache and other features of the accessibility tree. 1281 // maintains the cache and other features of the accessibility tree.
1316 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_; 1282 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_;
1317 1283
1318 // Collect renderer accessibility notifications until they are ready to be 1284 // Collect renderer accessibility notifications until they are ready to be
1319 // sent to the browser. 1285 // sent to the browser.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 // bunch of stuff, you should probably create a helper class and put your 1379 // bunch of stuff, you should probably create a helper class and put your
1414 // data and methods on that to avoid bloating RenderView more. You can use 1380 // data and methods on that to avoid bloating RenderView more. You can use
1415 // the Observer interface to filter IPC messages and receive frame change 1381 // the Observer interface to filter IPC messages and receive frame change
1416 // notifications. 1382 // notifications.
1417 // --------------------------------------------------------------------------- 1383 // ---------------------------------------------------------------------------
1418 1384
1419 DISALLOW_COPY_AND_ASSIGN(RenderView); 1385 DISALLOW_COPY_AND_ASSIGN(RenderView);
1420 }; 1386 };
1421 1387
1422 #endif // CONTENT_RENDERER_RENDER_VIEW_H_ 1388 #endif // CONTENT_RENDERER_RENDER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698