OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 5 #ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
6 #define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 6 #define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
7 | 7 |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "chrome/browser/extensions/tab_helper.h" | 9 #include "chrome/browser/extensions/tab_helper.h" |
10 #include "chrome/browser/guestview/guestview.h" | 10 #include "chrome/browser/guestview/guestview.h" |
11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
13 | 13 |
| 14 #if defined(OS_CHROMEOS) |
| 15 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 16 #endif |
| 17 |
14 namespace extensions { | 18 namespace extensions { |
15 class ScriptExecutor; | 19 class ScriptExecutor; |
16 } // namespace extensions | 20 } // namespace extensions |
17 | 21 |
18 // A WebViewGuest is a WebContentsObserver on the guest WebContents of a | 22 // A WebViewGuest is a WebContentsObserver on the guest WebContents of a |
19 // <webview> tag. It provides the browser-side implementation of the <webview> | 23 // <webview> tag. It provides the browser-side implementation of the <webview> |
20 // API and manages the lifetime of <webview> extension events. WebViewGuest is | 24 // API and manages the lifetime of <webview> extension events. WebViewGuest is |
21 // created on attachment. That is, when a guest WebContents is associated with | 25 // created on attachment. That is, when a guest WebContents is associated with |
22 // a particular embedder WebContents. This happens on either initial navigation | 26 // a particular embedder WebContents. This happens on either initial navigation |
23 // or through the use of the New Window API, when a new window is attached to | 27 // or through the use of the New Window API, when a new window is attached to |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 185 |
182 // Called when a redirect notification occurs. | 186 // Called when a redirect notification occurs. |
183 void LoadRedirect(const GURL& old_url, | 187 void LoadRedirect(const GURL& old_url, |
184 const GURL& new_url, | 188 const GURL& new_url, |
185 bool is_top_level); | 189 bool is_top_level); |
186 | 190 |
187 void AddWebViewToExtensionRendererState(); | 191 void AddWebViewToExtensionRendererState(); |
188 static void RemoveWebViewFromExtensionRendererState( | 192 static void RemoveWebViewFromExtensionRendererState( |
189 content::WebContents* web_contents); | 193 content::WebContents* web_contents); |
190 | 194 |
| 195 #if defined(OS_CHROMEOS) |
| 196 // Notification of a change in the state of an accessibility setting. |
| 197 void OnAccessibilityStatusChanged( |
| 198 const chromeos::AccessibilityStatusEventDetails& details); |
| 199 #endif |
| 200 |
191 void InjectChromeVoxIfNeeded(content::RenderViewHost* render_view_host); | 201 void InjectChromeVoxIfNeeded(content::RenderViewHost* render_view_host); |
192 | 202 |
193 ObserverList<extensions::TabHelper::ScriptExecutionObserver> | 203 ObserverList<extensions::TabHelper::ScriptExecutionObserver> |
194 script_observers_; | 204 script_observers_; |
195 scoped_ptr<extensions::ScriptExecutor> script_executor_; | 205 scoped_ptr<extensions::ScriptExecutor> script_executor_; |
196 | 206 |
197 content::NotificationRegistrar notification_registrar_; | 207 content::NotificationRegistrar notification_registrar_; |
198 | 208 |
199 // A counter to generate a unique request id for a permission request. | 209 // A counter to generate a unique request id for a permission request. |
200 // We only need the ids to be unique for a given WebViewGuest. | 210 // We only need the ids to be unique for a given WebViewGuest. |
(...skipping 11 matching lines...) Expand all Loading... |
212 | 222 |
213 // Main frame ID of last committed page. | 223 // Main frame ID of last committed page. |
214 int64 main_frame_id_; | 224 int64 main_frame_id_; |
215 | 225 |
216 // Set to |true| if ChromeVox was already injected in main frame. | 226 // Set to |true| if ChromeVox was already injected in main frame. |
217 bool chromevox_injected_; | 227 bool chromevox_injected_; |
218 | 228 |
219 // Stores the current zoom factor. | 229 // Stores the current zoom factor. |
220 double current_zoom_factor_; | 230 double current_zoom_factor_; |
221 | 231 |
| 232 #if defined(OS_CHROMEOS) |
| 233 // Subscription to receive notifications on changes to a11y settings. |
| 234 scoped_ptr<chromeos::AccessibilityStatusSubscription> |
| 235 accessibility_subscription_; |
| 236 #endif |
| 237 |
222 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 238 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
223 }; | 239 }; |
224 | 240 |
225 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 241 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
OLD | NEW |