OLD | NEW |
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" |
11 #include "chrome/browser/undo/undo_operation.h" | 11 #include "chrome/browser/undo/undo_operation.h" |
12 #include "components/bookmarks/core/browser/bookmark_model.h" | 12 #include "components/bookmarks/browser/bookmark_model.h" |
13 #include "components/bookmarks/core/browser/bookmark_node_data.h" | 13 #include "components/bookmarks/browser/bookmark_node_data.h" |
14 #include "components/bookmarks/core/browser/bookmark_utils.h" | 14 #include "components/bookmarks/browser/bookmark_utils.h" |
15 #include "components/bookmarks/core/browser/scoped_group_bookmark_actions.h" | 15 #include "components/bookmarks/browser/scoped_group_bookmark_actions.h" |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // BookmarkUndoOperation ------------------------------------------------------ | 21 // BookmarkUndoOperation ------------------------------------------------------ |
22 | 22 |
23 // Base class for all bookmark related UndoOperations that facilitates access to | 23 // Base class for all bookmark related UndoOperations that facilitates access to |
24 // the BookmarkUndoService. | 24 // the BookmarkUndoService. |
25 class BookmarkUndoOperation : public UndoOperation, | 25 class BookmarkUndoOperation : public UndoOperation, |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |