| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" | 5 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 SetResult(new base::FundamentalValue(can_open_new_windows)); | 725 SetResult(new base::FundamentalValue(can_open_new_windows)); |
| 726 return true; | 726 return true; |
| 727 } | 727 } |
| 728 | 728 |
| 729 bool BookmarkManagerPrivateRemoveTreesFunction::RunOnReady() { | 729 bool BookmarkManagerPrivateRemoveTreesFunction::RunOnReady() { |
| 730 scoped_ptr<RemoveTrees::Params> params(RemoveTrees::Params::Create(*args_)); | 730 scoped_ptr<RemoveTrees::Params> params(RemoveTrees::Params::Create(*args_)); |
| 731 EXTENSION_FUNCTION_VALIDATE(params); | 731 EXTENSION_FUNCTION_VALIDATE(params); |
| 732 | 732 |
| 733 BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile()); | 733 BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile()); |
| 734 #if !defined(OS_ANDROID) | 734 #if !defined(OS_ANDROID) |
| 735 ScopedGroupBookmarkActions group_deletes(model); | 735 bookmarks::ScopedGroupBookmarkActions group_deletes(model); |
| 736 #endif | 736 #endif |
| 737 int64 id; | 737 int64 id; |
| 738 for (size_t i = 0; i < params->id_list.size(); ++i) { | 738 for (size_t i = 0; i < params->id_list.size(); ++i) { |
| 739 if (!GetBookmarkIdAsInt64(params->id_list[i], &id)) | 739 if (!GetBookmarkIdAsInt64(params->id_list[i], &id)) |
| 740 return false; | 740 return false; |
| 741 if (!bookmark_api_helpers::RemoveNode(model, id, true, &error_)) | 741 if (!bookmark_api_helpers::RemoveNode(model, id, true, &error_)) |
| 742 return false; | 742 return false; |
| 743 } | 743 } |
| 744 | 744 |
| 745 return true; | 745 return true; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 result.enabled = undo_manager->redo_count() > 0; | 787 result.enabled = undo_manager->redo_count() > 0; |
| 788 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel()); | 788 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel()); |
| 789 | 789 |
| 790 results_ = RedoInfo::Results::Create(result); | 790 results_ = RedoInfo::Results::Create(result); |
| 791 #endif // !defined(OS_ANDROID) | 791 #endif // !defined(OS_ANDROID) |
| 792 | 792 |
| 793 return true; | 793 return true; |
| 794 } | 794 } |
| 795 | 795 |
| 796 } // namespace extensions | 796 } // namespace extensions |
| OLD | NEW |