MacViews: Get c/b/ui/views/tabs to build on Mac
[chromium-blink-merge.git] / chrome / browser / extensions / extension_view.h
blobe974d0973b5a875b7dca12bc6be2e78a238c1fbc
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"
10 class Browser;
12 namespace content {
13 struct NativeWebKeyboardEvent;
14 class WebContents;
17 namespace gfx {
18 class Size;
21 namespace extensions {
23 // Base class for platform-specific views used by extensions in the Chrome UI.
24 class ExtensionView {
25 public:
26 virtual ~ExtensionView() {}
28 // Initialize the view, once a newly created view has been set in the host.
29 virtual void Init() = 0;
31 // If attached to a Browser (e.g. popups), the Browser it is attached to.
32 virtual Browser* GetBrowser() = 0;
34 // Returns the extension's native view.
35 virtual gfx::NativeView GetNativeView() = 0;
37 // Method for the ExtensionHost to notify us about the correct size for
38 // extension contents.
39 virtual void ResizeDueToAutoResize(const gfx::Size& new_size) = 0;
41 // Method for the ExtensionHost to notify us when the RenderViewHost has a
42 // connection.
43 virtual void RenderViewCreated() = 0;
45 // Handles unhandled keyboard messages coming back from the renderer process.
46 virtual void HandleKeyboardEvent(
47 content::WebContents* source,
48 const content::NativeWebKeyboardEvent& event) = 0;
50 // Method for the ExtensionHost to notify that the extension page has loaded.
51 virtual void DidStopLoading() = 0;
54 } // namespace extensions
56 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_