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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 bool attached() const { | 200 bool attached() const { |
201 return element_instance_id_ != guestview::kInstanceIDNone; | 201 return element_instance_id_ != guestview::kInstanceIDNone; |
202 } | 202 } |
203 | 203 |
204 // Returns the instance ID of the <*view> element. | 204 // Returns the instance ID of the <*view> element. |
205 int view_instance_id() const { return view_instance_id_; } | 205 int view_instance_id() const { return view_instance_id_; } |
206 | 206 |
207 // Returns the instance ID of this GuestViewBase. | 207 // Returns the instance ID of this GuestViewBase. |
208 int guest_instance_id() const { return guest_instance_id_; } | 208 int guest_instance_id() const { return guest_instance_id_; } |
209 | 209 |
| 210 // Returns the instance ID of the GuestViewBase's element. |
| 211 int element_instance_id() const { return element_instance_id_; } |
| 212 |
210 // Returns the extension ID of the embedder. | 213 // Returns the extension ID of the embedder. |
211 const std::string& owner_extension_id() const { | 214 const std::string& owner_extension_id() const { |
212 return owner_extension_id_; | 215 return owner_extension_id_; |
213 } | 216 } |
214 | 217 |
215 // Returns whether this GuestView is embedded in an extension/app. | 218 // Returns whether this GuestView is embedded in an extension/app. |
216 bool in_extension() const { return !owner_extension_id_.empty(); } | 219 bool in_extension() const { return !owner_extension_id_.empty(); } |
217 | 220 |
218 // Returns the user browser context of the embedder. | 221 // Returns the user browser context of the embedder. |
219 content::BrowserContext* browser_context() const { return browser_context_; } | 222 content::BrowserContext* browser_context() const { return browser_context_; } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 // This is used to ensure pending tasks will not fire after this object is | 369 // This is used to ensure pending tasks will not fire after this object is |
367 // destroyed. | 370 // destroyed. |
368 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 371 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
369 | 372 |
370 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 373 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
371 }; | 374 }; |
372 | 375 |
373 } // namespace extensions | 376 } // namespace extensions |
374 | 377 |
375 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 378 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
OLD | NEW |