blob: 482ad9a3f8519e553d2962c2b1ef003c4c14a911 [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 =
fsamuelc75dc1d2015-01-27 06:22:1576 base::Callback<GuestViewBase*(content::WebContents*)>;
[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]50d326e2014-05-20 17:59:0681 const std::string& view_type);
[email protected]738f57a2013-06-29 21:06:5482
[email protected]0e99fdc2014-04-30 05:10:3383 static GuestViewBase* FromWebContents(content::WebContents* web_contents);
[email protected]0533cc6d2013-06-27 22:44:0584
fsamuel4a5c5992015-01-20 19:21:4985 static GuestViewBase* From(int owner_process_id, int instance_id);
[email protected]0533cc6d2013-06-27 22:44:0586
[email protected]a24efc22014-05-26 15:50:2587 static bool IsGuest(content::WebContents* web_contents);
88
[email protected]38fe4372014-05-01 08:38:3289 virtual const char* GetViewType() const = 0;
[email protected]06153f02013-12-04 03:01:2890
[email protected]d84d57b2014-06-20 22:42:3991 // This method is called after the guest has been attached to an embedder and
92 // suspended resource loads have been resumed.
93 //
94 // This method can be overriden by subclasses. This gives the derived class
95 // an opportunity to perform setup actions after attachment.
96 virtual void DidAttachToEmbedder() {}
97
[email protected]4858e432014-06-23 18:14:1798 // This method is called after this GuestViewBase has been initiated.
99 //
100 // This gives the derived class an opportunity to perform additional
101 // initialization.
fsamuel6867dde92015-01-13 02:18:19102 virtual void DidInitialize(const base::DictionaryValue& create_params) {}
[email protected]4858e432014-06-23 18:14:17103
104 // This method is called when the initial set of frames within the page have
105 // completed loading.
[email protected]feaa8cf2014-05-31 03:57:14106 virtual void DidStopLoading() {}
107
guohui02ca72f22014-10-23 16:06:45108 // This method is called before the embedder is destroyed.
fsamuelad4f33f2014-11-28 19:32:21109 // |owner_web_contents_| should still be valid during this call. This
guohui02ca72f22014-10-23 16:06:45110 // allows the derived class to perform some cleanup related to the embedder
111 // web contents.
112 virtual void EmbedderWillBeDestroyed() {}
[email protected]4858e432014-06-23 18:14:17113
114 // This method is called when the guest WebContents has been destroyed. This
115 // object will be destroyed after this call returns.
116 //
117 // This gives the derived class an opportunity to perform some cleanup.
118 virtual void GuestDestroyed() {}
119
[email protected]5ca06862014-08-06 19:09:55120 // This method is invoked when the guest RenderView is ready, e.g. because we
fsamuela8484dd2014-10-02 00:51:33121 // recreated it after a crash or after reattachment.
[email protected]5ca06862014-08-06 19:09:55122 //
123 // This gives the derived class an opportunity to perform some initialization
124 // work.
125 virtual void GuestReady() {}
126
127 // This method is invoked when the contents auto-resized to give the container
128 // an opportunity to match it if it wishes.
129 //
130 // This gives the derived class an opportunity to inform its container element
131 // or perform other actions.
132 virtual void GuestSizeChangedDueToAutoSize(const gfx::Size& old_size,
133 const gfx::Size& new_size) {}
134
135 // This method queries whether autosize is supported for this particular view.
136 // By default, autosize is not supported. Derived classes can override this
137 // behavior to support autosize.
138 virtual bool IsAutoSizeSupported() const;
139
kalmanc2c78842015-01-09 23:57:35140 // This method is invoked when the contents preferred size changes. This will
141 // only ever fire if IsPreferredSizeSupported returns true.
142 virtual void OnPreferredSizeChanged(const gfx::Size& pref_size) {}
143
144 // This method queries whether preferred size events are enabled for this
145 // view. By default, preferred size events are disabled, since they add a
146 // small amount of overhead.
147 virtual bool IsPreferredSizeModeEnabled() const;
148
[email protected]4858e432014-06-23 18:14:17149 // This method queries whether drag-and-drop is enabled for this particular
150 // view. By default, drag-and-drop is disabled. Derived classes can override
151 // this behavior to enable drag-and-drop.
152 virtual bool IsDragAndDropEnabled() const;
153
[email protected]d84d57b2014-06-20 22:42:39154 // This method is called immediately before suspended resource loads have been
155 // resumed on attachment to an embedder.
156 //
157 // This method can be overriden by subclasses. This gives the derived class
158 // an opportunity to perform setup actions before attachment.
159 virtual void WillAttachToEmbedder() {}
160
[email protected]a868c6c2014-06-04 13:07:43161 // This method is called when the guest WebContents is about to be destroyed.
162 //
[email protected]4858e432014-06-23 18:14:17163 // This gives the derived class an opportunity to perform some cleanup prior
164 // to destruction.
[email protected]a868c6c2014-06-04 13:07:43165 virtual void WillDestroy() {}
166
fsamuel67993a92014-12-17 01:33:20167 // This method is to be implemented by the derived class. This indicates
168 // whether zoom should propagate from the embedder to the guest content.
169 virtual bool ZoomPropagatesFromEmbedderToGuest() const;
170
[email protected]755211fe2014-08-08 19:01:49171 // This method is to be implemented by the derived class. Access to guest
172 // views are determined by the availability of the internal extension API
173 // used to implement the guest view.
174 //
175 // This should be the name of the API as it appears in the _api_features.json
176 // file.
fsamuel99492be2014-08-28 03:50:27177 virtual const char* GetAPINamespace() const = 0;
178
179 // This method is to be implemented by the derived class. This method is the
180 // task prefix to show for a task produced by this GuestViewBase's derived
181 // type.
182 virtual int GetTaskPrefix() const = 0;
[email protected]a2be2f112014-07-12 01:10:05183
[email protected]4858e432014-06-23 18:14:17184 // This method is to be implemented by the derived class. Given a set of
185 // initialization parameters, a concrete subclass of GuestViewBase can
186 // create a specialized WebContents that it returns back to GuestViewBase.
fsamuel09525e32015-01-21 22:23:39187 using WebContentsCreatedCallback =
188 base::Callback<void(content::WebContents*)>;
[email protected]4858e432014-06-23 18:14:17189 virtual void CreateWebContents(
[email protected]4858e432014-06-23 18:14:17190 const base::DictionaryValue& create_params,
191 const WebContentsCreatedCallback& callback) = 0;
[email protected]70ab2642014-05-30 08:06:58192
[email protected]4858e432014-06-23 18:14:17193 // This creates a WebContents and initializes |this| GuestViewBase to use the
194 // newly created WebContents.
fsamuel840c1af2014-12-24 01:39:41195 void Init(const base::DictionaryValue& create_params,
[email protected]38177c32014-06-25 23:20:23196 const WebContentsCreatedCallback& callback);
[email protected]a868c6c2014-06-04 13:07:43197
fsamuel6867dde92015-01-13 02:18:19198 void InitWithWebContents(const base::DictionaryValue& create_params,
199 content::WebContents* guest_web_contents);
[email protected]d84d57b2014-06-20 22:42:39200
[email protected]24569262014-05-06 03:31:30201 bool IsViewType(const char* const view_type) const {
202 return !strcmp(GetViewType(), view_type);
203 }
204
paulmeyereb98f9112015-01-23 17:13:38205 // Used to toggle autosize mode for this GuestView, and set both the automatic
206 // and normal sizes.
207 void SetSize(const SetSizeParams& params);
[email protected]5ca06862014-08-06 19:09:55208
[email protected]4858e432014-06-23 18:14:17209 bool initialized() const { return initialized_; }
210
[email protected]0533cc6d2013-06-27 22:44:05211 content::WebContents* embedder_web_contents() const {
fsamuela95fef42014-12-03 20:16:52212 return attached() ? owner_web_contents_ : NULL;
fsamuelad4f33f2014-11-28 19:32:21213 }
214
215 content::WebContents* owner_web_contents() const {
216 return owner_web_contents_;
[email protected]0533cc6d2013-06-27 22:44:05217 }
218
[email protected]2101c4c2014-08-22 00:16:16219 // Returns the parameters associated with the element hosting this GuestView
220 // passed in from JavaScript.
221 base::DictionaryValue* attach_params() const { return attach_params_.get(); }
[email protected]50d326e2014-05-20 17:59:06222
[email protected]738f57a2013-06-29 21:06:54223 // Returns whether this guest has an associated embedder.
fsamuela95fef42014-12-03 20:16:52224 bool attached() const {
225 return element_instance_id_ != guestview::kInstanceIDNone;
226 }
[email protected]738f57a2013-06-29 21:06:54227
[email protected]0533cc6d2013-06-27 22:44:05228 // Returns the instance ID of the <*view> element.
229 int view_instance_id() const { return view_instance_id_; }
230
[email protected]2101c4c2014-08-22 00:16:16231 // Returns the instance ID of this GuestViewBase.
232 int guest_instance_id() const { return guest_instance_id_; }
233
raymes9d460f92014-12-23 04:13:55234 // Returns the instance ID of the GuestViewBase's element.
235 int element_instance_id() const { return element_instance_id_; }
236
[email protected]0533cc6d2013-06-27 22:44:05237 // Returns the extension ID of the embedder.
fsamuelfe20ffac2014-12-02 01:51:22238 const std::string& owner_extension_id() const {
239 return owner_extension_id_;
[email protected]880331f972014-03-05 01:42:53240 }
241
242 // Returns whether this GuestView is embedded in an extension/app.
fsamuelfe20ffac2014-12-02 01:51:22243 bool in_extension() const { return !owner_extension_id_.empty(); }
[email protected]0533cc6d2013-06-27 22:44:05244
fsamuel6867dde92015-01-13 02:18:19245 bool can_owner_receive_events() const { return !!view_instance_id_; }
246
[email protected]0533cc6d2013-06-27 22:44:05247 // Returns the user browser context of the embedder.
248 content::BrowserContext* browser_context() const { return browser_context_; }
249
[email protected]50d326e2014-05-20 17:59:06250 GuestViewBase* GetOpener() const {
251 return opener_.get();
252 }
253
fsamuelfe20ffac2014-12-02 01:51:22254 // Returns the URL of the owner WebContents.
255 const GURL& GetOwnerSiteURL() const;
256
sammce2092512014-11-24 22:18:24257 // Whether the guest view is inside a plugin document.
258 bool is_full_page_plugin() { return is_full_page_plugin_; }
259
fsamuela8484dd2014-10-02 00:51:33260 // Destroy this guest.
261 void Destroy();
262
263 // Saves the attach state of the custom element hosting this GuestView.
[email protected]2101c4c2014-08-22 00:16:16264 void SetAttachParams(const base::DictionaryValue& params);
[email protected]50d326e2014-05-20 17:59:06265 void SetOpener(GuestViewBase* opener);
266
[email protected]aec80ed2014-05-27 00:01:15267 // BrowserPluginGuestDelegate implementation.
fsamuelfa284712015-01-15 01:24:53268 content::WebContents* CreateNewGuestWindow(
269 const content::WebContents::CreateParams& create_params) final;
dcheng9168b2f2014-10-21 12:38:24270 void DidAttach(int guest_proxy_routing_id) final;
fsamuela95fef42014-12-03 20:16:52271 void DidDetach() final;
paulmeyer0968abad2015-01-10 00:02:45272 void ElementSizeChanged(const gfx::Size& size) final;
fsamuel7310a4262014-12-05 05:06:44273 content::WebContents* GetOwnerWebContents() const final;
paulmeyer647b4f12015-01-26 21:40:08274 void GuestSizeChanged(const gfx::Size& new_size) final;
dcheng9168b2f2014-10-21 12:38:24275 void RegisterDestructionCallback(const DestructionCallback& callback) final;
paulmeyer0968abad2015-01-10 00:02:45276 void SetGuestSizer(content::GuestSizer* guest_sizer) final;
dcheng9168b2f2014-10-21 12:38:24277 void WillAttach(content::WebContents* embedder_web_contents,
sammce2092512014-11-24 22:18:24278 int browser_plugin_instance_id,
279 bool is_full_page_plugin) final;
[email protected]a868c6c2014-06-04 13:07:43280
wjmacleanec6bd522014-12-12 16:17:50281 // ui_zoom::ZoomObserver implementation.
282 void OnZoomChanged(
283 const ui_zoom::ZoomController::ZoomChangedEventData& data) override;
284
paulmeyer1b61eb242015-01-22 19:13:00285 // Dispatches an event to the guest proxy.
286 void DispatchEventToGuestProxy(Event* event);
287
288 // Dispatches an event to the view.
289 void DispatchEventToView(Event* event);
[email protected]7adb26a72014-07-09 17:44:35290
[email protected]0533cc6d2013-06-27 22:44:05291 protected:
fsamuelc75dc1d2015-01-27 06:22:15292 explicit GuestViewBase(content::WebContents* owner_web_contents);
[email protected]d84d57b2014-06-20 22:42:39293
dcheng9168b2f2014-10-21 12:38:24294 ~GuestViewBase() override;
[email protected]0533cc6d2013-06-27 22:44:05295
fsamuel4a1650f2015-01-23 21:57:49296 // WebContentsObserver implementation.
297 void DidStopLoading(content::RenderViewHost* render_view_host) final;
298 void RenderViewReady() final;
299 void WebContentsDestroyed() final;
300
301 // WebContentsDelegate implementation.
302 void ActivateContents(content::WebContents* contents) final;
303 void DeactivateContents(content::WebContents* contents) final;
304 void ContentsZoomChange(bool zoom_in) override;
305 void HandleKeyboardEvent(
306 content::WebContents* source,
307 const content::NativeWebKeyboardEvent& event) override;
308 void RunFileChooser(content::WebContents* web_contents,
309 const content::FileChooserParams& params) override;
310 bool ShouldFocusPageAfterCrash() final;
311 bool PreHandleGestureEvent(content::WebContents* source,
312 const blink::WebGestureEvent& event) final;
313 void UpdatePreferredSize(content::WebContents* web_contents,
314 const gfx::Size& pref_size) final;
315
[email protected]0533cc6d2013-06-27 22:44:05316 private:
fsamuelad4f33f2014-11-28 19:32:21317 class OwnerLifetimeObserver;
[email protected]70ab2642014-05-30 08:06:58318
fsamuel87161f872014-11-07 23:00:36319 class OpenerLifetimeObserver;
320
paulmeyer1b61eb242015-01-22 19:13:00321 void DispatchEvent(Event* event, int instance_id);
322
[email protected]738f57a2013-06-29 21:06:54323 void SendQueuedEvents();
324
fsamuel6867dde92015-01-13 02:18:19325 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params,
326 const WebContentsCreatedCallback& callback,
[email protected]3d888fa2014-07-11 19:27:16327 content::WebContents* guest_web_contents);
[email protected]38177c32014-06-25 23:20:23328
paulmeyer1b61eb242015-01-22 19:13:00329 // Dispatches the onResize event to the embedder.
330 void DispatchOnResizeEvent(const gfx::Size& old_size,
331 const gfx::Size& new_size);
332
paulmeyereb98f9112015-01-23 17:13:38333 void SetUpSizing(const base::DictionaryValue& params);
paulmeyer70fcd542015-01-09 19:26:54334
fsamuel67993a92014-12-17 01:33:20335 void StartTrackingEmbedderZoomLevel();
336 void StopTrackingEmbedderZoomLevel();
wjmacleanec6bd522014-12-12 16:17:50337
[email protected]52263312014-07-22 17:45:13338 static void RegisterGuestViewTypes();
339
fsamuelfe20ffac2014-12-02 01:51:22340 // This guest tracks the lifetime of the WebContents specified by
341 // |owner_web_contents_|. If |owner_web_contents_| is destroyed then this
342 // guest will also self-destruct.
fsamuelad4f33f2014-11-28 19:32:21343 content::WebContents* owner_web_contents_;
fsamuelfe20ffac2014-12-02 01:51:22344 std::string owner_extension_id_;
fsamuel09525e32015-01-21 22:23:39345 content::BrowserContext* const browser_context_;
fsamuel212c6da2014-09-18 16:16:15346
[email protected]0533cc6d2013-06-27 22:44:05347 // |guest_instance_id_| is a profile-wide unique identifier for a guest
348 // WebContents.
349 const int guest_instance_id_;
fsamuel212c6da2014-09-18 16:16:15350
[email protected]0533cc6d2013-06-27 22:44:05351 // |view_instance_id_| is an identifier that's unique within a particular
352 // embedder RenderViewHost for a particular <*view> instance.
[email protected]738f57a2013-06-29 21:06:54353 int view_instance_id_;
354
fsamuelad4f33f2014-11-28 19:32:21355 // |element_instance_id_| is an identifer that's unique to a particular
fsamuel212c6da2014-09-18 16:16:15356 // GuestViewContainer element.
357 int element_instance_id_;
358
fsamuelad4f33f2014-11-28 19:32:21359 // |initialized_| indicates whether GuestViewBase::Init has been called for
360 // this object.
[email protected]d84d57b2014-06-20 22:42:39361 bool initialized_;
362
fsamuel87161f872014-11-07 23:00:36363 // Indicates that this guest is in the process of being destroyed.
364 bool is_being_destroyed_;
365
[email protected]738f57a2013-06-29 21:06:54366 // This is a queue of Events that are destined to be sent to the embedder once
367 // the guest is attached to a particular embedder.
[email protected]0544ea92014-04-22 21:50:47368 std::deque<linked_ptr<Event> > pending_events_;
[email protected]0533cc6d2013-06-27 22:44:05369
[email protected]24569262014-05-06 03:31:30370 // The opener guest view.
371 base::WeakPtr<GuestViewBase> opener_;
372
[email protected]50d326e2014-05-20 17:59:06373 DestructionCallback destruction_callback_;
374
[email protected]2101c4c2014-08-22 00:16:16375 // The parameters associated with the element hosting this GuestView that
376 // are passed in from JavaScript. This will typically be the view instance ID,
377 // and element-specific parameters. These parameters are passed along to new
378 // guests that are created from this guest.
379 scoped_ptr<base::DictionaryValue> attach_params_;
[email protected]50d326e2014-05-20 17:59:06380
fsamuel87161f872014-11-07 23:00:36381 // This observer ensures that this guest self-destructs if the embedder goes
382 // away.
fsamuelad4f33f2014-11-28 19:32:21383 scoped_ptr<OwnerLifetimeObserver> owner_lifetime_observer_;
fsamuel87161f872014-11-07 23:00:36384
385 // This observer ensures that if the guest is unattached and its opener goes
386 // away then this guest also self-destructs.
387 scoped_ptr<OpenerLifetimeObserver> opener_lifetime_observer_;
[email protected]70ab2642014-05-30 08:06:58388
[email protected]5ca06862014-08-06 19:09:55389 // The size of the guest content. Note: In autosize mode, the container
390 // element may not match the size of the guest.
391 gfx::Size guest_size_;
392
paulmeyer0968abad2015-01-10 00:02:45393 // A pointer to the guest_sizer.
394 content::GuestSizer* guest_sizer_;
395
[email protected]5ca06862014-08-06 19:09:55396 // Indicates whether autosize mode is enabled or not.
397 bool auto_size_enabled_;
398
399 // The maximum size constraints of the container element in autosize mode.
400 gfx::Size max_auto_size_;
401
402 // The minimum size constraints of the container element in autosize mode.
403 gfx::Size min_auto_size_;
404
paulmeyereb98f9112015-01-23 17:13:38405 // The size that will be used when autosize mode is disabled.
406 gfx::Size normal_size_;
407
sammce2092512014-11-24 22:18:24408 // Whether the guest view is inside a plugin document.
409 bool is_full_page_plugin_;
410
[email protected]f21d36e2014-01-16 19:24:04411 // This is used to ensure pending tasks will not fire after this object is
412 // destroyed.
[email protected]0e99fdc2014-04-30 05:10:33413 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_;
[email protected]f21d36e2014-01-16 19:24:04414
[email protected]0e99fdc2014-04-30 05:10:33415 DISALLOW_COPY_AND_ASSIGN(GuestViewBase);
[email protected]0533cc6d2013-06-27 22:44:05416};
417
[email protected]140d6cd92014-08-12 18:26:46418} // namespace extensions
419
420#endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_