diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 17:20:01 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 17:20:01 +0000 |
commit | 6696502bf689f978da3b89c076212204829a4c5d (patch) | |
tree | 2930685f69f651777f03710bfc82808d684f7184 /chrome/browser/gtk | |
parent | 9670691da1ff13fc4c0cd69fab4369b448f9019a (diff) | |
download | chromium_src-6696502bf689f978da3b89c076212204829a4c5d.zip chromium_src-6696502bf689f978da3b89c076212204829a4c5d.tar.gz chromium_src-6696502bf689f978da3b89c076212204829a4c5d.tar.bz2 |
Lands http://codereview.chromium.org/155428 for Thiago, which changes
from me to get the thing to work.
Merging two versions of BookmarkNodeRemoved into one.
BUG=None
TEST=Remove some bookmarks from BookmarkBar or Bookmarks Manager and make sure
everything works ok.
Review URL: http://codereview.chromium.org/155572
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 9 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_editor_gtk.h | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_manager_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_manager_gtk.h | 3 |
5 files changed, 8 insertions, 15 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index fc9f4d8..c2753b9 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -237,7 +237,7 @@ void BookmarkBarGtk::BookmarkNodeMoved(BookmarkModel* model, int old_index, const BookmarkNode* new_parent, int new_index) { - BookmarkNodeRemoved(model, old_parent, old_index); + BookmarkNodeRemoved(model, old_parent, old_index, NULL); BookmarkNodeAdded(model, new_parent, new_index); } @@ -259,15 +259,16 @@ void BookmarkBarGtk::BookmarkNodeAdded(BookmarkModel* model, void BookmarkBarGtk::BookmarkNodeRemoved(BookmarkModel* model, const BookmarkNode* parent, - int index) { + int old_index, + const BookmarkNode* node) { if (parent != model_->GetBookmarkBarNode()) { // We only care about nodes on the bookmark bar. return; } - DCHECK(index >= 0 && index < GetBookmarkButtonCount()); + DCHECK(old_index >= 0 && old_index < GetBookmarkButtonCount()); GtkWidget* to_remove = GTK_WIDGET(gtk_toolbar_get_nth_item( - GTK_TOOLBAR(bookmark_toolbar_.get()), index)); + GTK_TOOLBAR(bookmark_toolbar_.get()), old_index)); gtk_container_remove(GTK_CONTAINER(bookmark_toolbar_.get()), to_remove); diff --git a/chrome/browser/gtk/bookmark_bar_gtk.h b/chrome/browser/gtk/bookmark_bar_gtk.h index 0c2aa39..0683275 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.h +++ b/chrome/browser/gtk/bookmark_bar_gtk.h @@ -111,7 +111,8 @@ class BookmarkBarGtk : public AnimationDelegate, int index); virtual void BookmarkNodeRemoved(BookmarkModel* model, const BookmarkNode* parent, - int index); + int old_index, + const BookmarkNode* node); virtual void BookmarkNodeChanged(BookmarkModel* model, const BookmarkNode* node); // Invoked when a favicon has finished loading. diff --git a/chrome/browser/gtk/bookmark_editor_gtk.h b/chrome/browser/gtk/bookmark_editor_gtk.h index 70ed8c4..0b1fa28 100644 --- a/chrome/browser/gtk/bookmark_editor_gtk.h +++ b/chrome/browser/gtk/bookmark_editor_gtk.h @@ -52,7 +52,7 @@ class BookmarkEditorGtk : public BookmarkEditor, int index); virtual void BookmarkNodeRemoved(BookmarkModel* model, const BookmarkNode* parent, - int index, + int old_index, const BookmarkNode* node); virtual void BookmarkNodeChanged(BookmarkModel* model, const BookmarkNode* node) {} diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index dab3508..51a2a40 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -212,12 +212,6 @@ void BookmarkManagerGtk::BookmarkNodeAdded(BookmarkModel* model, void BookmarkManagerGtk::BookmarkNodeRemoved(BookmarkModel* model, const BookmarkNode* parent, - int index) { - NOTREACHED(); -} - -void BookmarkManagerGtk::BookmarkNodeRemoved(BookmarkModel* model, - const BookmarkNode* parent, int old_index, const BookmarkNode* node) { if (node->is_folder()) { diff --git a/chrome/browser/gtk/bookmark_manager_gtk.h b/chrome/browser/gtk/bookmark_manager_gtk.h index ae3336b..402e454 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.h +++ b/chrome/browser/gtk/bookmark_manager_gtk.h @@ -48,9 +48,6 @@ class BookmarkManagerGtk : public BookmarkModelObserver, int index); virtual void BookmarkNodeRemoved(BookmarkModel* model, const BookmarkNode* parent, - int index); - virtual void BookmarkNodeRemoved(BookmarkModel* model, - const BookmarkNode* parent, int old_index, const BookmarkNode* node); virtual void BookmarkNodeChanged(BookmarkModel* model, |