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

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

Issue 481003002: Introduce WebViewGuestDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2_extensions_render_frame_observer
Patch Set: Remove include of web_view_internal.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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | extensions/browser/guest_view/web_view/web_view_guest_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..d72ae0ee6f5c4a46975d1cd48fd18b3761e2ca0b
--- /dev/null
+++ b/extensions/browser/guest_view/web_view/web_view_guest_delegate.h
@@ -0,0 +1,72 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_
+#define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_
+
+#include "extensions/browser/guest_view/guest_view_base.h"
+
+namespace content {
+class RenderViewHost;
+class WebContents;
+}
+
+namespace extensions {
+
+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();
+ virtual ~WebViewGuestDelegate();
+
+ typedef std::vector<linked_ptr<api::web_view_internal::ContextMenuItem> >
+ MenuItemVector;
+
+ // Returns the current zoom factor.
+ virtual double GetZoom() = 0;
+
+ // Called when context menu operation was handled.
+ virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0;
+
+ // Called to attach helpers just after additional initialization is performed.
+ virtual void OnAttachWebViewHelpers(content::WebContents* contents) = 0;
+
+ // Called when the guest WebContents commits a provisional load in any frame.
+ virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) = 0;
+
+ // Called just after additional initialization is performed.
+ virtual void OnDidInitialize() = 0;
+
+ virtual void OnDocumentLoadedInFrame(
+ content::RenderFrameHost* render_frame_host) = 0;
+
+ // Called immediately after the guest WebContents has been destroyed.
+ virtual void OnGuestDestroyed() = 0;
+
+ // Called when to set the zoom factor.
+ virtual void OnSetZoom(double zoom_factor) = 0;
+
+ // Shows the context menu for the guest.
+ // |items| acts as a filter. This restricts the current context's default
+ // menu items to contain only the items from |items|.
+ // |items| == NULL means no filtering will be applied.
+ virtual void OnShowContextMenu(
+ int request_id,
+ const MenuItemVector* items) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | extensions/browser/guest_view/web_view/web_view_guest_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698