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

Unified Diff: chrome/browser/undo/bookmark_undo_service.cc

Issue 155913004: Eliminate Bookmarks dependence to bookmark_undo_utils.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for Android Unit Tests failing Created 6 years, 10 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/undo/bookmark_undo_service.h ('k') | chrome/browser/undo/bookmark_undo_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/undo/bookmark_undo_service.cc
diff --git a/chrome/browser/undo/bookmark_undo_service.cc b/chrome/browser/undo/bookmark_undo_service.cc
index 63de7e7285f92c248eb0d75d87a3a93c53d36f4e..cc3c959223434f70d64f9b1fd86d3e0cb456b597 100644
--- a/chrome/browser/undo/bookmark_undo_service.cc
+++ b/chrome/browser/undo/bookmark_undo_service.cc
@@ -8,10 +8,10 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
+#include "chrome/browser/bookmarks/scoped_group_bookmark_actions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/undo/bookmark_renumber_observer.h"
#include "chrome/browser/undo/bookmark_undo_service_factory.h"
-#include "chrome/browser/undo/bookmark_undo_utils.h"
#include "chrome/browser/undo/undo_operation.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -391,16 +391,6 @@ BookmarkUndoService::~BookmarkUndoService() {
BookmarkModelFactory::GetForProfile(profile_)->RemoveObserver(this);
}
-void BookmarkUndoService::OnBookmarkRenumbered(int64 old_id, int64 new_id) {
- std::vector<UndoOperation*> all_operations =
- undo_manager()->GetAllUndoOperations();
- for (std::vector<UndoOperation*>::iterator it = all_operations.begin();
- it != all_operations.end(); ++it) {
- static_cast<BookmarkUndoOperation*>(*it)->OnBookmarkRenumbered(old_id,
- new_id);
- }
-}
-
void BookmarkUndoService::BookmarkModelLoaded(BookmarkModel* model,
bool ids_reassigned) {
undo_manager_.RemoveAllOperations();
@@ -466,3 +456,23 @@ void BookmarkUndoService::OnWillReorderBookmarkNode(BookmarkModel* model,
scoped_ptr<UndoOperation> op(new BookmarkReorderOperation(profile_, node));
undo_manager()->AddUndoOperation(op.Pass());
}
+
+void BookmarkUndoService::GroupedBookmarkChangesBeginning(
+ BookmarkModel* model) {
+ undo_manager()->StartGroupingActions();
+}
+
+void BookmarkUndoService::GroupedBookmarkChangesEnded(BookmarkModel* model) {
+ undo_manager()->EndGroupingActions();
+}
+
+void BookmarkUndoService::OnBookmarkRenumbered(int64 old_id, int64 new_id) {
+ std::vector<UndoOperation*> all_operations =
+ undo_manager()->GetAllUndoOperations();
+ for (std::vector<UndoOperation*>::iterator it = all_operations.begin();
+ it != all_operations.end(); ++it) {
+ static_cast<BookmarkUndoOperation*>(*it)->OnBookmarkRenumbered(old_id,
+ new_id);
+ }
+}
+
« no previous file with comments | « chrome/browser/undo/bookmark_undo_service.h ('k') | chrome/browser/undo/bookmark_undo_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698