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

Unified Diff: extensions/browser/guest_view/web_view/web_view_guest_delegate.h

Issue 496873006: Move core web_view code to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency of web_view_internal_api.h Created 6 years, 4 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: extensions/browser/guest_view/web_view/web_view_guest_delegate.h
diff --git a/extensions/browser/guest_view/web_view/web_view_guest_delegate.h b/extensions/browser/guest_view/web_view/web_view_guest_delegate.h
index d72ae0ee6f5c4a46975d1cd48fd18b3761e2ca0b..5a5caee5ff2cf0d9405ff8a7991ed1b335a259a5 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest_delegate.h
+++ b/extensions/browser/guest_view/web_view/web_view_guest_delegate.h
@@ -7,6 +7,10 @@
#include "extensions/browser/guest_view/guest_view_base.h"
+namespace blink {
+struct WebFindOptions;
+} // nanespace blink
+
namespace content {
class RenderViewHost;
class WebContents;
@@ -14,23 +18,38 @@ class WebContents;
namespace extensions {
+class WebViewGuest;
+class WebViewInternalFindFunction;
+
namespace api {
namespace web_view_internal{
-
struct ContextMenuItem;
-
} // namespace web_view_internal
} // namespace api
// A delegate class of WebViewGuest that are not a part of chrome.
class WebViewGuestDelegate {
public :
- WebViewGuestDelegate();
+ explicit WebViewGuestDelegate(WebViewGuest* web_view_guest);
virtual ~WebViewGuestDelegate();
typedef std::vector<linked_ptr<api::web_view_internal::ContextMenuItem> >
MenuItemVector;
+ // Begin or continue a find request.
+ virtual void Find(
+ const base::string16& search_text,
+ const blink::WebFindOptions& options,
+ WebViewInternalFindFunction* find_function) = 0;
+
+ // Result of string search in the page.
+ virtual void FindReply(content::WebContents* source,
+ int request_id,
+ int number_of_matches,
+ const gfx::Rect& selection_rect,
+ int active_match_ordinal,
+ bool final_update) = 0;
+
// Returns the current zoom factor.
virtual double GetZoom() = 0;
@@ -40,6 +59,9 @@ class WebViewGuestDelegate {
// Called to attach helpers just after additional initialization is performed.
virtual void OnAttachWebViewHelpers(content::WebContents* contents) = 0;
+ // Called to perform some cleanup prior to destruction.
+ virtual void OnEmbedderDestroyed() = 0;
+
// Called when the guest WebContents commits a provisional load in any frame.
virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) = 0;
@@ -52,6 +74,9 @@ class WebViewGuestDelegate {
// Called immediately after the guest WebContents has been destroyed.
virtual void OnGuestDestroyed() = 0;
+ // Called to cancel all find sessions in progress.
+ virtual void OnRenderProcessGone() = 0;
+
// Called when to set the zoom factor.
virtual void OnSetZoom(double zoom_factor) = 0;
@@ -63,7 +88,14 @@ class WebViewGuestDelegate {
int request_id,
const MenuItemVector* items) = 0;
+ // Conclude a find request to clear highlighting.
+ virtual void StopFinding(content::StopFindAction) = 0;
+
+ WebViewGuest* web_view_guest() const { return web_view_guest_; }
+
private:
+ WebViewGuest* const web_view_guest_;
+
DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698