diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 16:31:43 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 16:31:43 +0000 |
commit | 24319273088f4a151b9e00c10aea01ef0df3dd47 (patch) | |
tree | 4d62bb1a3a14b5360bd772103e4042637dde46c1 | |
parent | 3000b4a013f9dee586237aedeae7ef818f89caae (diff) | |
download | chromium_src-24319273088f4a151b9e00c10aea01ef0df3dd47.zip chromium_src-24319273088f4a151b9e00c10aea01ef0df3dd47.tar.gz chromium_src-24319273088f4a151b9e00c10aea01ef0df3dd47.tar.bz2 |
Get rid of BookmarkEditor::Handler entirely.
(Part of aftermath of eliminating the native bookmark managers.)
BUG=38908
TEST=everything keeps working
Review URL: http://codereview.chromium.org/1745021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45939 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/bookmarks/bookmark_editor.h | 11 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_utils.cc | 16 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_utils.h | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_editor_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_editor_view.cc | 4 | ||||
-rw-r--r-- | chrome/test/live_sync/bookmark_model_verifier.cc | 4 | ||||
-rw-r--r-- | chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc | 4 |
7 files changed, 18 insertions, 35 deletions
diff --git a/chrome/browser/bookmarks/bookmark_editor.h b/chrome/browser/bookmarks/bookmark_editor.h index 0de44bc..a1dbcf8 100644 --- a/chrome/browser/bookmarks/bookmark_editor.h +++ b/chrome/browser/bookmarks/bookmark_editor.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,14 +19,6 @@ class Profile; // bookmark editor dialog. class BookmarkEditor { public: - // Handler is notified when the BookmarkEditor creates a new bookmark. - // Handler is owned by the BookmarkEditor and deleted when it is deleted. - class Handler { - public: - virtual ~Handler() {} - virtual void NodeCreated(const BookmarkNode* new_node) = 0; - }; - // An enumeration of the possible configurations offered. enum Configuration { SHOW_TREE, @@ -74,7 +66,6 @@ class BookmarkEditor { // the user to choose the parent of the node. // |parent| gives the initial parent to select in the tree for the node. // |parent| is only used if |details.existing_node| is null. - // BookmarkEditor takes ownership of |handler| and deletes it when done. static void Show(gfx::NativeWindow parent_window, Profile* profile, const BookmarkNode* parent, diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 4ffeeb2..1221ae8 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -561,8 +561,7 @@ bool DoesBookmarkContainText(const BookmarkNode* node, static const BookmarkNode* CreateNewNode(BookmarkModel* model, const BookmarkNode* parent, const BookmarkEditor::EditDetails& details, - const std::wstring& new_title, const GURL& new_url, - BookmarkEditor::Handler* handler) { + const std::wstring& new_title, const GURL& new_url) { const BookmarkNode* node; if (details.type == BookmarkEditor::EditDetails::NEW_URL) { node = model->AddURL(parent, parent->GetChildCount(), new_title, new_url); @@ -578,18 +577,15 @@ static const BookmarkNode* CreateNewNode(BookmarkModel* model, return NULL; } - if (handler) - handler->NodeCreated(node); return node; } const BookmarkNode* ApplyEditsWithNoGroupChange(BookmarkModel* model, const BookmarkNode* parent, const BookmarkEditor::EditDetails& details, - const std::wstring& new_title, const GURL& new_url, - BookmarkEditor::Handler* handler) { + const std::wstring& new_title, const GURL& new_url) { if (details.type == BookmarkEditor::EditDetails::NEW_URL || details.type == BookmarkEditor::EditDetails::NEW_FOLDER) { - return CreateNewNode(model, parent, details, new_title, new_url, handler); + return CreateNewNode(model, parent, details, new_title, new_url); } const BookmarkNode* node = details.existing_node; @@ -604,12 +600,10 @@ const BookmarkNode* ApplyEditsWithNoGroupChange(BookmarkModel* model, const BookmarkNode* ApplyEditsWithPossibleGroupChange(BookmarkModel* model, const BookmarkNode* new_parent, const BookmarkEditor::EditDetails& details, - const std::wstring& new_title, const GURL& new_url, - BookmarkEditor::Handler* handler) { + const std::wstring& new_title, const GURL& new_url) { if (details.type == BookmarkEditor::EditDetails::NEW_URL || details.type == BookmarkEditor::EditDetails::NEW_FOLDER) { - return CreateNewNode(model, new_parent, details, new_title, new_url, - handler); + return CreateNewNode(model, new_parent, details, new_title, new_url); } const BookmarkNode* node = details.existing_node; diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h index ed7f850..0802b2b 100644 --- a/chrome/browser/bookmarks/bookmark_utils.h +++ b/chrome/browser/bookmarks/bookmark_utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -165,8 +165,7 @@ const BookmarkNode* ApplyEditsWithNoGroupChange( const BookmarkNode* parent, const BookmarkEditor::EditDetails& details, const std::wstring& new_title, - const GURL& new_url, - BookmarkEditor::Handler* handler); + const GURL& new_url); // Modifies a bookmark node assuming that the parent of the node may have // changed and the node will need to be removed and reinserted. If a new node @@ -177,8 +176,7 @@ const BookmarkNode* ApplyEditsWithPossibleGroupChange( const BookmarkNode* new_parent, const BookmarkEditor::EditDetails& details, const std::wstring& new_title, - const GURL& new_url, - BookmarkEditor::Handler* handler); + const GURL& new_url); // Toggles whether the bookmark bar is shown only on the new tab page or on // all tabs. This is a preference modifier, not a visual modifier. diff --git a/chrome/browser/gtk/bookmark_editor_gtk.cc b/chrome/browser/gtk/bookmark_editor_gtk.cc index dc631e5..a54c037 100644 --- a/chrome/browser/gtk/bookmark_editor_gtk.cc +++ b/chrome/browser/gtk/bookmark_editor_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -313,7 +313,7 @@ void BookmarkEditorGtk::ApplyEdits(GtkTreeIter* selected_parent) { if (!show_tree_ || !selected_parent) { bookmark_utils::ApplyEditsWithNoGroupChange( - bb_model_, parent_, details_, new_title, new_url, NULL); + bb_model_, parent_, details_, new_title, new_url); return; } @@ -329,7 +329,7 @@ void BookmarkEditorGtk::ApplyEdits(GtkTreeIter* selected_parent) { } bookmark_utils::ApplyEditsWithPossibleGroupChange( - bb_model_, new_parent, details_, new_title, new_url, NULL); + bb_model_, new_parent, details_, new_title, new_url); } void BookmarkEditorGtk::AddNewGroup(GtkTreeIter* parent, GtkTreeIter* child) { diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index 28b9867..616000b 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -532,7 +532,7 @@ void BookmarkEditorView::ApplyEdits(EditorNode* parent) { if (!show_tree_) { bookmark_utils::ApplyEditsWithNoGroupChange( - bb_model_, parent_, details_, new_title, new_url, NULL); + bb_model_, parent_, details_, new_title, new_url); return; } @@ -542,7 +542,7 @@ void BookmarkEditorView::ApplyEdits(EditorNode* parent) { bb_model_->root_node(), tree_model_->GetRoot(), parent, &new_parent); bookmark_utils::ApplyEditsWithPossibleGroupChange( - bb_model_, new_parent, details_, new_title, new_url, NULL); + bb_model_, new_parent, details_, new_title, new_url); } void BookmarkEditorView::ApplyNameChangesAndCreateNewGroups( diff --git a/chrome/test/live_sync/bookmark_model_verifier.cc b/chrome/test/live_sync/bookmark_model_verifier.cc index 5f5b718..f7a943b 100644 --- a/chrome/test/live_sync/bookmark_model_verifier.cc +++ b/chrome/test/live_sync/bookmark_model_verifier.cc @@ -248,8 +248,8 @@ const BookmarkNode* BookmarkModelVerifier::SetURL(BookmarkModel* model, FindNodeInVerifier(model, node, &v_node); const BookmarkNode* result = bookmark_utils::ApplyEditsWithNoGroupChange( model, node->GetParent(), BookmarkEditor::EditDetails(node), - node->GetTitle(), new_url, NULL); + node->GetTitle(), new_url); bookmark_utils::ApplyEditsWithNoGroupChange(verifier_, v_node->GetParent(), - BookmarkEditor::EditDetails(v_node), v_node->GetTitle(), new_url, NULL); + BookmarkEditor::EditDetails(v_node), v_node->GetTitle(), new_url); return result; } diff --git a/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc b/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc index 03691b0..47300bf 100644 --- a/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc +++ b/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc @@ -395,9 +395,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, const BookmarkNode* google_one = GetByUniqueURL(model_one, initial_url); const BookmarkNode* google_two = GetByUniqueURL(model_two, initial_url); bookmark_utils::ApplyEditsWithNoGroupChange(model_one, bbn_one, - BookmarkEditor::EditDetails(google_one), title, second_url, NULL); + BookmarkEditor::EditDetails(google_one), title, second_url); bookmark_utils::ApplyEditsWithNoGroupChange(model_two, bbn_two, - BookmarkEditor::EditDetails(google_two), title, third_url, NULL); + BookmarkEditor::EditDetails(google_two), title, third_url); } ASSERT_TRUE(client1()->AwaitMutualSyncCycleCompletion(client2())); |