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

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

Issue 10941015: [Android] Upstream the WebView find-in-page API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes. Created 8 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); 893 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
894 894
895 // Called when the "pinned to left/right edge" state needs to be updated. 895 // Called when the "pinned to left/right edge" state needs to be updated.
896 void UpdateScrollState(WebKit::WebFrame* frame); 896 void UpdateScrollState(WebKit::WebFrame* frame);
897 897
898 // IPC message handlers ------------------------------------------------------ 898 // IPC message handlers ------------------------------------------------------
899 // 899 //
900 // The documentation for these functions should be in 900 // The documentation for these functions should be in
901 // render_messages_internal.h for the message that the function is handling. 901 // render_messages_internal.h for the message that the function is handling.
902 902
903 #if defined(OS_ANDROID) 903 #if defined(OS_ANDROID)
jam 2012/09/19 19:37:56 move these below too
Leandro GraciĆ” Gil 2012/09/20 16:05:06 Done. As in the other cases, grouped the MACOSX ha
904 void OnActivateNearestFindResult(int request_id, float x, float y); 904 void OnActivateNearestFindResult(int request_id, float x, float y);
905 #endif 905 #endif
906 CONTENT_EXPORT void OnAllowBindings(int enabled_bindings_flags); 906 CONTENT_EXPORT void OnAllowBindings(int enabled_bindings_flags);
907 void OnAllowScriptToClose(bool script_can_close); 907 void OnAllowScriptToClose(bool script_can_close);
908 void OnAsyncFileOpened(base::PlatformFileError error_code, 908 void OnAsyncFileOpened(base::PlatformFileError error_code,
909 IPC::PlatformFileForTransit file_for_transit, 909 IPC::PlatformFileForTransit file_for_transit,
910 int message_id); 910 int message_id);
911 void OnPpapiBrokerChannelCreated(int request_id, 911 void OnPpapiBrokerChannelCreated(int request_id,
912 const IPC::ChannelHandle& handle); 912 const IPC::ChannelHandle& handle);
913 void OnPpapiBrokerPermissionResult(int request_id, bool result); 913 void OnPpapiBrokerPermissionResult(int request_id, bool result);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 void OnSetWindowVisibility(bool visible); 1020 void OnSetWindowVisibility(bool visible);
1021 #endif 1021 #endif
1022 void OnSetZoomLevel(double zoom_level); 1022 void OnSetZoomLevel(double zoom_level);
1023 CONTENT_EXPORT void OnSetZoomLevelForLoadingURL(const GURL& url, 1023 CONTENT_EXPORT void OnSetZoomLevelForLoadingURL(const GURL& url,
1024 double zoom_level); 1024 double zoom_level);
1025 void OnExitFullscreen(); 1025 void OnExitFullscreen();
1026 void OnShouldClose(); 1026 void OnShouldClose();
1027 void OnStop(); 1027 void OnStop();
1028 void OnStopFinding(content::StopFindAction action); 1028 void OnStopFinding(content::StopFindAction action);
1029 CONTENT_EXPORT void OnSwapOut(const ViewMsg_SwapOut_Params& params); 1029 CONTENT_EXPORT void OnSwapOut(const ViewMsg_SwapOut_Params& params);
1030 #if defined(OS_ANDROID)
1031 void OnSynchronousFind(int request_id,
1032 const string16& search_string,
1033 const WebKit::WebFindOptions& options,
1034 IPC::Message* reply_msg);
1035 #endif
1030 void OnThemeChanged(); 1036 void OnThemeChanged();
1031 void OnUndo(); 1037 void OnUndo();
1032 void OnUpdateTargetURLAck(); 1038 void OnUpdateTargetURLAck();
1033 CONTENT_EXPORT void OnUpdateWebPreferences( 1039 CONTENT_EXPORT void OnUpdateWebPreferences(
1034 const webkit_glue::WebPreferences& prefs); 1040 const webkit_glue::WebPreferences& prefs);
1035 CONTENT_EXPORT void OnUnselect(); 1041 CONTENT_EXPORT void OnUnselect();
1036 1042
1037 #if defined(OS_MACOSX) 1043 #if defined(OS_MACOSX)
1038 void OnWindowFrameChanged(const gfx::Rect& window_frame, 1044 void OnWindowFrameChanged(const gfx::Rect& window_frame,
1039 const gfx::Rect& view_frame); 1045 const gfx::Rect& view_frame);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 const SkBitmap& image); 1110 const SkBitmap& image);
1105 1111
1106 // Requests to download a favicon image. When done, the RenderView is notified 1112 // Requests to download a favicon image. When done, the RenderView is notified
1107 // by way of DidDownloadFavicon. Returns true if the request was successfully 1113 // by way of DidDownloadFavicon. Returns true if the request was successfully
1108 // started, false otherwise. id is used to uniquely identify the request and 1114 // started, false otherwise. id is used to uniquely identify the request and
1109 // passed back to the DidDownloadFavicon method. If the image has multiple 1115 // passed back to the DidDownloadFavicon method. If the image has multiple
1110 // frames, the frame whose size is image_size is returned. If the image 1116 // frames, the frame whose size is image_size is returned. If the image
1111 // doesn't have a frame at the specified size, the first is returned. 1117 // doesn't have a frame at the specified size, the first is returned.
1112 bool DownloadFavicon(int id, const GURL& image_url, int image_size); 1118 bool DownloadFavicon(int id, const GURL& image_url, int image_size);
1113 1119
1120 // Starts a new find-in-page search or looks for the next match.
1121 void Find(int request_id,
1122 const string16& search_text,
1123 const WebKit::WebFindOptions& options);
1124
1114 GURL GetAlternateErrorPageURL(const GURL& failed_url, 1125 GURL GetAlternateErrorPageURL(const GURL& failed_url,
1115 ErrorPageType error_type); 1126 ErrorPageType error_type);
1116 1127
1117 // Locates a sub frame with given xpath 1128 // Locates a sub frame with given xpath
1118 WebKit::WebFrame* GetChildFrame(const string16& frame_xpath) const; 1129 WebKit::WebFrame* GetChildFrame(const string16& frame_xpath) const;
1119 1130
1120 // Returns the opener url if present, else an empty url. 1131 // Returns the opener url if present, else an empty url.
1121 GURL GetOpenerUrl() const; 1132 GURL GetOpenerUrl() const;
1122 1133
1123 // Returns the URL being loaded by the given frame's request. 1134 // Returns the URL being loaded by the given frame's request.
(...skipping 26 matching lines...) Expand all
1150 void PopulateDocumentStateFromPending(content::DocumentState* document_state); 1161 void PopulateDocumentStateFromPending(content::DocumentState* document_state);
1151 1162
1152 // Returns a new NavigationState populated with the navigation information 1163 // Returns a new NavigationState populated with the navigation information
1153 // saved in OnNavigate(). 1164 // saved in OnNavigate().
1154 content::NavigationState* CreateNavigationStateFromPending(); 1165 content::NavigationState* CreateNavigationStateFromPending();
1155 1166
1156 // Processes the command-line flags --enable-viewport and 1167 // Processes the command-line flags --enable-viewport and
1157 // --enable-fixed-layout[=w,h]. 1168 // --enable-fixed-layout[=w,h].
1158 void ProcessViewLayoutFlags(const CommandLine& command_line); 1169 void ProcessViewLayoutFlags(const CommandLine& command_line);
1159 1170
1171 // Sends a reply to the current find operation handling if it was a
1172 // synchronous find request.
1173 void SendFindReply(int request_id,
1174 int match_count,
1175 int ordinal,
1176 const WebKit::WebRect& selection_rect,
1177 bool final_status_update);
1178
1160 // Starts nav_state_sync_timer_ if it isn't already running. 1179 // Starts nav_state_sync_timer_ if it isn't already running.
1161 void StartNavStateSyncTimerIfNecessary(); 1180 void StartNavStateSyncTimerIfNecessary();
1162 1181
1182 // Stops the current find-in-page search.
1183 void StopFinding(content::StopFindAction action);
1184
1163 // Dispatches the current navigation state to the browser. Called on a 1185 // Dispatches the current navigation state to the browser. Called on a
1164 // periodic timer so we don't send too many messages. 1186 // periodic timer so we don't send too many messages.
1165 void SyncNavigationState(); 1187 void SyncNavigationState();
1166 1188
1167 // Dispatches the current state of selection on the webpage to the browser if 1189 // Dispatches the current state of selection on the webpage to the browser if
1168 // it has changed. 1190 // it has changed.
1169 // TODO(varunjain): delete this method once we figure out how to keep 1191 // TODO(varunjain): delete this method once we figure out how to keep
1170 // selection handles in sync with the webpage. 1192 // selection handles in sync with the webpage.
1171 void SyncSelectionIfRequired(); 1193 void SyncSelectionIfRequired();
1172 1194
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 // Android Specific --------------------------------------------------------- 1422 // Android Specific ---------------------------------------------------------
1401 1423
1402 // Expected id of the next content intent launched. Used to prevent scheduled 1424 // Expected id of the next content intent launched. Used to prevent scheduled
1403 // intents to be launched if aborted. 1425 // intents to be launched if aborted.
1404 size_t expected_content_intent_id_; 1426 size_t expected_content_intent_id_;
1405 1427
1406 // List of click-based content detectors. 1428 // List of click-based content detectors.
1407 typedef std::vector< linked_ptr<content::ContentDetector> > 1429 typedef std::vector< linked_ptr<content::ContentDetector> >
1408 ContentDetectorList; 1430 ContentDetectorList;
1409 ContentDetectorList content_detectors_; 1431 ContentDetectorList content_detectors_;
1432
1433 // Holds the message used to return find results to the browser during
1434 // synchronous find-in-page requests. Only non-null during these requests.
1435 scoped_ptr<IPC::Message> synchronous_find_reply_message_;
1436
1437 // The active find-in-page match ordinal during synchronous requests.
1438 // Needed to be remembered across WebKit callbacks.
1439 int synchronous_find_active_match_ordinal_;
1410 #endif 1440 #endif
1411 1441
1412 // Misc ---------------------------------------------------------------------- 1442 // Misc ----------------------------------------------------------------------
1413 1443
1414 // The current and pending file chooser completion objects. If the queue is 1444 // The current and pending file chooser completion objects. If the queue is
1415 // nonempty, the first item represents the currently running file chooser 1445 // nonempty, the first item represents the currently running file chooser
1416 // callback, and the remaining elements are the other file chooser completion 1446 // callback, and the remaining elements are the other file chooser completion
1417 // still waiting to be run (in order). 1447 // still waiting to be run (in order).
1418 struct PendingFileChooser; 1448 struct PendingFileChooser;
1419 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_; 1449 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 // bunch of stuff, you should probably create a helper class and put your 1572 // bunch of stuff, you should probably create a helper class and put your
1543 // data and methods on that to avoid bloating RenderView more. You can 1573 // data and methods on that to avoid bloating RenderView more. You can
1544 // use the Observer interface to filter IPC messages and receive frame change 1574 // use the Observer interface to filter IPC messages and receive frame change
1545 // notifications. 1575 // notifications.
1546 // --------------------------------------------------------------------------- 1576 // ---------------------------------------------------------------------------
1547 1577
1548 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); 1578 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1549 }; 1579 };
1550 1580
1551 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ 1581 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698