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

Side by Side Diff: chrome/browser/undo/bookmark_undo_service.cc

Issue 297833006: Move ScopedGroupBookmarkActions into bookmarks namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/undo/bookmark_undo_service.h" 5 #include "chrome/browser/undo/bookmark_undo_service.h"
6 6
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/undo/bookmark_renumber_observer.h" 9 #include "chrome/browser/undo/bookmark_renumber_observer.h"
10 #include "chrome/browser/undo/bookmark_undo_service_factory.h" 10 #include "chrome/browser/undo/bookmark_undo_service_factory.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 int old_index, 427 int old_index,
428 const BookmarkNode* node) { 428 const BookmarkNode* node) {
429 scoped_ptr<UndoOperation> op(new BookmarkRemoveOperation(profile_, 429 scoped_ptr<UndoOperation> op(new BookmarkRemoveOperation(profile_,
430 parent, 430 parent,
431 old_index, 431 old_index,
432 node)); 432 node));
433 undo_manager()->AddUndoOperation(op.Pass()); 433 undo_manager()->AddUndoOperation(op.Pass());
434 } 434 }
435 435
436 void BookmarkUndoService::OnWillRemoveAllBookmarks(BookmarkModel* model) { 436 void BookmarkUndoService::OnWillRemoveAllBookmarks(BookmarkModel* model) {
437 ScopedGroupBookmarkActions merge_removes(model); 437 bookmarks::ScopedGroupBookmarkActions merge_removes(model);
438 for (int i = 0; i < model->root_node()->child_count(); ++i) { 438 for (int i = 0; i < model->root_node()->child_count(); ++i) {
439 const BookmarkNode* permanent_node = model->root_node()->GetChild(i); 439 const BookmarkNode* permanent_node = model->root_node()->GetChild(i);
440 for (int j = permanent_node->child_count() - 1; j >= 0; --j) { 440 for (int j = permanent_node->child_count() - 1; j >= 0; --j) {
441 scoped_ptr<UndoOperation> op(new BookmarkRemoveOperation(profile_, 441 scoped_ptr<UndoOperation> op(new BookmarkRemoveOperation(profile_,
442 permanent_node, j, permanent_node->GetChild(j))); 442 permanent_node, j, permanent_node->GetChild(j)));
443 undo_manager()->AddUndoOperation(op.Pass()); 443 undo_manager()->AddUndoOperation(op.Pass());
444 } 444 }
445 } 445 }
446 } 446 }
447 447
(...skipping 20 matching lines...) Expand all
468 468
469 void BookmarkUndoService::OnBookmarkRenumbered(int64 old_id, int64 new_id) { 469 void BookmarkUndoService::OnBookmarkRenumbered(int64 old_id, int64 new_id) {
470 std::vector<UndoOperation*> all_operations = 470 std::vector<UndoOperation*> all_operations =
471 undo_manager()->GetAllUndoOperations(); 471 undo_manager()->GetAllUndoOperations();
472 for (std::vector<UndoOperation*>::iterator it = all_operations.begin(); 472 for (std::vector<UndoOperation*>::iterator it = all_operations.begin();
473 it != all_operations.end(); ++it) { 473 it != all_operations.end(); ++it) {
474 static_cast<BookmarkUndoOperation*>(*it)->OnBookmarkRenumbered(old_id, 474 static_cast<BookmarkUndoOperation*>(*it)->OnBookmarkRenumbered(old_id,
475 new_id); 475 new_id);
476 } 476 }
477 } 477 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/bookmarks/bookmark_drag_drop.cc ('k') | components/bookmarks/browser/bookmark_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698