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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_
8 #include "ui/gfx/native_widget_types.h"
13 struct NativeWebKeyboardEvent
;
21 namespace extensions
{
23 // Base class for platform-specific views used by extensions in the Chrome UI.
26 virtual ~ExtensionView() {}
28 // If attached to a Browser (e.g. popups), the Browser it is attached to.
29 virtual Browser
* GetBrowser() = 0;
31 // Returns the extension's native view.
32 virtual gfx::NativeView
GetNativeView() = 0;
34 // Method for the ExtensionHost to notify us about the correct size for
35 // extension contents.
36 virtual void ResizeDueToAutoResize(const gfx::Size
& new_size
) = 0;
38 // Method for the ExtensionHost to notify us when the RenderViewHost has a
40 virtual void RenderViewCreated() = 0;
42 // Handles unhandled keyboard messages coming back from the renderer process.
43 virtual void HandleKeyboardEvent(
44 content::WebContents
* source
,
45 const content::NativeWebKeyboardEvent
& event
) = 0;
47 // Method for the ExtensionHost to notify that the extension page has loaded.
48 virtual void DidStopLoading() = 0;
51 } // namespace extensions
53 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_