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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const gfx::Size& max_size); | 185 const gfx::Size& max_size); |
186 | 186 |
187 base::WeakPtr<GuestViewBase> AsWeakPtr(); | 187 base::WeakPtr<GuestViewBase> AsWeakPtr(); |
188 | 188 |
189 bool initialized() const { return initialized_; } | 189 bool initialized() const { return initialized_; } |
190 | 190 |
191 content::WebContents* embedder_web_contents() const { | 191 content::WebContents* embedder_web_contents() const { |
192 return embedder_web_contents_; | 192 return embedder_web_contents_; |
193 } | 193 } |
194 | 194 |
195 // Returns the guest WebContents. | |
196 content::WebContents* guest_web_contents() const { | |
197 return web_contents(); | |
198 } | |
199 | |
200 // Returns the parameters associated with the element hosting this GuestView | 195 // Returns the parameters associated with the element hosting this GuestView |
201 // passed in from JavaScript. | 196 // passed in from JavaScript. |
202 base::DictionaryValue* attach_params() const { return attach_params_.get(); } | 197 base::DictionaryValue* attach_params() const { return attach_params_.get(); } |
203 | 198 |
204 // Returns whether this guest has an associated embedder. | 199 // Returns whether this guest has an associated embedder. |
205 bool attached() const { return !!embedder_web_contents_; } | 200 bool attached() const { return !!embedder_web_contents_; } |
206 | 201 |
207 // Returns the instance ID of the <*view> element. | 202 // Returns the instance ID of the <*view> element. |
208 int view_instance_id() const { return view_instance_id_; } | 203 int view_instance_id() const { return view_instance_id_; } |
209 | 204 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // This is used to ensure pending tasks will not fire after this object is | 327 // This is used to ensure pending tasks will not fire after this object is |
333 // destroyed. | 328 // destroyed. |
334 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 329 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
335 | 330 |
336 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 331 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
337 }; | 332 }; |
338 | 333 |
339 } // namespace extensions | 334 } // namespace extensions |
340 | 335 |
341 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 336 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
OLD | NEW |