Chromium Code Reviews| Index: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h |
| diff --git a/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a1d344aaf6d2479391f229a2c1192a3bd74d3afb |
| --- /dev/null |
| +++ b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h |
| @@ -0,0 +1,83 @@ |
| +// 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 CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ |
| +#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ |
| + |
| +#include "chrome/browser/guest_view/web_view/web_view_guest.h" |
| +#include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" |
| + |
| +#if defined(OS_CHROMEOS) |
| +#include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| +#endif |
| + |
| +class RenderViewContextMenu; |
| + |
| +namespace ui { |
| +class SimpleMenuModel; |
| +} // namespace ui |
| + |
| +class ChromeWebViewGuestDelegate : public extensions::WebViewGuestDelegate { |
| + public : |
| + explicit ChromeWebViewGuestDelegate( |
| + const extensions::WebViewGuest& web_view_guest); |
|
Fady Samuel
2014/08/18 20:11:22
I feel like this should be a pointer to allow for
Xi Han
2014/08/18 22:23:57
Done.
|
| + virtual ~ChromeWebViewGuestDelegate(); |
| + |
| + // WebViewGuestDelegate implementation. |
| + virtual void OnDidInitialize() OVERRIDE; |
|
Fady Samuel
2014/08/18 20:11:22
Huge nitpick: Could we please put this in alphabet
Xi Han
2014/08/18 22:23:57
Done.
|
| + virtual void OnAttachWebViewHelpers(content::WebContents* contents) OVERRIDE; |
| + virtual extensions::GuestViewBase::Event* OnHandleContextMenu( |
| + const content::ContextMenuParams& params) OVERRIDE; |
| + virtual double GetZoomLevel() OVERRIDE; |
| + virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) OVERRIDE; |
| + virtual void OnSetZoom(double zoom_factor) OVERRIDE; |
| + virtual void OnShowContextMenu( |
| + int request_id, |
| + const MenuItemVector* items) OVERRIDE; |
| + virtual void OnGuestDestroyed() OVERRIDE; |
| + virtual void InjectChromeVoxIfNeeded( |
| + content::RenderViewHost* render_view_host) OVERRIDE; |
| + |
| + private: |
| + content::WebContents* guest_web_contents() const { |
| + return web_view_guest_.guest_web_contents(); |
| + } |
| + |
| + // Returns the top level items (ignoring submenus) as Value. |
| + static scoped_ptr<base::ListValue> MenuModelToValue( |
| + const ui::SimpleMenuModel& menu_model); |
| + |
| +#if defined(OS_CHROMEOS) |
| + // Notification of a change in the state of an accessibility setting. |
| + void OnAccessibilityStatusChanged( |
| + const chromeos::AccessibilityStatusEventDetails& details); |
| +#endif |
| + |
| + // A counter to generate a unique request id for a context menu request. |
| + // We only need the ids to be unique for a given WebViewGuest. |
| + int pending_context_menu_request_id_; |
| + |
| + // Set to |true| if ChromeVox was already injected in main frame. |
| + bool chromevox_injected_; |
| + |
| + // Stores the current zoom factor. |
| + double current_zoom_factor_; |
| + |
| + // Holds the RenderViewContextMenu that has been built but yet to be |
| + // shown. This is .Reset() after ShowContextMenu(). |
| + scoped_ptr<RenderViewContextMenu> pending_menu_; |
| + |
| + const extensions::WebViewGuest& web_view_guest_; |
| + |
| +#if defined(OS_CHROMEOS) |
| + // Subscription to receive notifications on changes to a11y settings. |
| + scoped_ptr<chromeos::AccessibilityStatusSubscription> |
| + accessibility_subscription_; |
| +#endif |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ChromeWebViewGuestDelegate); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ |
| + |