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" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // a particular <webview>. | 31 // a particular <webview>. |
32 class WebViewGuest : public GuestView, | 32 class WebViewGuest : public GuestView, |
33 public content::NotificationObserver, | 33 public content::NotificationObserver, |
34 public content::WebContentsObserver { | 34 public content::WebContentsObserver { |
35 public: | 35 public: |
36 WebViewGuest(content::WebContents* guest_web_contents, | 36 WebViewGuest(content::WebContents* guest_web_contents, |
37 const std::string& extension_id); | 37 const std::string& extension_id); |
38 | 38 |
39 static WebViewGuest* From(int embedder_process_id, int instance_id); | 39 static WebViewGuest* From(int embedder_process_id, int instance_id); |
40 static WebViewGuest* FromWebContents(content::WebContents* contents); | 40 static WebViewGuest* FromWebContents(content::WebContents* contents); |
| 41 // Returns 0 if |contents| does not correspond to a WebViewGuest. |
| 42 static int GetViewInstanceId(content::WebContents* contents); |
41 | 43 |
42 // GuestView implementation. | 44 // GuestView implementation. |
43 virtual void Attach(content::WebContents* embedder_web_contents, | 45 virtual void Attach(content::WebContents* embedder_web_contents, |
44 const base::DictionaryValue& args) OVERRIDE; | 46 const base::DictionaryValue& args) OVERRIDE; |
45 virtual GuestView::Type GetViewType() const OVERRIDE; | 47 virtual GuestView::Type GetViewType() const OVERRIDE; |
46 virtual WebViewGuest* AsWebView() OVERRIDE; | 48 virtual WebViewGuest* AsWebView() OVERRIDE; |
47 virtual AdViewGuest* AsAdView() OVERRIDE; | 49 virtual AdViewGuest* AsAdView() OVERRIDE; |
48 | 50 |
49 // GuestDelegate implementation. | 51 // GuestDelegate implementation. |
50 virtual void AddMessageToConsole(int32 level, | 52 virtual void AddMessageToConsole(int32 level, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 #if defined(OS_CHROMEOS) | 256 #if defined(OS_CHROMEOS) |
255 // Subscription to receive notifications on changes to a11y settings. | 257 // Subscription to receive notifications on changes to a11y settings. |
256 scoped_ptr<chromeos::AccessibilityStatusSubscription> | 258 scoped_ptr<chromeos::AccessibilityStatusSubscription> |
257 accessibility_subscription_; | 259 accessibility_subscription_; |
258 #endif | 260 #endif |
259 | 261 |
260 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 262 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
261 }; | 263 }; |
262 | 264 |
263 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 265 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
OLD | NEW |