blob: 841af0c876ce9b1133f1e6d842df21bcebd00bc8 [file] [log] [blame]
[email protected]945604a2014-04-28 12:29:591// Copyright 2014 The Chromium Authors. All rights reserved.
[email protected]0533cc6d2013-06-27 22:44:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]140d6cd92014-08-12 18:26:465#ifndef EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
6#define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
[email protected]0533cc6d2013-06-27 22:44:057
[email protected]738f57a2013-06-29 21:06:548#include <queue>
9
[email protected]f21d36e2014-01-16 19:24:0410#include "base/memory/weak_ptr.h"
[email protected]0533cc6d2013-06-27 22:44:0511#include "base/values.h"
wjmacleanec6bd522014-12-12 16:17:5012#include "components/ui/zoom/zoom_observer.h"
[email protected]4c0e8272013-07-03 23:39:2213#include "content/public/browser/browser_plugin_guest_delegate.h"
paulmeyer0968abad2015-01-10 00:02:4514#include "content/public/browser/guest_sizer.h"
[email protected]4858e432014-06-23 18:14:1715#include "content/public/browser/render_process_host_observer.h"
[email protected]0533cc6d2013-06-27 22:44:0516#include "content/public/browser/web_contents.h"
[email protected]aec80ed2014-05-27 00:01:1517#include "content/public/browser/web_contents_delegate.h"
[email protected]70ab2642014-05-30 08:06:5818#include "content/public/browser/web_contents_observer.h"
fsamuela95fef42014-12-03 20:16:5219#include "extensions/common/guest_view/guest_view_constants.h"
[email protected]0533cc6d2013-06-27 22:44:0520
[email protected]06153f02013-12-04 03:01:2821struct RendererContentSettingRules;
[email protected]0533cc6d2013-06-27 22:44:0522
[email protected]140d6cd92014-08-12 18:26:4623namespace extensions {
24
paulmeyereb98f9112015-01-23 17:13:3825// A struct of parameters for SetSize(). The parameters are all declared as
26// scoped pointers since they are all optional. Null pointers indicate that the
27// parameter has not been provided, and the last used value should be used. Note
28// that when |enable_auto_size| is true, providing |normal_size| is not
29// meaningful. This is because the normal size of the guestview is overridden
30// whenever autosizing occurs.
31struct SetSizeParams {
32 SetSizeParams();
33 ~SetSizeParams();
34
35 scoped_ptr<bool> enable_auto_size;
36 scoped_ptr<gfx::Size> min_size;
37 scoped_ptr<gfx::Size> max_size;
38 scoped_ptr<gfx::Size> normal_size;
39};
40
[email protected]0e99fdc2014-04-30 05:10:3341// A GuestViewBase is the base class browser-side API implementation for a
42// <*view> tag. GuestViewBase maintains an association between a guest
fsamuelfe20ffac2014-12-02 01:51:2243// WebContents and an owner WebContents. It receives events issued from
44// the guest and relays them to the owner. GuestViewBase tracks the lifetime
45// of its owner. A GuestViewBase's owner is referred to as an embedder if
46// it is attached to a container within the owner's WebContents.
[email protected]aec80ed2014-05-27 00:01:1547class GuestViewBase : public content::BrowserPluginGuestDelegate,
[email protected]70ab2642014-05-30 08:06:5848 public content::WebContentsDelegate,
wjmacleanec6bd522014-12-12 16:17:5049 public content::WebContentsObserver,
50 public ui_zoom::ZoomObserver {
[email protected]0533cc6d2013-06-27 22:44:0551 public:
[email protected]738f57a2013-06-29 21:06:5452 class Event {
53 public:
[email protected]0e99fdc2014-04-30 05:10:3354 Event(const std::string& name, scoped_ptr<base::DictionaryValue> args);
55 ~Event();
[email protected]738f57a2013-06-29 21:06:5456
[email protected]0aad6472013-12-04 18:25:3857 const std::string& name() const { return name_; }
[email protected]738f57a2013-06-29 21:06:5458
[email protected]cb1078de2013-12-23 20:04:2259 scoped_ptr<base::DictionaryValue> GetArguments();
[email protected]738f57a2013-06-29 21:06:5460
61 private:
[email protected]0aad6472013-12-04 18:25:3862 const std::string name_;
[email protected]cb1078de2013-12-23 20:04:2263 scoped_ptr<base::DictionaryValue> args_;
[email protected]738f57a2013-06-29 21:06:5464 };
65
[email protected]0e99fdc2014-04-30 05:10:3366 // Returns a *ViewGuest if this GuestView is of the given view type.
67 template <typename T>
68 T* As() {
[email protected]24569262014-05-06 03:31:3069 if (IsViewType(T::Type))
[email protected]0e99fdc2014-04-30 05:10:3370 return static_cast<T*>(this);
[email protected]24569262014-05-06 03:31:3071
[email protected]0e99fdc2014-04-30 05:10:3372 return NULL;
73 }
[email protected]50c827d2013-09-13 21:36:0974
fsamuel09525e32015-01-21 22:23:3975 using GuestCreationCallback =
76 base::Callback<GuestViewBase*(content::WebContents*, int)>;
[email protected]71c63dc2014-07-21 22:49:5377 static void RegisterGuestViewType(const std::string& view_type,
78 const GuestCreationCallback& callback);
79
fsamuel09525e32015-01-21 22:23:3980 static GuestViewBase* Create(content::WebContents* owner_web_contents,
[email protected]38177c32014-06-25 23:20:2381 int guest_instance_id,
[email protected]50d326e2014-05-20 17:59:0682 const std::string& view_type);
[email protected]738f57a2013-06-29 21:06:5483
[email protected]0e99fdc2014-04-30 05:10:3384 static GuestViewBase* FromWebContents(content::WebContents* web_contents);
[email protected]0533cc6d2013-06-27 22:44:0585
fsamuel4a5c5992015-01-20 19:21:4986 static GuestViewBase* From(int owner_process_id, int instance_id);
[email protected]0533cc6d2013-06-27 22:44:0587
[email protected]a24efc22014-05-26 15:50:2588 static bool IsGuest(content::WebContents* web_contents);
89
[email protected]38fe4372014-05-01 08:38:3290 virtual const char* GetViewType() const = 0;
[email protected]06153f02013-12-04 03:01:2891
[email protected]d84d57b2014-06-20 22:42:3992 // This method is called after the guest has been attached to an embedder and
93 // suspended resource loads have been resumed.
94 //
95 // This method can be overriden by subclasses. This gives the derived class
96 // an opportunity to perform setup actions after attachment.
97 virtual void DidAttachToEmbedder() {}
98
[email protected]4858e432014-06-23 18:14:1799 // This method is called after this GuestViewBase has been initiated.
100 //
101 // This gives the derived class an opportunity to perform additional
102 // initialization.
fsamuel6867dde92015-01-13 02:18:19103 virtual void DidInitialize(const base::DictionaryValue& create_params) {}
[email protected]4858e432014-06-23 18:14:17104
105 // This method is called when the initial set of frames within the page have
106 // completed loading.
[email protected]feaa8cf2014-05-31 03:57:14107 virtual void DidStopLoading() {}
108
guohui02ca72f22014-10-23 16:06:45109 // This method is called before the embedder is destroyed.
fsamuelad4f33f2014-11-28 19:32:21110 // |owner_web_contents_| should still be valid during this call. This
guohui02ca72f22014-10-23 16:06:45111 // allows the derived class to perform some cleanup related to the embedder
112 // web contents.
113 virtual void EmbedderWillBeDestroyed() {}
[email protected]4858e432014-06-23 18:14:17114
115 // This method is called when the guest WebContents has been destroyed. This
116 // object will be destroyed after this call returns.
117 //
118 // This gives the derived class an opportunity to perform some cleanup.
119 virtual void GuestDestroyed() {}
120
[email protected]5ca06862014-08-06 19:09:55121 // This method is invoked when the guest RenderView is ready, e.g. because we
fsamuela8484dd2014-10-02 00:51:33122 // recreated it after a crash or after reattachment.
[email protected]5ca06862014-08-06 19:09:55123 //
124 // This gives the derived class an opportunity to perform some initialization
125 // work.
126 virtual void GuestReady() {}
127
128 // This method is invoked when the contents auto-resized to give the container
129 // an opportunity to match it if it wishes.
130 //
131 // This gives the derived class an opportunity to inform its container element
132 // or perform other actions.
133 virtual void GuestSizeChangedDueToAutoSize(const gfx::Size& old_size,
134 const gfx::Size& new_size) {}
135
136 // This method queries whether autosize is supported for this particular view.
137 // By default, autosize is not supported. Derived classes can override this
138 // behavior to support autosize.
139 virtual bool IsAutoSizeSupported() const;
140
kalmanc2c78842015-01-09 23:57:35141 // This method is invoked when the contents preferred size changes. This will
142 // only ever fire if IsPreferredSizeSupported returns true.
143 virtual void OnPreferredSizeChanged(const gfx::Size& pref_size) {}
144
145 // This method queries whether preferred size events are enabled for this
146 // view. By default, preferred size events are disabled, since they add a
147 // small amount of overhead.
148 virtual bool IsPreferredSizeModeEnabled() const;
149
[email protected]4858e432014-06-23 18:14:17150 // This method queries whether drag-and-drop is enabled for this particular
151 // view. By default, drag-and-drop is disabled. Derived classes can override
152 // this behavior to enable drag-and-drop.
153 virtual bool IsDragAndDropEnabled() const;
154
[email protected]d84d57b2014-06-20 22:42:39155 // This method is called immediately before suspended resource loads have been
156 // resumed on attachment to an embedder.
157 //
158 // This method can be overriden by subclasses. This gives the derived class
159 // an opportunity to perform setup actions before attachment.
160 virtual void WillAttachToEmbedder() {}
161
[email protected]a868c6c2014-06-04 13:07:43162 // This method is called when the guest WebContents is about to be destroyed.
163 //
[email protected]4858e432014-06-23 18:14:17164 // This gives the derived class an opportunity to perform some cleanup prior
165 // to destruction.
[email protected]a868c6c2014-06-04 13:07:43166 virtual void WillDestroy() {}
167
fsamuel67993a92014-12-17 01:33:20168 // This method is to be implemented by the derived class. This indicates
169 // whether zoom should propagate from the embedder to the guest content.
170 virtual bool ZoomPropagatesFromEmbedderToGuest() const;
171
[email protected]755211fe2014-08-08 19:01:49172 // This method is to be implemented by the derived class. Access to guest
173 // views are determined by the availability of the internal extension API
174 // used to implement the guest view.
175 //
176 // This should be the name of the API as it appears in the _api_features.json
177 // file.
fsamuel99492be2014-08-28 03:50:27178 virtual const char* GetAPINamespace() const = 0;
179
180 // This method is to be implemented by the derived class. This method is the
181 // task prefix to show for a task produced by this GuestViewBase's derived
182 // type.
183 virtual int GetTaskPrefix() const = 0;
[email protected]a2be2f112014-07-12 01:10:05184
[email protected]4858e432014-06-23 18:14:17185 // This method is to be implemented by the derived class. Given a set of
186 // initialization parameters, a concrete subclass of GuestViewBase can
187 // create a specialized WebContents that it returns back to GuestViewBase.
fsamuel09525e32015-01-21 22:23:39188 using WebContentsCreatedCallback =
189 base::Callback<void(content::WebContents*)>;
[email protected]4858e432014-06-23 18:14:17190 virtual void CreateWebContents(
[email protected]4858e432014-06-23 18:14:17191 const base::DictionaryValue& create_params,
192 const WebContentsCreatedCallback& callback) = 0;
[email protected]70ab2642014-05-30 08:06:58193
[email protected]4858e432014-06-23 18:14:17194 // This creates a WebContents and initializes |this| GuestViewBase to use the
195 // newly created WebContents.
fsamuel840c1af2014-12-24 01:39:41196 void Init(const base::DictionaryValue& create_params,
[email protected]38177c32014-06-25 23:20:23197 const WebContentsCreatedCallback& callback);
[email protected]a868c6c2014-06-04 13:07:43198
fsamuel6867dde92015-01-13 02:18:19199 void InitWithWebContents(const base::DictionaryValue& create_params,
200 content::WebContents* guest_web_contents);
[email protected]d84d57b2014-06-20 22:42:39201
[email protected]24569262014-05-06 03:31:30202 bool IsViewType(const char* const view_type) const {
203 return !strcmp(GetViewType(), view_type);
204 }
205
paulmeyereb98f9112015-01-23 17:13:38206 // Used to toggle autosize mode for this GuestView, and set both the automatic
207 // and normal sizes.
208 void SetSize(const SetSizeParams& params);
[email protected]5ca06862014-08-06 19:09:55209
[email protected]4858e432014-06-23 18:14:17210 bool initialized() const { return initialized_; }
211
[email protected]0533cc6d2013-06-27 22:44:05212 content::WebContents* embedder_web_contents() const {
fsamuela95fef42014-12-03 20:16:52213 return attached() ? owner_web_contents_ : NULL;
fsamuelad4f33f2014-11-28 19:32:21214 }
215
216 content::WebContents* owner_web_contents() const {
217 return owner_web_contents_;
[email protected]0533cc6d2013-06-27 22:44:05218 }
219
[email protected]2101c4c2014-08-22 00:16:16220 // Returns the parameters associated with the element hosting this GuestView
221 // passed in from JavaScript.
222 base::DictionaryValue* attach_params() const { return attach_params_.get(); }
[email protected]50d326e2014-05-20 17:59:06223
[email protected]738f57a2013-06-29 21:06:54224 // Returns whether this guest has an associated embedder.
fsamuela95fef42014-12-03 20:16:52225 bool attached() const {
226 return element_instance_id_ != guestview::kInstanceIDNone;
227 }
[email protected]738f57a2013-06-29 21:06:54228
[email protected]0533cc6d2013-06-27 22:44:05229 // Returns the instance ID of the <*view> element.
230 int view_instance_id() const { return view_instance_id_; }
231
[email protected]2101c4c2014-08-22 00:16:16232 // Returns the instance ID of this GuestViewBase.
233 int guest_instance_id() const { return guest_instance_id_; }
234
raymes9d460f92014-12-23 04:13:55235 // Returns the instance ID of the GuestViewBase's element.
236 int element_instance_id() const { return element_instance_id_; }
237
[email protected]0533cc6d2013-06-27 22:44:05238 // Returns the extension ID of the embedder.
fsamuelfe20ffac2014-12-02 01:51:22239 const std::string& owner_extension_id() const {
240 return owner_extension_id_;
[email protected]880331f972014-03-05 01:42:53241 }
242
243 // Returns whether this GuestView is embedded in an extension/app.
fsamuelfe20ffac2014-12-02 01:51:22244 bool in_extension() const { return !owner_extension_id_.empty(); }
[email protected]0533cc6d2013-06-27 22:44:05245
fsamuel6867dde92015-01-13 02:18:19246 bool can_owner_receive_events() const { return !!view_instance_id_; }
247
[email protected]0533cc6d2013-06-27 22:44:05248 // Returns the user browser context of the embedder.
249 content::BrowserContext* browser_context() const { return browser_context_; }
250
[email protected]50d326e2014-05-20 17:59:06251 GuestViewBase* GetOpener() const {
252 return opener_.get();
253 }
254
fsamuelfe20ffac2014-12-02 01:51:22255 // Returns the URL of the owner WebContents.
256 const GURL& GetOwnerSiteURL() const;
257
sammce2092512014-11-24 22:18:24258 // Whether the guest view is inside a plugin document.
259 bool is_full_page_plugin() { return is_full_page_plugin_; }
260
fsamuela8484dd2014-10-02 00:51:33261 // Destroy this guest.
262 void Destroy();
263
264 // Saves the attach state of the custom element hosting this GuestView.
[email protected]2101c4c2014-08-22 00:16:16265 void SetAttachParams(const base::DictionaryValue& params);
[email protected]50d326e2014-05-20 17:59:06266 void SetOpener(GuestViewBase* opener);
267
[email protected]aec80ed2014-05-27 00:01:15268 // BrowserPluginGuestDelegate implementation.
fsamuelfa284712015-01-15 01:24:53269 content::WebContents* CreateNewGuestWindow(
270 const content::WebContents::CreateParams& create_params) final;
dcheng9168b2f2014-10-21 12:38:24271 void DidAttach(int guest_proxy_routing_id) final;
fsamuela95fef42014-12-03 20:16:52272 void DidDetach() final;
paulmeyer0968abad2015-01-10 00:02:45273 void ElementSizeChanged(const gfx::Size& size) final;
fsamuel7310a4262014-12-05 05:06:44274 content::WebContents* GetOwnerWebContents() const final;
dcheng9168b2f2014-10-21 12:38:24275 void GuestSizeChanged(const gfx::Size& old_size,
276 const gfx::Size& new_size) final;
277 void RegisterDestructionCallback(const DestructionCallback& callback) final;
paulmeyer0968abad2015-01-10 00:02:45278 void SetGuestSizer(content::GuestSizer* guest_sizer) final;
dcheng9168b2f2014-10-21 12:38:24279 void WillAttach(content::WebContents* embedder_web_contents,
sammce2092512014-11-24 22:18:24280 int browser_plugin_instance_id,
281 bool is_full_page_plugin) final;
[email protected]a868c6c2014-06-04 13:07:43282
wjmacleanec6bd522014-12-12 16:17:50283 // ui_zoom::ZoomObserver implementation.
284 void OnZoomChanged(
285 const ui_zoom::ZoomController::ZoomChangedEventData& data) override;
286
paulmeyer1b61eb242015-01-22 19:13:00287 // Dispatches an event to the guest proxy.
288 void DispatchEventToGuestProxy(Event* event);
289
290 // Dispatches an event to the view.
291 void DispatchEventToView(Event* event);
[email protected]7adb26a72014-07-09 17:44:35292
[email protected]0533cc6d2013-06-27 22:44:05293 protected:
fsamuel09525e32015-01-21 22:23:39294 GuestViewBase(content::WebContents* owner_web_contents,
[email protected]38177c32014-06-25 23:20:23295 int guest_instance_id);
[email protected]d84d57b2014-06-20 22:42:39296
dcheng9168b2f2014-10-21 12:38:24297 ~GuestViewBase() override;
[email protected]0533cc6d2013-06-27 22:44:05298
fsamuel4a1650f2015-01-23 21:57:49299 // WebContentsObserver implementation.
300 void DidStopLoading(content::RenderViewHost* render_view_host) final;
301 void RenderViewReady() final;
302 void WebContentsDestroyed() final;
303
304 // WebContentsDelegate implementation.
305 void ActivateContents(content::WebContents* contents) final;
306 void DeactivateContents(content::WebContents* contents) final;
307 void ContentsZoomChange(bool zoom_in) override;
308 void HandleKeyboardEvent(
309 content::WebContents* source,
310 const content::NativeWebKeyboardEvent& event) override;
311 void RunFileChooser(content::WebContents* web_contents,
312 const content::FileChooserParams& params) override;
313 bool ShouldFocusPageAfterCrash() final;
314 bool PreHandleGestureEvent(content::WebContents* source,
315 const blink::WebGestureEvent& event) final;
316 void UpdatePreferredSize(content::WebContents* web_contents,
317 const gfx::Size& pref_size) final;
318
[email protected]0533cc6d2013-06-27 22:44:05319 private:
fsamuelad4f33f2014-11-28 19:32:21320 class OwnerLifetimeObserver;
[email protected]70ab2642014-05-30 08:06:58321
fsamuel87161f872014-11-07 23:00:36322 class OpenerLifetimeObserver;
323
paulmeyer1b61eb242015-01-22 19:13:00324 void DispatchEvent(Event* event, int instance_id);
325
[email protected]738f57a2013-06-29 21:06:54326 void SendQueuedEvents();
327
fsamuel6867dde92015-01-13 02:18:19328 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params,
329 const WebContentsCreatedCallback& callback,
[email protected]3d888fa2014-07-11 19:27:16330 content::WebContents* guest_web_contents);
[email protected]38177c32014-06-25 23:20:23331
paulmeyer1b61eb242015-01-22 19:13:00332 // Dispatches the onResize event to the embedder.
333 void DispatchOnResizeEvent(const gfx::Size& old_size,
334 const gfx::Size& new_size);
335
paulmeyereb98f9112015-01-23 17:13:38336 void SetUpSizing(const base::DictionaryValue& params);
paulmeyer70fcd542015-01-09 19:26:54337
fsamuel67993a92014-12-17 01:33:20338 void StartTrackingEmbedderZoomLevel();
339 void StopTrackingEmbedderZoomLevel();
wjmacleanec6bd522014-12-12 16:17:50340
[email protected]52263312014-07-22 17:45:13341 static void RegisterGuestViewTypes();
342
fsamuelfe20ffac2014-12-02 01:51:22343 // This guest tracks the lifetime of the WebContents specified by
344 // |owner_web_contents_|. If |owner_web_contents_| is destroyed then this
345 // guest will also self-destruct.
fsamuelad4f33f2014-11-28 19:32:21346 content::WebContents* owner_web_contents_;
fsamuelfe20ffac2014-12-02 01:51:22347 std::string owner_extension_id_;
fsamuel09525e32015-01-21 22:23:39348 content::BrowserContext* const browser_context_;
fsamuel212c6da2014-09-18 16:16:15349
[email protected]0533cc6d2013-06-27 22:44:05350 // |guest_instance_id_| is a profile-wide unique identifier for a guest
351 // WebContents.
352 const int guest_instance_id_;
fsamuel212c6da2014-09-18 16:16:15353
[email protected]0533cc6d2013-06-27 22:44:05354 // |view_instance_id_| is an identifier that's unique within a particular
355 // embedder RenderViewHost for a particular <*view> instance.
[email protected]738f57a2013-06-29 21:06:54356 int view_instance_id_;
357
fsamuelad4f33f2014-11-28 19:32:21358 // |element_instance_id_| is an identifer that's unique to a particular
fsamuel212c6da2014-09-18 16:16:15359 // GuestViewContainer element.
360 int element_instance_id_;
361
fsamuelad4f33f2014-11-28 19:32:21362 // |initialized_| indicates whether GuestViewBase::Init has been called for
363 // this object.
[email protected]d84d57b2014-06-20 22:42:39364 bool initialized_;
365
fsamuel87161f872014-11-07 23:00:36366 // Indicates that this guest is in the process of being destroyed.
367 bool is_being_destroyed_;
368
[email protected]738f57a2013-06-29 21:06:54369 // This is a queue of Events that are destined to be sent to the embedder once
370 // the guest is attached to a particular embedder.
[email protected]0544ea92014-04-22 21:50:47371 std::deque<linked_ptr<Event> > pending_events_;
[email protected]0533cc6d2013-06-27 22:44:05372
[email protected]24569262014-05-06 03:31:30373 // The opener guest view.
374 base::WeakPtr<GuestViewBase> opener_;
375
[email protected]50d326e2014-05-20 17:59:06376 DestructionCallback destruction_callback_;
377
[email protected]2101c4c2014-08-22 00:16:16378 // The parameters associated with the element hosting this GuestView that
379 // are passed in from JavaScript. This will typically be the view instance ID,
380 // and element-specific parameters. These parameters are passed along to new
381 // guests that are created from this guest.
382 scoped_ptr<base::DictionaryValue> attach_params_;
[email protected]50d326e2014-05-20 17:59:06383
fsamuel87161f872014-11-07 23:00:36384 // This observer ensures that this guest self-destructs if the embedder goes
385 // away.
fsamuelad4f33f2014-11-28 19:32:21386 scoped_ptr<OwnerLifetimeObserver> owner_lifetime_observer_;
fsamuel87161f872014-11-07 23:00:36387
388 // This observer ensures that if the guest is unattached and its opener goes
389 // away then this guest also self-destructs.
390 scoped_ptr<OpenerLifetimeObserver> opener_lifetime_observer_;
[email protected]70ab2642014-05-30 08:06:58391
[email protected]5ca06862014-08-06 19:09:55392 // The size of the guest content. Note: In autosize mode, the container
393 // element may not match the size of the guest.
394 gfx::Size guest_size_;
395
paulmeyer0968abad2015-01-10 00:02:45396 // A pointer to the guest_sizer.
397 content::GuestSizer* guest_sizer_;
398
[email protected]5ca06862014-08-06 19:09:55399 // Indicates whether autosize mode is enabled or not.
400 bool auto_size_enabled_;
401
402 // The maximum size constraints of the container element in autosize mode.
403 gfx::Size max_auto_size_;
404
405 // The minimum size constraints of the container element in autosize mode.
406 gfx::Size min_auto_size_;
407
paulmeyereb98f9112015-01-23 17:13:38408 // The size that will be used when autosize mode is disabled.
409 gfx::Size normal_size_;
410
sammce2092512014-11-24 22:18:24411 // Whether the guest view is inside a plugin document.
412 bool is_full_page_plugin_;
413
[email protected]f21d36e2014-01-16 19:24:04414 // This is used to ensure pending tasks will not fire after this object is
415 // destroyed.
[email protected]0e99fdc2014-04-30 05:10:33416 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_;
[email protected]f21d36e2014-01-16 19:24:04417
[email protected]0e99fdc2014-04-30 05:10:33418 DISALLOW_COPY_AND_ASSIGN(GuestViewBase);
[email protected]0533cc6d2013-06-27 22:44:05419};
420
[email protected]140d6cd92014-08-12 18:26:46421} // namespace extensions
422
423#endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_