| 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/bookmarks/bookmark_extension_helpers.h" | 5 #include "chrome/browser/bookmarks/bookmark_extension_helpers.h" |
| 6 | 6 |
| 7 #include <math.h> // For floor() | 7 #include <math.h> // For floor() |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 bool only_folders) { | 26 bool only_folders) { |
| 27 if (node->IsVisible()) { | 27 if (node->IsVisible()) { |
| 28 linked_ptr<BookmarkTreeNode> new_node( | 28 linked_ptr<BookmarkTreeNode> new_node( |
| 29 bookmark_extension_helpers::GetBookmarkTreeNode(node, | 29 bookmark_extension_helpers::GetBookmarkTreeNode(node, |
| 30 recurse, | 30 recurse, |
| 31 only_folders)); | 31 only_folders)); |
| 32 nodes->push_back(new_node); | 32 nodes->push_back(new_node); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 // TODO(mwrosen): Remove this function once chrome.experimental.bookmarkManager | 36 // TODO(mwrosen): Remove this function once chrome.bookmarkManagerPrivate is |
| 37 // is refactored to use the JSON schema compiler. | 37 // refactored to use the JSON schema compiler. |
| 38 void AddNode(const BookmarkNode* node, | 38 void AddNode(const BookmarkNode* node, |
| 39 base::ListValue* list, | 39 base::ListValue* list, |
| 40 bool recurse, | 40 bool recurse, |
| 41 bool only_folders) { | 41 bool only_folders) { |
| 42 if (node->IsVisible()) { | 42 if (node->IsVisible()) { |
| 43 base::DictionaryValue* dict = bookmark_extension_helpers::GetNodeDictionary( | 43 base::DictionaryValue* dict = bookmark_extension_helpers::GetNodeDictionary( |
| 44 node, recurse, only_folders); | 44 node, recurse, only_folders); |
| 45 list->Append(dict); | 45 list->Append(dict); |
| 46 } | 46 } |
| 47 } | 47 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 *error = keys::kFolderNotEmptyError; | 180 *error = keys::kFolderNotEmptyError; |
| 181 return false; | 181 return false; |
| 182 } | 182 } |
| 183 | 183 |
| 184 const BookmarkNode* parent = node->parent(); | 184 const BookmarkNode* parent = node->parent(); |
| 185 model->Remove(parent, parent->GetIndexOf(node)); | 185 model->Remove(parent, parent->GetIndexOf(node)); |
| 186 return true; | 186 return true; |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace bookmark_extension_helpers | 189 } // namespace bookmark_extension_helpers |
| OLD | NEW |