Chromium Code Reviews| Index: components/web_view/web_view_impl.h |
| diff --git a/components/web_view/web_view_impl.h b/components/web_view/web_view_impl.h |
| index c7a49d4a2bea75e664dfc693cc850fcc328e3357..d1a096ba84a39a3f43df36603f1b8cbd4258458e 100644 |
| --- a/components/web_view/web_view_impl.h |
| +++ b/components/web_view/web_view_impl.h |
| @@ -5,6 +5,7 @@ |
| #ifndef COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_ |
| #define COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_ |
| +#include <deque> |
| #include <string> |
| #include "base/macros.h" |
| @@ -49,14 +50,27 @@ class WebViewImpl : public mojom::WebView, |
| private: |
| friend class PendingWebViewLoad; |
| + struct MatchData { |
| + int count; |
| + bool final_update; |
| + }; |
| + |
| // See description above |pending_load_| for details. |
| void OnLoad(const GURL& pending_url); |
| + std::deque<Frame*> GetAllFrames(); |
| + |
| + // Callback method invoked by Find(). |
| + void OnContinueFinding(int32_t request_id, const mojo::String& search_text, |
| + bool found); |
| + |
| // Overridden from WebView: |
| void LoadRequest(mojo::URLRequestPtr request) override; |
| void GetViewTreeClient( |
| mojo::InterfaceRequest<mojo::ViewTreeClient> view_tree_client) |
| override; |
| + void Find(int32_t request_id, const mojo::String& search_text) override; |
| + void StopFinding() override; |
| void GoBack() override; |
| void GoForward() override; |
| @@ -84,6 +98,14 @@ class WebViewImpl : public mojom::WebView, |
| const CanNavigateFrameCallback& callback) override; |
| void DidStartNavigation(Frame* frame) override; |
| void DidCommitProvisionalLoad(Frame* frame) override; |
| + void DidDestroyFrame(Frame* frame) override; |
| + void OnReportFindInFrameMatchCount(int32_t request_id, |
| + Frame* frame, |
| + int32_t count, |
| + bool final_update) override; |
| + void OnReportFindInPageSelection(int32_t request_id, |
| + Frame* frame, |
| + int32_t active_match_ordinal) override; |
| // Overridden from FrameDevToolsAgent::Delegate: |
| void HandlePageNavigateRequest(const GURL& url) override; |
| @@ -108,6 +130,16 @@ class WebViewImpl : public mojom::WebView, |
| NavigationController navigation_controller_; |
| + // A list of Frames which we have not sent a Find() command to. Initialized |
| + // in Find(), and read from OnContinueFinding(). |
| + std::deque<Frame*> pending_find_frames_; |
|
sky
2015/10/02 16:03:40
Can the find related code be moved into it's own c
|
| + |
| + // Current find |
| + int current_find_request_; |
| + |
| + // The current callback data from various frames. |
| + std::map<Frame*, MatchData> returned_find_data_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(WebViewImpl); |
| }; |