| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 namespace SortChildren = api::bookmark_manager_private::SortChildren; | 61 namespace SortChildren = api::bookmark_manager_private::SortChildren; |
| 62 namespace StartDrag = api::bookmark_manager_private::StartDrag; | 62 namespace StartDrag = api::bookmark_manager_private::StartDrag; |
| 63 namespace UndoInfo = api::bookmark_manager_private::GetUndoInfo; | 63 namespace UndoInfo = api::bookmark_manager_private::GetUndoInfo; |
| 64 | 64 |
| 65 using content::WebContents; | 65 using content::WebContents; |
| 66 | 66 |
| 67 namespace { | 67 namespace { |
| 68 | 68 |
| 69 // Returns a single bookmark node from the argument ID. | 69 // Returns a single bookmark node from the argument ID. |
| 70 // This returns NULL in case of failure. | 70 // This returns NULL in case of failure. |
| 71 const BookmarkNode* GetNodeFromString( | 71 const BookmarkNode* GetNodeFromString(BookmarkModel* model, |
| 72 BookmarkModel* model, const std::string& id_string) { | 72 const std::string& id_string) { |
| 73 int64 id; | 73 int64 id; |
| 74 if (!base::StringToInt64(id_string, &id)) | 74 if (!base::StringToInt64(id_string, &id)) |
| 75 return NULL; | 75 return NULL; |
| 76 return model->GetNodeByID(id); | 76 return GetBookmarkNodeByID(model, id); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Gets a vector of bookmark nodes from the argument list of IDs. | 79 // Gets a vector of bookmark nodes from the argument list of IDs. |
| 80 // This returns false in the case of failure. | 80 // This returns false in the case of failure. |
| 81 bool GetNodesFromVector(BookmarkModel* model, | 81 bool GetNodesFromVector(BookmarkModel* model, |
| 82 const std::vector<std::string>& id_strings, | 82 const std::vector<std::string>& id_strings, |
| 83 std::vector<const BookmarkNode*>* nodes) { | 83 std::vector<const BookmarkNode*>* nodes) { |
| 84 | 84 |
| 85 if (id_strings.empty()) | 85 if (id_strings.empty()) |
| 86 return false; | 86 return false; |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 result.enabled = undo_manager->redo_count() > 0; | 705 result.enabled = undo_manager->redo_count() > 0; |
| 706 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel()); | 706 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel()); |
| 707 | 707 |
| 708 results_ = RedoInfo::Results::Create(result); | 708 results_ = RedoInfo::Results::Create(result); |
| 709 #endif // !defined(OS_ANDROID) | 709 #endif // !defined(OS_ANDROID) |
| 710 | 710 |
| 711 return true; | 711 return true; |
| 712 } | 712 } |
| 713 | 713 |
| 714 } // namespace extensions | 714 } // namespace extensions |
| OLD | NEW |