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

Unified Diff: components/web_view/web_view_impl.h

Issue 1371773003: mandoline: Add find in page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Further patch cleanup; use a WeakPtrFactory in FindController. Created 5 years, 2 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: 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..60eb8c88360f7bf141330dc1b7087f54adc2384b 100644
--- a/components/web_view/web_view_impl.h
+++ b/components/web_view/web_view_impl.h
@@ -5,12 +5,15 @@
#ifndef COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
#define COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
+#include <deque>
#include <string>
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "components/mus/public/cpp/view_observer.h"
#include "components/mus/public/cpp/view_tree_delegate.h"
+#include "components/web_view/find_controller.h"
+#include "components/web_view/find_controller_delegate.h"
#include "components/web_view/frame_devtools_agent_delegate.h"
#include "components/web_view/frame_tree_delegate.h"
#include "components/web_view/navigation_controller.h"
@@ -39,7 +42,8 @@ class WebViewImpl : public mojom::WebView,
public mus::ViewObserver,
public FrameTreeDelegate,
public FrameDevToolsAgentDelegate,
- public NavigationControllerDelegate {
+ public NavigationControllerDelegate,
+ public FindControllerDelegate {
public:
WebViewImpl(mojo::ApplicationImpl* app,
mojom::WebViewClientPtr client,
@@ -57,6 +61,8 @@ class WebViewImpl : public mojom::WebView,
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 +90,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;
@@ -92,6 +106,10 @@ class WebViewImpl : public mojom::WebView,
void OnNavigate(mojo::URLRequestPtr request) override;
void OnDidNavigate() override;
+ // Overridden from FindControllerDelegate:
+ std::deque<Frame*> GetAllFrames() override;
+ mojom::WebViewClient* GetWebViewClient() override;
+
mojo::ApplicationImpl* app_;
mojom::WebViewClientPtr client_;
mojo::StrongBinding<WebView> binding_;
@@ -108,6 +126,8 @@ class WebViewImpl : public mojom::WebView,
NavigationController navigation_controller_;
+ FindController find_controller_;
+
DISALLOW_COPY_AND_ASSIGN(WebViewImpl);
};

Powered by Google App Engine
This is Rietveld 408576698