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 11 matching lines...) Expand all Loading... |
22 // a particular embedder WebContents. This happens on either initial navigation | 22 // 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 | 23 // or through the use of the New Window API, when a new window is attached to |
24 // a particular <webview>. | 24 // a particular <webview>. |
25 class WebViewGuest : public GuestView, | 25 class WebViewGuest : public GuestView, |
26 public content::NotificationObserver, | 26 public content::NotificationObserver, |
27 public content::WebContentsObserver { | 27 public content::WebContentsObserver { |
28 public: | 28 public: |
29 explicit WebViewGuest(content::WebContents* guest_web_contents); | 29 explicit WebViewGuest(content::WebContents* guest_web_contents); |
30 | 30 |
31 static WebViewGuest* From(int embedder_process_id, int instance_id); | 31 static WebViewGuest* From(int embedder_process_id, int instance_id); |
| 32 static WebViewGuest* FromWebContents(content::WebContents* contents); |
32 | 33 |
33 // GuestView implementation. | 34 // GuestView implementation. |
34 virtual void Attach(content::WebContents* embedder_web_contents, | 35 virtual void Attach(content::WebContents* embedder_web_contents, |
35 const std::string& extension_id, | 36 const std::string& extension_id, |
36 const base::DictionaryValue& args) OVERRIDE; | 37 const base::DictionaryValue& args) OVERRIDE; |
37 virtual GuestView::Type GetViewType() const OVERRIDE; | 38 virtual GuestView::Type GetViewType() const OVERRIDE; |
38 virtual WebViewGuest* AsWebView() OVERRIDE; | 39 virtual WebViewGuest* AsWebView() OVERRIDE; |
39 virtual AdViewGuest* AsAdView() OVERRIDE; | 40 virtual AdViewGuest* AsAdView() OVERRIDE; |
40 | 41 |
41 // GuestDelegate implementation. | 42 // GuestDelegate implementation. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 typedef std::map<int, PermissionResponseCallback> RequestMap; | 161 typedef std::map<int, PermissionResponseCallback> RequestMap; |
161 RequestMap pending_permission_requests_; | 162 RequestMap pending_permission_requests_; |
162 | 163 |
163 // True if the user agent is overridden. | 164 // True if the user agent is overridden. |
164 bool is_overriding_user_agent_; | 165 bool is_overriding_user_agent_; |
165 | 166 |
166 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 167 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
167 }; | 168 }; |
168 | 169 |
169 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 170 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
OLD | NEW |