| Index: chrome/browser/bookmarks/bookmark_utils.cc
|
| diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
|
| index 6da548b5808545b4d3d428ddc4ef4f0153fb90d2..66ec5ecc23836eb6ebe18b415268b36a4347a5f7 100644
|
| --- a/chrome/browser/bookmarks/bookmark_utils.cc
|
| +++ b/chrome/browser/bookmarks/bookmark_utils.cc
|
| @@ -15,6 +15,7 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/time/time.h"
|
| #include "chrome/browser/bookmarks/bookmark_model.h"
|
| +#include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
| #include "chrome/browser/history/query_parser.h"
|
| #include "chrome/browser/undo/bookmark_undo_service.h"
|
| #include "chrome/browser/undo/bookmark_undo_service_factory.h"
|
| @@ -149,7 +150,7 @@ void CopyToClipboard(BookmarkModel* model,
|
|
|
| if (remove_nodes) {
|
| #if !defined(OS_ANDROID)
|
| - ScopedGroupBookmarkActions group_cut(model->profile());
|
| + ScopedGroupBookmarkActions group_cut(model);
|
| #endif
|
| for (size_t i = 0; i < filtered_nodes.size(); ++i) {
|
| int index = filtered_nodes[i]->parent()->GetIndexOf(filtered_nodes[i]);
|
| @@ -172,7 +173,7 @@ void PasteFromClipboard(BookmarkModel* model,
|
| if (index == -1)
|
| index = parent->child_count();
|
| #if !defined(OS_ANDROID)
|
| - ScopedGroupBookmarkActions group_paste(model->profile());
|
| + ScopedGroupBookmarkActions group_paste(model);
|
| #endif
|
| CloneBookmarkNode(model, bookmark_data.elements, parent, index, true);
|
| }
|
| @@ -373,4 +374,25 @@ void RemoveAllBookmarks(BookmarkModel* model, const GURL& url) {
|
| }
|
| }
|
|
|
| +// ScopedGroupBookmarkActions -------------------------------------------------
|
| +
|
| +ScopedGroupBookmarkActions::ScopedGroupBookmarkActions(Profile* profile)
|
| + : model_(NULL) {
|
| + if (profile)
|
| + model_ = BookmarkModelFactory::GetForProfile(profile);
|
| + if (model_)
|
| + model_->BeginGroupedChanges();
|
| +}
|
| +
|
| +ScopedGroupBookmarkActions::ScopedGroupBookmarkActions(BookmarkModel* model)
|
| + : model_(model) {
|
| + if (model_)
|
| + model_->BeginGroupedChanges();
|
| +}
|
| +
|
| +ScopedGroupBookmarkActions::~ScopedGroupBookmarkActions() {
|
| + if (model_)
|
| + model_->EndGroupedChanges();
|
| +}
|
| +
|
| } // namespace bookmark_utils
|
|
|