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

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: Make methods in WebViewGuestDelegate as pure virtual. 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 "chrome/common/extensions/api/web_view_internal.h"
9 #include "extensions/browser/guest_view/guest_view_base.h"
10
11 namespace content {
12 class RenderViewHost;
13 class WebContents;
14 }
15
16 namespace extensions {
17
18 namespace webview_api = api::web_view_internal;
19
20 // A delegate class of WebViewGuest that are not a part of chrome.
21 class WebViewGuestDelegate {
22 public :
23 WebViewGuestDelegate();
24 virtual ~WebViewGuestDelegate();
25
26 typedef std::vector<linked_ptr<webview_api::ContextMenuItem> > MenuItemVector;
27
28 // Returns the current zoom factor.
29 virtual double GetZoom() = 0;
30
31 // Called when context menu operation was handled.
32 virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0;
33
34 virtual void InjectChromeVoxIfNeeded(
35 content::RenderViewHost* render_view_host) = 0;
36
37 // Called to attach helpers just after additional initialization is performed.
38 virtual void OnAttachWebViewHelpers(content::WebContents* contents) = 0;
39
40 // Called when the guest WebContents commits a provisional load in any frame.
41 virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) = 0;
42
43 // Called just after additional initialization is performed.
44 virtual void OnDidInitialize() = 0;
45
46 // Called immediately after the guest WebContents has been destroyed.
47 virtual void OnGuestDestroyed() = 0;
48
49 // Called when to set the zoom factor.
50 virtual void OnSetZoom(double zoom_factor) = 0;
51
52 // Shows the context menu for the guest.
53 // |items| acts as a filter. This restricts the current context's default
54 // menu items to contain only the items from |items|.
55 // |items| == NULL means no filtering will be applied.
56 virtual void OnShowContextMenu(
57 int request_id,
58 const MenuItemVector* items) = 0;
59
60 private:
61 DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate);
62 };
63
64 } // namespace extensions
65
66 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698