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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 void SendQueuedEvents(); | 333 void SendQueuedEvents(); |
334 | 334 |
335 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params, | 335 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params, |
336 const WebContentsCreatedCallback& callback, | 336 const WebContentsCreatedCallback& callback, |
337 content::WebContents* guest_web_contents); | 337 content::WebContents* guest_web_contents); |
338 | 338 |
339 // Dispatches the onResize event to the embedder. | 339 // Dispatches the onResize event to the embedder. |
340 void DispatchOnResizeEvent(const gfx::Size& old_size, | 340 void DispatchOnResizeEvent(const gfx::Size& old_size, |
341 const gfx::Size& new_size); | 341 const gfx::Size& new_size); |
342 | 342 |
343 // Get the zoom factor for the embedder's web contents. | |
344 double GetEmbedderZoomFactor(); | |
345 | |
346 // Convert sizes in pixles between logical and physical numbers of pixels. | |
Fady Samuel
2015/02/17 21:53:51
nit: s/pixles/pixels
Split these two up and have
paulmeyer
2015/02/18 13:37:36
Done.
| |
347 // Note that a size can consist of a fractional number of logical pixels | |
348 // (hence |logical_pixels| is represented as a double), but will always | |
349 // consist of an integral number of physical pixels (hence |physical_pixels| | |
350 // is represented as an int). | |
351 int LogicalPixelsToPhysicalPixels(double logical_pixels); | |
352 double PhysicalPixelsToLogicalPixels(int physical_pixels); | |
353 | |
343 void SetUpSizing(const base::DictionaryValue& params); | 354 void SetUpSizing(const base::DictionaryValue& params); |
344 | 355 |
345 void StartTrackingEmbedderZoomLevel(); | 356 void StartTrackingEmbedderZoomLevel(); |
346 void StopTrackingEmbedderZoomLevel(); | 357 void StopTrackingEmbedderZoomLevel(); |
347 | 358 |
348 static void RegisterGuestViewTypes(); | 359 static void RegisterGuestViewTypes(); |
349 | 360 |
350 // This guest tracks the lifetime of the WebContents specified by | 361 // This guest tracks the lifetime of the WebContents specified by |
351 // |owner_web_contents_|. If |owner_web_contents_| is destroyed then this | 362 // |owner_web_contents_|. If |owner_web_contents_| is destroyed then this |
352 // guest will also self-destruct. | 363 // guest will also self-destruct. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 // This is used to ensure pending tasks will not fire after this object is | 432 // This is used to ensure pending tasks will not fire after this object is |
422 // destroyed. | 433 // destroyed. |
423 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 434 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
424 | 435 |
425 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 436 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
426 }; | 437 }; |
427 | 438 |
428 } // namespace extensions | 439 } // namespace extensions |
429 | 440 |
430 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 441 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
OLD | NEW |