| OLD | NEW |
| 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_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 18 matching lines...) Expand all Loading... |
| 29 // API and manages the lifetime of <webview> extension events. WebViewGuest is | 29 // API and manages the lifetime of <webview> extension events. WebViewGuest is |
| 30 // created on attachment. That is, when a guest WebContents is associated with | 30 // created on attachment. That is, when a guest WebContents is associated with |
| 31 // a particular embedder WebContents. This happens on either initial navigation | 31 // a particular embedder WebContents. This happens on either initial navigation |
| 32 // or through the use of the New Window API, when a new window is attached to | 32 // or through the use of the New Window API, when a new window is attached to |
| 33 // a particular <webview>. | 33 // a particular <webview>. |
| 34 class WebViewGuest : public GuestView, | 34 class WebViewGuest : public GuestView, |
| 35 public content::NotificationObserver, | 35 public content::NotificationObserver, |
| 36 public content::WebContentsObserver { | 36 public content::WebContentsObserver { |
| 37 public: | 37 public: |
| 38 WebViewGuest(content::WebContents* guest_web_contents, | 38 WebViewGuest(content::WebContents* guest_web_contents, |
| 39 const std::string& embedder_extension_id); | 39 const std::string& embedder_extension_id, |
| 40 const base::WeakPtr<GuestView>& opener); |
| 40 | 41 |
| 41 static WebViewGuest* From(int embedder_process_id, int instance_id); | 42 static WebViewGuest* From(int embedder_process_id, int instance_id); |
| 42 static WebViewGuest* FromWebContents(content::WebContents* contents); | 43 static WebViewGuest* FromWebContents(content::WebContents* contents); |
| 43 // Returns guestview::kInstanceIDNone if |contents| does not correspond to a | 44 // Returns guestview::kInstanceIDNone if |contents| does not correspond to a |
| 44 // WebViewGuest. | 45 // WebViewGuest. |
| 45 static int GetViewInstanceId(content::WebContents* contents); | 46 static int GetViewInstanceId(content::WebContents* contents); |
| 46 | 47 |
| 47 // GuestView implementation. | 48 // GuestView implementation. |
| 48 virtual void Attach(content::WebContents* embedder_web_contents, | 49 virtual void Attach(content::WebContents* embedder_web_contents, |
| 49 const base::DictionaryValue& args) OVERRIDE; | 50 const base::DictionaryValue& args) OVERRIDE; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 scoped_ptr<chromeos::AccessibilityStatusSubscription> | 319 scoped_ptr<chromeos::AccessibilityStatusSubscription> |
| 319 accessibility_subscription_; | 320 accessibility_subscription_; |
| 320 #endif | 321 #endif |
| 321 | 322 |
| 322 std::map<int, int> bridge_id_to_request_id_map_; | 323 std::map<int, int> bridge_id_to_request_id_map_; |
| 323 | 324 |
| 324 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 325 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
| 325 }; | 326 }; |
| 326 | 327 |
| 327 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ | 328 #endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_ |
| OLD | NEW |