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

Unified Diff: content/browser/web_contents/web_contents_impl.h

Issue 1851793002: Implement a shell of FindRequestManager, and hook it up to WebContentsImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.h
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 77f73eab30e09edb9196b3b5000b5d75966a7f28..6ef11bdd3f0b1050d32e83ee4ecb58f55879d6bd 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -56,6 +56,7 @@ class BrowserPluginEmbedder;
class BrowserPluginGuest;
class DateTimeChooserAndroid;
class DownloadItem;
+class FindRequestManager;
class GeolocationServiceContext;
class InterstitialPageImpl;
class JavaScriptDialogManager;
@@ -384,6 +385,8 @@ class CONTENT_EXPORT WebContentsImpl
#if defined(OS_ANDROID)
base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() override;
virtual WebContentsAndroid* GetWebContentsAndroid();
+ void ActivateNearestFindResult(float x, float y) override;
+ void RequestFindMatchRects(int current_version) override;
#elif defined(OS_MACOSX)
void SetAllowOtherViews(bool allow) override;
bool GetAllowOtherViews() override;
@@ -746,6 +749,9 @@ class CONTENT_EXPORT WebContentsImpl
FRIEND_TEST_ALL_PREFIXES(SitePerProcessAccessibilityBrowserTest,
CrossSiteIframeAccessibility);
+ // So FindRequestManager can access FindReply/FindMatchRectsReply.
+ friend class FindRequestManager;
lfg 2016/04/04 18:57:32 Those functions can be public in WebContentsImpl i
+
// So InterstitialPageImpl can access SetIsLoading.
friend class InterstitialPageImpl;
@@ -779,7 +785,7 @@ class CONTENT_EXPORT WebContentsImpl
}
private:
- // The outer Webontents.
+ // The outer WebContents.
WebContentsImpl* outer_web_contents_;
// The ID of the FrameTreeNode in outer WebContents that is hosting us.
int outer_contents_frame_tree_node_id_;
@@ -877,7 +883,7 @@ class CONTENT_EXPORT WebContentsImpl
void OnFindMatchRectsReply(int version,
const std::vector<gfx::RectF>& rects,
const gfx::RectF& active_rect);
-
+ void OnGetNearestFindResultReply(int request_id, float distance);
void OnOpenDateTimeDialog(
const ViewHostMsg_DateTimeDialogValue_Params& value);
#endif
@@ -1031,6 +1037,24 @@ class CONTENT_EXPORT WebContentsImpl
void SetJavaScriptDialogManagerForTesting(
JavaScriptDialogManager* dialog_manager);
+ // Returns the FindRequestManager, or creates one if it doesn't already exist.
+ FindRequestManager* GetOrCreateFindRequestManager();
+
+ // Called by FindRequestManager when find replies come in from a renderer
+ // process.
+ void FindReply(int request_id,
+ int number_of_matches,
+ const gfx::Rect& selection_rect,
+ int active_match_ordinal,
+ bool final_update);
+
+#if defined(OS_ANDROID)
+ // Called by FindRequestManager when all of the match rects are in.
+ void FindMatchRectsReply(int version,
+ const std::vector<gfx::RectF>& rects,
+ const gfx::RectF& active_rect);
+#endif
+
// Data for core operation ---------------------------------------------------
// Delegate for notifying our owner about stuff. Not owned by us.
@@ -1082,6 +1106,9 @@ class CONTENT_EXPORT WebContentsImpl
// SavePackage, lazily created.
scoped_refptr<SavePackage> save_package_;
+ // Manages/coordinates find-in-page requests. Created lazily.
+ scoped_ptr<FindRequestManager> find_request_manager_;
+
// Data for loading state ----------------------------------------------------
// Indicates whether the current load is to a different document. Only valid

Powered by Google App Engine
This is Rietveld 408576698