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

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

Issue 159763: Rolling back change 22245. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: Created 11 years, 5 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/gtk/extension_shelf_gtk.h ('k') | chrome/browser/views/extensions/extension_shelf.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
===================================================================
--- chrome/browser/gtk/extension_shelf_gtk.cc (revision 22246)
+++ chrome/browser/gtk/extension_shelf_gtk.cc (working copy)
@@ -67,7 +67,7 @@
ExtensionShelfGtk::ExtensionShelfGtk(Profile* profile, Browser* browser)
: browser_(browser),
theme_provider_(GtkThemeProvider::GetFrom(profile)),
- model_(browser->extension_shelf_model()) {
+ model_(new ExtensionShelfModel(browser)) {
Init(profile);
registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED,
@@ -75,8 +75,7 @@
}
ExtensionShelfGtk::~ExtensionShelfGtk() {
- if (model_)
- model_->RemoveObserver(this);
+ model_->RemoveObserver(this);
event_box_.Destroy();
}
@@ -120,8 +119,8 @@
AdjustHeight();
}
-void ExtensionShelfGtk::ToolstripChanged(
- ExtensionShelfModel::iterator toolstrip) {
+void ExtensionShelfGtk::ToolstripChangedAt(ExtensionHost* host,
+ int index) {
// TODO(phajdan.jr): Implement changing toolstrips.
AdjustHeight();
}
@@ -140,18 +139,6 @@
LoadFromModel();
}
-void ExtensionShelfGtk::ShelfModelDeleting() {
- for (std::set<Toolstrip*>::iterator iter = toolstrips_.begin();
- iter != toolstrips_.end(); ++iter) {
- (*iter)->RemoveToolstripFromBox(shelf_hbox_);
- delete *iter;
- }
- toolstrips_.clear();
-
- model_->RemoveObserver(this);
- model_ = NULL;
-}
-
void ExtensionShelfGtk::Init(Profile* profile) {
event_box_.Own(gtk_event_box_new());
@@ -200,12 +187,12 @@
DCHECK(toolstrips_.empty());
int count = model_->count();
for (int i = 0; i < count; ++i)
- ToolstripInsertedAt(model_->ToolstripAt(i).host, i);
+ ToolstripInsertedAt(model_->ToolstripAt(i), i);
AdjustHeight();
}
ExtensionShelfGtk::Toolstrip* ExtensionShelfGtk::ToolstripAtIndex(int index) {
- return static_cast<Toolstrip*>(model_->ToolstripAt(index).data);
+ return static_cast<Toolstrip*>(model_->ToolstripDataAt(index));
}
// static
« no previous file with comments | « chrome/browser/gtk/extension_shelf_gtk.h ('k') | chrome/browser/views/extensions/extension_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698