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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_
7
8 #include "extensions/browser/guest_view/guest_view_base.h"
9
10 namespace content {
11 class RenderViewHost;
12 class WebContents;
13 }
14
15 namespace extensions {
16
17 namespace api {
18 namespace web_view_internal{
19
20 struct ContextMenuItem;
21
22 } // namespace web_view_internal
23 } // namespace api
24
25 // A delegate class of WebViewGuest that are not a part of chrome.
26 class WebViewGuestDelegate {
27 public :
28 WebViewGuestDelegate();
29 virtual ~WebViewGuestDelegate();
30
31 typedef std::vector<linked_ptr<api::web_view_internal::ContextMenuItem> >
32 MenuItemVector;
33
34 // Returns the current zoom factor.
35 virtual double GetZoom() = 0;
36
37 // Called when context menu operation was handled.
38 virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0;
39
40 // Called to attach helpers just after additional initialization is performed.
41 virtual void OnAttachWebViewHelpers(content::WebContents* contents) = 0;
42
43 // Called when the guest WebContents commits a provisional load in any frame.
44 virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) = 0;
45
46 // Called just after additional initialization is performed.
47 virtual void OnDidInitialize() = 0;
48
49 virtual void OnDocumentLoadedInFrame(
50 content::RenderFrameHost* render_frame_host) = 0;
51
52 // Called immediately after the guest WebContents has been destroyed.
53 virtual void OnGuestDestroyed() = 0;
54
55 // Called when to set the zoom factor.
56 virtual void OnSetZoom(double zoom_factor) = 0;
57
58 // Shows the context menu for the guest.
59 // |items| acts as a filter. This restricts the current context's default
60 // menu items to contain only the items from |items|.
61 // |items| == NULL means no filtering will be applied.
62 virtual void OnShowContextMenu(
63 int request_id,
64 const MenuItemVector* items) = 0;
65
66 private:
67 DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate);
68 };
69
70 } // namespace extensions
71
72 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_
OLDNEW
« 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