Chromium Code Reviews| 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..6f1a3e80fb3b41e49e038d981248472dfd67324b |
| --- /dev/null |
| +++ b/extensions/browser/guest_view/web_view/web_view_guest_delegate.h |
| @@ -0,0 +1,67 @@ |
| +// 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 "chrome/common/extensions/api/web_view_internal.h" |
| +#include "extensions/browser/guest_view/guest_view_base.h" |
| + |
| +namespace content { |
| +class RenderViewHost; |
| +class WebContents; |
| +} |
| + |
| +namespace extensions { |
| + |
| +namespace webview_api = api::web_view_internal; |
| + |
| +// A delegate class of WebViewGuest that are not a part of chrome. |
| +class WebViewGuestDelegate { |
| + public : |
| + explicit WebViewGuestDelegate(); |
|
Fady Samuel
2014/08/18 20:11:22
Doesn't need to be explicit.
Xi Han
2014/08/18 22:23:57
Done.
|
| + virtual ~WebViewGuestDelegate(); |
| + |
| + typedef std::vector<linked_ptr<webview_api::ContextMenuItem> > MenuItemVector; |
| + |
| + // Called just after additional initialization is performed. |
| + virtual void OnDidInitialize() {} |
| + |
| + // Called to attach helpers just after additional initialization is performed. |
| + virtual void OnAttachWebViewHelpers(content::WebContents* contents) {} |
| + |
| + // Return a new event if the context menu operation was handled. |
| + virtual extensions::GuestViewBase::Event* OnHandleContextMenu( |
| + const content::ContextMenuParams& params); |
| + |
| + // Return zoom level. |
| + virtual double GetZoomLevel(); |
|
Fady Samuel
2014/08/18 20:11:22
Can we get rid of this?
Xi Han
2014/08/18 22:23:57
Done.
|
| + |
| + // Called when the guest WebContents commits a provisional load in any frame. |
| + virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) {} |
| + |
| + // Called when to set the zoom factor. |
| + virtual void OnSetZoom(double zoom_factor) {} |
| + |
| + // 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) {} |
| + |
| + // Called immediately after the guest WebContents has been destroyed. |
| + virtual void OnGuestDestroyed() {} |
| + |
| + virtual void InjectChromeVoxIfNeeded( |
| + content::RenderViewHost* render_view_host) {} |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_DELEGATE_H_ |