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

Unified Diff: chrome/browser/ui/gtk/extensions/extension_view_gtk.cc

Issue 10913243: extensions: Add ExtensionView interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: virtual dtor for cocoa and gtk ports 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/ui/gtk/extensions/extension_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
index 5b2cf1d752aa3f7d9448353e4043deecdd9baf0c..77ec09d0cf706d7a89a18239a59f43028c88aec1 100644
--- a/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
@@ -19,16 +19,11 @@ ExtensionViewGtk::ExtensionViewGtk(extensions::ExtensionHost* extension_host,
container_(NULL) {
}
-void ExtensionViewGtk::Init() {
- CreateWidgetHostView();
-}
-
-gfx::NativeView ExtensionViewGtk::native_view() {
- return extension_host_->host_contents()->GetView()->GetNativeView();
+ExtensionViewGtk::~ExtensionViewGtk() {
}
-content::RenderViewHost* ExtensionViewGtk::render_view_host() const {
- return extension_host_->render_view_host();
+void ExtensionViewGtk::Init() {
+ CreateWidgetHostView();
}
void ExtensionViewGtk::SetBackground(const SkBitmap& background) {
@@ -39,15 +34,27 @@ void ExtensionViewGtk::SetBackground(const SkBitmap& background) {
}
}
+Browser* ExtensionViewGtk::GetBrowser() {
+ return browser_;
+}
+
+const Browser* ExtensionViewGtk::GetBrowser() const {
+ return browser_;
+}
+
+gfx::NativeView ExtensionViewGtk::GetNativeView() {
+ return extension_host_->host_contents()->GetView()->GetNativeView();
+}
+
+void ExtensionViewGtk::SetContainer(ExtensionViewContainer* container) {
+ container_ = container;
+}
+
void ExtensionViewGtk::ResizeDueToAutoResize(const gfx::Size& new_size) {
if (container_)
container_->OnExtensionSizeChanged(this, new_size);
}
-void ExtensionViewGtk::CreateWidgetHostView() {
- extension_host_->CreateRenderViewSoon();
-}
-
void ExtensionViewGtk::RenderViewCreated() {
if (!pending_background_.empty() && render_view_host()->GetView()) {
render_view_host()->GetView()->SetBackground(pending_background_);
@@ -63,3 +70,23 @@ void ExtensionViewGtk::RenderViewCreated() {
render_view_host()->EnableAutoResize(min_size, max_size);
}
}
+
+void ExtensionViewGtk::DidStopLoading() {
+ NOTIMPLEMENTED();
+}
+
+void ExtensionViewGtk::CreateWidgetHostView() {
+ extension_host_->CreateRenderViewSoon();
+}
+
+content::RenderViewHost* ExtensionViewGtk::render_view_host() const {
+ return extension_host_->render_view_host();
+}
+
+// static
+ExtensionView* ExtensionView::Create(extensions::ExtensionHost* host,
+ Browser* browser) {
+ ExtensionViewGtk* extension_view = new ExtensionViewGtk(host, browser);
+ extension_view->Init();
+ return extension_view;
+}

Powered by Google App Engine
This is Rietveld 408576698