| 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_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 6 #define CHROME_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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // This method can be overriden by subclasses. This gives the derived class | 109 // This method can be overriden by subclasses. This gives the derived class |
| 110 // an opportunity to perform setup actions before attachment. | 110 // an opportunity to perform setup actions before attachment. |
| 111 virtual void WillAttachToEmbedder() {} | 111 virtual void WillAttachToEmbedder() {} |
| 112 | 112 |
| 113 // This method is called when the guest WebContents is about to be destroyed. | 113 // This method is called when the guest WebContents is about to be destroyed. |
| 114 // | 114 // |
| 115 // This gives the derived class an opportunity to perform some cleanup prior | 115 // This gives the derived class an opportunity to perform some cleanup prior |
| 116 // to destruction. | 116 // to destruction. |
| 117 virtual void WillDestroy() {} | 117 virtual void WillDestroy() {} |
| 118 | 118 |
| 119 // This method is to be implemented by the derived class. It determines |
| 120 // whether the guest view type of the derived class can be used by the |
| 121 // provided embedder extension ID. |
| 122 virtual bool CanEmbedderUseGuestView( |
| 123 const std::string& embedder_extension_id) = 0; |
| 124 |
| 119 // This method is to be implemented by the derived class. Given a set of | 125 // This method is to be implemented by the derived class. Given a set of |
| 120 // initialization parameters, a concrete subclass of GuestViewBase can | 126 // initialization parameters, a concrete subclass of GuestViewBase can |
| 121 // create a specialized WebContents that it returns back to GuestViewBase. | 127 // create a specialized WebContents that it returns back to GuestViewBase. |
| 122 typedef base::Callback<void(content::WebContents*)> | 128 typedef base::Callback<void(content::WebContents*)> |
| 123 WebContentsCreatedCallback; | 129 WebContentsCreatedCallback; |
| 124 virtual void CreateWebContents( | 130 virtual void CreateWebContents( |
| 125 const std::string& embedder_extension_id, | 131 const std::string& embedder_extension_id, |
| 126 int embedder_render_process_id, | 132 int embedder_render_process_id, |
| 127 const base::DictionaryValue& create_params, | 133 const base::DictionaryValue& create_params, |
| 128 const WebContentsCreatedCallback& callback) = 0; | 134 const WebContentsCreatedCallback& callback) = 0; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; | 271 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; |
| 266 | 272 |
| 267 // This is used to ensure pending tasks will not fire after this object is | 273 // This is used to ensure pending tasks will not fire after this object is |
| 268 // destroyed. | 274 // destroyed. |
| 269 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 275 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 270 | 276 |
| 271 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 277 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 272 }; | 278 }; |
| 273 | 279 |
| 274 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 280 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| OLD | NEW |