| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
| 7 |
| 8 #include "ui/gfx/native_widget_types.h" |
| 9 |
| 10 class Browser; |
| 11 class ExtensionViewContainer; |
| 12 |
| 13 namespace content { |
| 14 class RenderViewHost; |
| 15 struct NativeWebKeyboardEvent; |
| 16 } |
| 17 |
| 18 namespace extensions { |
| 19 class ExtensionHost; |
| 20 } |
| 21 |
| 22 namespace gfx { |
| 23 class Size; |
| 24 } |
| 25 |
| 26 // This is a cross platform interface for extension view, and it's owned by |
| 27 // ExtensionHost. |
| 28 class ExtensionView { |
| 29 public: |
| 30 static ExtensionView* Create(extensions::ExtensionHost* host, |
| 31 Browser* browser); |
| 32 |
| 33 virtual ~ExtensionView() {} |
| 34 |
| 35 // Returns the browser the extension belongs to. |
| 36 virtual Browser* GetBrowser() = 0; |
| 37 virtual const Browser* GetBrowser() const = 0; |
| 38 |
| 39 // Returns the extension's native view. |
| 40 virtual gfx::NativeView GetNativeView() = 0; |
| 41 |
| 42 // Returns the render view host for this extension view. |
| 43 virtual content::RenderViewHost* GetRenderViewHost() const = 0; |
| 44 |
| 45 // Sets the container for this view. |
| 46 virtual void SetContainer(ExtensionViewContainer* container) = 0; |
| 47 |
| 48 // Used by ExtensionHost to notify the platform-specific implementations about |
| 49 // the correct size for extension contents. |
| 50 virtual void ResizeDueToAutoResize(const gfx::Size& new_size) = 0; |
| 51 |
| 52 // Used by ExtensionHost to notify the platform-specific implementations when |
| 53 // the RenderViewHost has a connection. |
| 54 virtual void RenderViewCreated() = 0; |
| 55 |
| 56 // Used by ExtensionHost to notify the platform-specific implementations that/ |
| 57 // the extension page is loaded. |
| 58 virtual void DidStopLoading() = 0; |
| 59 |
| 60 // Informs the view that its containing window's frame changed. |
| 61 virtual void WindowFrameChanged() = 0; |
| 62 |
| 63 // Handles unhandled keyboard messages coming back from the renderer process. |
| 64 virtual void HandleKeyboardEvent( |
| 65 const content::NativeWebKeyboardEvent& event) {} |
| 66 }; |
| 67 |
| 68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
| OLD | NEW |