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

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: 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/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..59c3aa8f67fbb1c83a59a130191be253f6ac171e 100644
--- a/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
@@ -19,24 +19,40 @@ ExtensionViewGtk::ExtensionViewGtk(extensions::ExtensionHost* extension_host,
container_(NULL) {
}
+ExtensionViewGtk::~ExtensionViewGtk() {
+}
+
void ExtensionViewGtk::Init() {
CreateWidgetHostView();
}
-gfx::NativeView ExtensionViewGtk::native_view() {
+void ExtensionViewGtk::SetBackground(const SkBitmap& background) {
+ if (GetRenderViewHost()->IsRenderViewLive() &&
+ GetRenderViewHost()->GetView()) {
+ GetRenderViewHost()->GetView()->SetBackground(background);
+ } else {
+ pending_background_ = background;
+ }
+}
+
+Browser* ExtensionViewGtk::GetBrowser() {
+ return browser_;
+}
+
+const Browser* ExtensionViewGtk::GetBrowser() const {
+ return browser_;
+}
+
+gfx::NativeView ExtensionViewGtk::GetNativeView() {
return extension_host_->host_contents()->GetView()->GetNativeView();
}
-content::RenderViewHost* ExtensionViewGtk::render_view_host() const {
+content::RenderViewHost* ExtensionViewGtk::GetRenderViewHost() const {
return extension_host_->render_view_host();
}
-void ExtensionViewGtk::SetBackground(const SkBitmap& background) {
- if (render_view_host()->IsRenderViewLive() && render_view_host()->GetView()) {
- render_view_host()->GetView()->SetBackground(background);
- } else {
- pending_background_ = background;
- }
+void ExtensionViewGtk::SetContainer(ExtensionViewContainer* container) {
+ container_ = container;
}
void ExtensionViewGtk::ResizeDueToAutoResize(const gfx::Size& new_size) {
@@ -44,13 +60,9 @@ void ExtensionViewGtk::ResizeDueToAutoResize(const gfx::Size& new_size) {
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_);
+ if (!pending_background_.empty() && GetRenderViewHost()->GetView()) {
+ GetRenderViewHost()->GetView()->SetBackground(pending_background_);
pending_background_.reset();
}
@@ -60,6 +72,26 @@ void ExtensionViewGtk::RenderViewCreated() {
ExtensionPopupGtk::kMinHeight);
gfx::Size max_size(ExtensionPopupGtk::kMaxWidth,
ExtensionPopupGtk::kMaxHeight);
- render_view_host()->EnableAutoResize(min_size, max_size);
+ GetRenderViewHost()->EnableAutoResize(min_size, max_size);
}
}
+
+void ExtensionViewGtk::DidStopLoading() {
+ NOTIMPLEMENTED();
+}
+
+void ExtensionViewGtk::WindowFrameChanged() {
+ NOTIMPLEMENTED();
+}
+
+void ExtensionViewGtk::CreateWidgetHostView() {
+ extension_host_->CreateRenderViewSoon();
+}
+
+// static
+ExtensionView* ExtensionView::Create(extensions::ExtensionHost* host,
+ Browser* browser) {
+ ExtensionViewGtk* extension_view = new ExtensionViewGtk(host, browser);
+ extension_view->Init();
+ return extension_view;
+}
« no previous file with comments | « chrome/browser/ui/gtk/extensions/extension_view_gtk.h ('k') | chrome/browser/ui/gtk/extensions/shell_window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698