[ServiceWorker] Implement WebServiceWorkerContextClient::openWindow().
[chromium-blink-merge.git] / extensions / browser / guest_view / web_view / web_view_guest_delegate.h
blob13f5e91628e4401ee6f0cf212b68f755619c0b25
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.
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_
8 #include "extensions/browser/guest_view/guest_view_base.h"
10 namespace content {
11 class RenderViewHost;
12 class WebContents;
13 } // namespace content
15 namespace extensions {
17 class WebViewGuest;
19 namespace api {
20 namespace web_view_internal {
22 struct ContextMenuItem;
23 } // namespace web_view_internal
24 } // namespace api
26 // A delegate class of WebViewGuest that are not a part of chrome.
27 class WebViewGuestDelegate {
28 public :
29 virtual ~WebViewGuestDelegate() {}
31 typedef std::vector<linked_ptr<api::web_view_internal::ContextMenuItem> >
32 MenuItemVector;
34 // Called when context menu operation was handled.
35 virtual bool HandleContextMenu(const content::ContextMenuParams& params) = 0;
37 // Called to attach helpers just after additional initialization is performed.
38 virtual void OnAttachWebViewHelpers(content::WebContents* contents) = 0;
40 // Called when the guest WebContents commits a provisional load in any frame.
41 virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) = 0;
43 // Called just after additional initialization is performed.
44 virtual void OnDidInitialize() = 0;
46 virtual void OnDocumentLoadedInFrame(
47 content::RenderFrameHost* render_frame_host) = 0;
49 // Called immediately after the guest WebContents has been destroyed.
50 virtual void OnGuestDestroyed() = 0;
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;
61 } // namespace extensions
63 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_