| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 virtual void DidAttachToEmbedder() {} | 96 virtual void DidAttachToEmbedder() {} |
| 97 | 97 |
| 98 // This method is called after this GuestViewBase has been initiated. | 98 // This method is called after this GuestViewBase has been initiated. |
| 99 // | 99 // |
| 100 // This gives the derived class an opportunity to perform additional | 100 // This gives the derived class an opportunity to perform additional |
| 101 // initialization. | 101 // initialization. |
| 102 virtual void DidInitialize(const base::DictionaryValue& create_params) {} | 102 virtual void DidInitialize(const base::DictionaryValue& create_params) {} |
| 103 | 103 |
| 104 // This method is called when the initial set of frames within the page have | 104 // This method is called when the initial set of frames within the page have |
| 105 // completed loading. | 105 // completed loading. |
| 106 virtual void DidStopLoading() {} | 106 virtual void GuestViewDidStopLoading() {} |
| 107 | 107 |
| 108 // This method is called before the embedder is destroyed. | 108 // This method is called before the embedder is destroyed. |
| 109 // |owner_web_contents_| should still be valid during this call. This | 109 // |owner_web_contents_| should still be valid during this call. This |
| 110 // allows the derived class to perform some cleanup related to the embedder | 110 // allows the derived class to perform some cleanup related to the embedder |
| 111 // web contents. | 111 // web contents. |
| 112 virtual void EmbedderWillBeDestroyed() {} | 112 virtual void EmbedderWillBeDestroyed() {} |
| 113 | 113 |
| 114 // This method is called when the guest WebContents has been destroyed. This | 114 // This method is called when the guest WebContents has been destroyed. This |
| 115 // object will be destroyed after this call returns. | 115 // object will be destroyed after this call returns. |
| 116 // | 116 // |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 int LogicalPixelsToPhysicalPixels(double logical_pixels); | 316 int LogicalPixelsToPhysicalPixels(double logical_pixels); |
| 317 | 317 |
| 318 // Convert sizes in pixels from physical to logical numbers of pixels. | 318 // Convert sizes in pixels from physical to logical numbers of pixels. |
| 319 // Note that a size can consist of a fractional number of logical pixels | 319 // Note that a size can consist of a fractional number of logical pixels |
| 320 // (hence the return value is represented as a double), but will always | 320 // (hence the return value is represented as a double), but will always |
| 321 // consist of an integral number of physical pixels (hence |physical_pixels| | 321 // consist of an integral number of physical pixels (hence |physical_pixels| |
| 322 // is represented as an int). | 322 // is represented as an int). |
| 323 double PhysicalPixelsToLogicalPixels(int physical_pixels); | 323 double PhysicalPixelsToLogicalPixels(int physical_pixels); |
| 324 | 324 |
| 325 // WebContentsObserver implementation. | 325 // WebContentsObserver implementation. |
| 326 void DidStopLoading(content::RenderViewHost* render_view_host) final; | 326 void DidStopLoading() final; |
| 327 void RenderViewReady() final; | 327 void RenderViewReady() final; |
| 328 void WebContentsDestroyed() final; | 328 void WebContentsDestroyed() final; |
| 329 | 329 |
| 330 // WebContentsDelegate implementation. | 330 // WebContentsDelegate implementation. |
| 331 void ActivateContents(content::WebContents* contents) final; | 331 void ActivateContents(content::WebContents* contents) final; |
| 332 void DeactivateContents(content::WebContents* contents) final; | 332 void DeactivateContents(content::WebContents* contents) final; |
| 333 void ContentsMouseEvent(content::WebContents* source, | 333 void ContentsMouseEvent(content::WebContents* source, |
| 334 const gfx::Point& location, | 334 const gfx::Point& location, |
| 335 bool motion) override; | 335 bool motion) override; |
| 336 void ContentsZoomChange(bool zoom_in) override; | 336 void ContentsZoomChange(bool zoom_in) override; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 // This is used to ensure pending tasks will not fire after this object is | 454 // This is used to ensure pending tasks will not fire after this object is |
| 455 // destroyed. | 455 // destroyed. |
| 456 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 456 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 457 | 457 |
| 458 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 458 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 459 }; | 459 }; |
| 460 | 460 |
| 461 } // namespace extensions | 461 } // namespace extensions |
| 462 | 462 |
| 463 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 463 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
| OLD | NEW |