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

Unified Diff: chrome/browser/gtk/extension_shelf_gtk.cc

Issue 160610: Make extensions in the extension shelf render their content to a visible GTK (Closed)
Patch Set: should be initialized to true to match Windows Created 11 years, 4 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
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/gtk/extension_view_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/extension_shelf_gtk.cc
diff --git a/chrome/browser/gtk/extension_shelf_gtk.cc b/chrome/browser/gtk/extension_shelf_gtk.cc
index c83d182d5ba68b76da6e046f18042251f9a676db..1262c16df3a1ea17994416ca41f5db807ee726b8 100644
--- a/chrome/browser/gtk/extension_shelf_gtk.cc
+++ b/chrome/browser/gtk/extension_shelf_gtk.cc
@@ -28,40 +28,36 @@ class ExtensionShelfGtk::Toolstrip {
Init();
}
- ~Toolstrip() {
- label_.Destroy();
- }
-
void AddToolstripToBox(GtkWidget* box);
void RemoveToolstripFromBox(GtkWidget* box);
private:
void Init();
+ gfx::NativeView native_view() {
+ return host_->view()->native_view();
+ }
+
ExtensionHost* host_;
const std::string extension_name_;
- // Placeholder label with extension's name.
- // TODO(phajdan.jr): replace the label with rendered extension contents.
- OwnedWidgetGtk label_;
-
private:
DISALLOW_COPY_AND_ASSIGN(Toolstrip);
};
void ExtensionShelfGtk::Toolstrip::AddToolstripToBox(GtkWidget* box) {
- gtk_box_pack_start(GTK_BOX(box), label_.get(), FALSE, FALSE,
+ gtk_box_pack_start(GTK_BOX(box), native_view(), TRUE, TRUE,
kToolstripPadding);
}
void ExtensionShelfGtk::Toolstrip::RemoveToolstripFromBox(GtkWidget* box) {
- gtk_container_remove(GTK_CONTAINER(box), label_.get());
+ gtk_container_remove(GTK_CONTAINER(box), native_view());
}
void ExtensionShelfGtk::Toolstrip::Init() {
- label_.Own(gtk_label_new(extension_name_.c_str()));
- gtk_widget_show_all(label_.get());
+ host_->view()->set_is_toolstrip(true);
+ gtk_widget_show_all(native_view());
}
ExtensionShelfGtk::ExtensionShelfGtk(Profile* profile, Browser* browser)
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/gtk/extension_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698