| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // This gives the derived class an opportunity to perform some cleanup prior | 138 // This gives the derived class an opportunity to perform some cleanup prior |
| 139 // to destruction. | 139 // to destruction. |
| 140 virtual void WillDestroy() {} | 140 virtual void WillDestroy() {} |
| 141 | 141 |
| 142 // This method is to be implemented by the derived class. Access to guest | 142 // This method is to be implemented by the derived class. Access to guest |
| 143 // views are determined by the availability of the internal extension API | 143 // views are determined by the availability of the internal extension API |
| 144 // used to implement the guest view. | 144 // used to implement the guest view. |
| 145 // | 145 // |
| 146 // This should be the name of the API as it appears in the _api_features.json | 146 // This should be the name of the API as it appears in the _api_features.json |
| 147 // file. | 147 // file. |
| 148 virtual const char* GetAPINamespace() = 0; | 148 virtual const char* GetAPINamespace() const = 0; |
| 149 |
| 150 // This method is to be implemented by the derived class. This method is the |
| 151 // task name to show for a task produced by this GuestViewBase's derived type. |
| 152 virtual base::string16 GetTaskName() const; |
| 149 | 153 |
| 150 // This method is to be implemented by the derived class. Given a set of | 154 // This method is to be implemented by the derived class. Given a set of |
| 151 // initialization parameters, a concrete subclass of GuestViewBase can | 155 // initialization parameters, a concrete subclass of GuestViewBase can |
| 152 // create a specialized WebContents that it returns back to GuestViewBase. | 156 // create a specialized WebContents that it returns back to GuestViewBase. |
| 153 typedef base::Callback<void(content::WebContents*)> | 157 typedef base::Callback<void(content::WebContents*)> |
| 154 WebContentsCreatedCallback; | 158 WebContentsCreatedCallback; |
| 155 virtual void CreateWebContents( | 159 virtual void CreateWebContents( |
| 156 const std::string& embedder_extension_id, | 160 const std::string& embedder_extension_id, |
| 157 int embedder_render_process_id, | 161 int embedder_render_process_id, |
| 158 const base::DictionaryValue& create_params, | 162 const base::DictionaryValue& create_params, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // This is used to ensure pending tasks will not fire after this object is | 331 // This is used to ensure pending tasks will not fire after this object is |
| 328 // destroyed. | 332 // destroyed. |
| 329 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 333 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 330 | 334 |
| 331 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 335 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 332 }; | 336 }; |
| 333 | 337 |
| 334 } // namespace extensions | 338 } // namespace extensions |
| 335 | 339 |
| 336 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 340 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| OLD | NEW |