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

Side by Side Diff: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h

Issue 1140173003: Allow whitelisted content scripts to be injected in WebViews. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@document_has_focus
Patch Set: Created 5 years, 7 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ 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_ 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_
7 7
8 #include "chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h" 8 #include "chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h"
9 #include "extensions/browser/guest_view/web_view/web_view_guest.h" 9 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
10 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" 10 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h"
(...skipping 29 matching lines...) Expand all
40 40
41 private: 41 private:
42 content::WebContents* guest_web_contents() const { 42 content::WebContents* guest_web_contents() const {
43 return web_view_guest()->web_contents(); 43 return web_view_guest()->web_contents();
44 } 44 }
45 45
46 // Returns the top level items (ignoring submenus) as Value. 46 // Returns the top level items (ignoring submenus) as Value.
47 static scoped_ptr<base::ListValue> MenuModelToValue( 47 static scoped_ptr<base::ListValue> MenuModelToValue(
48 const ui::SimpleMenuModel& menu_model); 48 const ui::SimpleMenuModel& menu_model);
49 49
50 void InjectChromeVoxIfNeeded(content::RenderViewHost* render_view_host);
51
52 #if defined(OS_CHROMEOS)
53 // Notification of a change in the state of an accessibility setting.
54 void OnAccessibilityStatusChanged(
55 const chromeos::AccessibilityStatusEventDetails& details);
56 #endif
57
58 // A counter to generate a unique request id for a context menu request. 50 // A counter to generate a unique request id for a context menu request.
59 // We only need the ids to be unique for a given WebViewGuest. 51 // We only need the ids to be unique for a given WebViewGuest.
60 int pending_context_menu_request_id_; 52 int pending_context_menu_request_id_;
61 53
62 // Set to |true| if ChromeVox was already injected in main frame.
63 bool chromevox_injected_;
64
65 // Holds the RenderViewContextMenuBase that has been built but yet to be 54 // Holds the RenderViewContextMenuBase that has been built but yet to be
66 // shown. This is .reset() after ShowContextMenu(). 55 // shown. This is .reset() after ShowContextMenu().
67 scoped_ptr<RenderViewContextMenuBase> pending_menu_; 56 scoped_ptr<RenderViewContextMenuBase> pending_menu_;
68 57
69 #if defined(OS_CHROMEOS)
70 // Subscription to receive notifications on changes to a11y settings.
71 scoped_ptr<chromeos::AccessibilityStatusSubscription>
72 accessibility_subscription_;
73 #endif
74
75 WebViewGuest* const web_view_guest_; 58 WebViewGuest* const web_view_guest_;
76 59
77 // This is used to ensure pending tasks will not fire after this object is 60 // This is used to ensure pending tasks will not fire after this object is
78 // destroyed. 61 // destroyed.
79 base::WeakPtrFactory<ChromeWebViewGuestDelegate> weak_ptr_factory_; 62 base::WeakPtrFactory<ChromeWebViewGuestDelegate> weak_ptr_factory_;
80 63
81 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewGuestDelegate); 64 DISALLOW_COPY_AND_ASSIGN(ChromeWebViewGuestDelegate);
82 }; 65 };
83 66
84 } // namespace extensions 67 } // namespace extensions
85 68
86 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_ 69 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CHROME_WEB_VIEW_GUEST_DELEGATE_H_
87
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698