| 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 EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 virtual int GetTaskPrefix() const = 0; | 153 virtual int GetTaskPrefix() const = 0; |
| 154 | 154 |
| 155 // This method is to be implemented by the derived class. Given a set of | 155 // This method is to be implemented by the derived class. Given a set of |
| 156 // initialization parameters, a concrete subclass of GuestViewBase can | 156 // initialization parameters, a concrete subclass of GuestViewBase can |
| 157 // create a specialized WebContents that it returns back to GuestViewBase. | 157 // create a specialized WebContents that it returns back to GuestViewBase. |
| 158 typedef base::Callback<void(content::WebContents*)> | 158 typedef base::Callback<void(content::WebContents*)> |
| 159 WebContentsCreatedCallback; | 159 WebContentsCreatedCallback; |
| 160 virtual void CreateWebContents( | 160 virtual void CreateWebContents( |
| 161 const std::string& embedder_extension_id, | 161 const std::string& embedder_extension_id, |
| 162 int embedder_render_process_id, | 162 int embedder_render_process_id, |
| 163 const GURL& embedder_site_url, |
| 163 const base::DictionaryValue& create_params, | 164 const base::DictionaryValue& create_params, |
| 164 const WebContentsCreatedCallback& callback) = 0; | 165 const WebContentsCreatedCallback& callback) = 0; |
| 165 | 166 |
| 166 // This creates a WebContents and initializes |this| GuestViewBase to use the | 167 // This creates a WebContents and initializes |this| GuestViewBase to use the |
| 167 // newly created WebContents. | 168 // newly created WebContents. |
| 168 void Init(const std::string& embedder_extension_id, | 169 void Init(const std::string& embedder_extension_id, |
| 169 content::WebContents* embedder_web_contents, | 170 content::WebContents* embedder_web_contents, |
| 170 const base::DictionaryValue& create_params, | 171 const base::DictionaryValue& create_params, |
| 171 const WebContentsCreatedCallback& callback); | 172 const WebContentsCreatedCallback& callback); |
| 172 | 173 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // This is used to ensure pending tasks will not fire after this object is | 334 // This is used to ensure pending tasks will not fire after this object is |
| 334 // destroyed. | 335 // destroyed. |
| 335 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 336 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 336 | 337 |
| 337 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 338 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 338 }; | 339 }; |
| 339 | 340 |
| 340 } // namespace extensions | 341 } // namespace extensions |
| 341 | 342 |
| 342 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 343 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| OLD | NEW |