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

Side by Side Diff: chrome/browser/guest_view/web_view/chrome_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: Fix zoom test failure. 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 CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_
6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_
7
8 #include "chrome/browser/guest_view/web_view/web_view_guest.h"
9 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h"
10
11 #if defined(OS_CHROMEOS)
12 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
13 #endif
14
15 class RenderViewContextMenu;
16
17 namespace ui {
18 class SimpleMenuModel;
19 } // namespace ui
20
21 class ChromeWebViewGuestDelegate : public extensions::WebViewGuestDelegate {
22 public :
23 explicit ChromeWebViewGuestDelegate(
24 extensions::WebViewGuest* web_view_guest);
25 virtual ~ChromeWebViewGuestDelegate();
26
27 // WebViewGuestDelegate implementation.
28 virtual double GetZoom() OVERRIDE;
29 virtual void InjectChromeVoxIfNeeded(
30 content::RenderViewHost* render_view_host) OVERRIDE;
31 virtual void OnAttachWebViewHelpers(content::WebContents* contents) OVERRIDE;
32 virtual void OnDidCommitProvisionalLoadForFrame(bool is_main_frame) OVERRIDE;
33 virtual void OnDidInitialize() OVERRIDE;
34 virtual void OnGuestDestroyed() OVERRIDE;
35 virtual extensions::GuestViewBase::Event* OnHandleContextMenu(
36 const content::ContextMenuParams& params) OVERRIDE;
37 virtual extensions::GuestViewBase::Event* OnSetZoom(
38 double zoom_factor,
39 const std::string& old_zoom_factor,
40 const std::string& new_zoom_factor,
41 const std::string& event_zoom_change) OVERRIDE;
42 virtual void OnShowContextMenu(
43 int request_id,
44 const MenuItemVector* items) OVERRIDE;
45 virtual void SetCurrentZoomFactor(double zoom_factor) OVERRIDE;
46
47 private:
48 content::WebContents* guest_web_contents() const {
49 return web_view_guest_->guest_web_contents();
50 }
51
52 // Returns the top level items (ignoring submenus) as Value.
53 static scoped_ptr<base::ListValue> MenuModelToValue(
54 const ui::SimpleMenuModel& menu_model);
55
56 #if defined(OS_CHROMEOS)
57 // Notification of a change in the state of an accessibility setting.
58 void OnAccessibilityStatusChanged(
59 const chromeos::AccessibilityStatusEventDetails& details);
60 #endif
61
62 // A counter to generate a unique request id for a context menu request.
63 // We only need the ids to be unique for a given WebViewGuest.
64 int pending_context_menu_request_id_;
65
66 // Set to |true| if ChromeVox was already injected in main frame.
67 bool chromevox_injected_;
68
69 // Stores the current zoom factor.
70 double current_zoom_factor_;
71
72 // Holds the RenderViewContextMenu that has been built but yet to be
73 // shown. This is .Reset() after ShowContextMenu().
74 scoped_ptr<RenderViewContextMenu> pending_menu_;
75
76 extensions::WebViewGuest* web_view_guest_;
77
78 #if defined(OS_CHROMEOS)
79 // Subscription to receive notifications on changes to a11y settings.
80 scoped_ptr<chromeos::AccessibilityStatusSubscription>
81 accessibility_subscription_;
82 #endif
83
84 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewGuestDelegate);
85 };
86
87 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_
88
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698