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

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

Issue 363233002: Abstract base 'ExtensionView' to Fix DEPS violation in extension_view_host.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Init() must be done after assigning Created 6 years, 6 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..5f4063cf64096072acbe5b4f489473151a498470
--- /dev/null
+++ b/chrome/browser/extensions/extension_view.h
@@ -0,0 +1,56 @@
+// Copyright 2014 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;
+
+namespace content {
+struct NativeWebKeyboardEvent;
+class WebContents;
+}
+
+namespace gfx {
+class Size;
+}
+
+namespace extensions {
+
+// Base class for platform-specific views used by extensions in the Chrome UI.
+class ExtensionView {
+ public:
+ virtual ~ExtensionView() {}
+
+ // Initialize the view, once a newly created view has been set in the host.
+ virtual void Init() = 0;
+
+ // If attached to a Browser (e.g. popups), the Browser it is attached to.
+ virtual Browser* GetBrowser() = 0;
+
+ // Returns the extension's native view.
+ virtual gfx::NativeView GetNativeView() = 0;
+
+ // Method for the ExtensionHost to notify us about the correct size for
+ // extension contents.
+ virtual void ResizeDueToAutoResize(const gfx::Size& new_size) = 0;
+
+ // Method for the ExtensionHost to notify us when the RenderViewHost has a
+ // connection.
+ virtual void RenderViewCreated() = 0;
+
+ // Handles unhandled keyboard messages coming back from the renderer process.
+ virtual void HandleKeyboardEvent(
+ content::WebContents* source,
+ const content::NativeWebKeyboardEvent& event) = 0;
+
+ // Method for the ExtensionHost to notify that the extension page is loaded.
Finnur 2014/07/03 14:27:05 nit: is -> has ?
tapted 2014/07/04 00:08:03 Done.
+ virtual void DidStopLoading() = 0;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698