Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1175)

Unified Diff: chrome/browser/extensions/extension_view.h

Issue 10913243: extensions: Add ExtensionView interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: weak Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_view.h
diff --git a/chrome/browser/extensions/extension_view.h b/chrome/browser/extensions/extension_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..848236f4279989f06da246ba6ca02a823714c9ae
--- /dev/null
+++ b/chrome/browser/extensions/extension_view.h
@@ -0,0 +1,68 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_
+
+#include "ui/gfx/native_widget_types.h"
+
+class Browser;
+class ExtensionViewContainer;
+
+namespace content {
+class RenderViewHost;
+struct NativeWebKeyboardEvent;
+}
+
+namespace extensions {
+class ExtensionHost;
+}
+
+namespace gfx {
+class Size;
+}
+
+// This is a cross platform interface for extension view, and it's owned by
+// ExtensionHost.
+class ExtensionView {
+ public:
+ static ExtensionView* Create(extensions::ExtensionHost* host,
+ Browser* browser);
+
+ virtual ~ExtensionView() {}
+
+ // Returns the browser the extension belongs to.
+ virtual Browser* GetBrowser() = 0;
+ virtual const Browser* GetBrowser() const = 0;
+
+ // Returns the extension's native view.
+ virtual gfx::NativeView GetNativeView() = 0;
+
+ // Returns the render view host for this extension view.
+ virtual content::RenderViewHost* GetRenderViewHost() const = 0;
+
+ // Sets the container for this view.
+ virtual void SetContainer(ExtensionViewContainer* container) = 0;
+
+ // Used by ExtensionHost to notify the platform-specific implementations about
+ // the correct size for extension contents.
+ virtual void ResizeDueToAutoResize(const gfx::Size& new_size) = 0;
+
+ // Used by ExtensionHost to notify the platform-specific implementations when
+ // the RenderViewHost has a connection.
+ virtual void RenderViewCreated() = 0;
+
+ // Used by ExtensionHost to notify the platform-specific implementations that/
+ // the extension page is loaded.
+ virtual void DidStopLoading() = 0;
+
+ // Informs the view that its containing window's frame changed.
+ virtual void WindowFrameChanged() = 0;
+
+ // Handles unhandled keyboard messages coming back from the renderer process.
+ virtual void HandleKeyboardEvent(
+ const content::NativeWebKeyboardEvent& event) {}
+};
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_
« no previous file with comments | « chrome/browser/extensions/extension_host_mac.mm ('k') | chrome/browser/extensions/extension_view_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698