| 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_manager_extension_api.h" | 5 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 if (!base::StringToInt64(id_string, &id)) | 50 if (!base::StringToInt64(id_string, &id)) |
| 51 return NULL; | 51 return NULL; |
| 52 return model->GetNodeByID(id); | 52 return model->GetNodeByID(id); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Gets a vector of bookmark nodes from the argument list of IDs. | 55 // Gets a vector of bookmark nodes from the argument list of IDs. |
| 56 // This returns false in the case of failure. | 56 // This returns false in the case of failure. |
| 57 bool GetNodesFromArguments(BookmarkModel* model, const ListValue* args, | 57 bool GetNodesFromArguments(BookmarkModel* model, const ListValue* args, |
| 58 size_t args_index, std::vector<const BookmarkNode*>* nodes) { | 58 size_t args_index, std::vector<const BookmarkNode*>* nodes) { |
| 59 | 59 |
| 60 ListValue* ids; | 60 const ListValue* ids; |
| 61 if (!args->GetList(args_index, &ids)) | 61 if (!args->GetList(args_index, &ids)) |
| 62 return false; | 62 return false; |
| 63 | 63 |
| 64 size_t count = ids->GetSize(); | 64 size_t count = ids->GetSize(); |
| 65 if (count == 0) | 65 if (count == 0) |
| 66 return false; | 66 return false; |
| 67 | 67 |
| 68 for (size_t i = 0; i < count; ++i) { | 68 for (size_t i = 0; i < count; ++i) { |
| 69 std::string id_string; | 69 std::string id_string; |
| 70 if (!ids->GetString(i, &id_string)) | 70 if (!ids->GetString(i, &id_string)) |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 bool can_open_new_windows = true; | 509 bool can_open_new_windows = true; |
| 510 | 510 |
| 511 #if defined(OS_WIN) | 511 #if defined(OS_WIN) |
| 512 if (base::win::IsMetroProcess()) | 512 if (base::win::IsMetroProcess()) |
| 513 can_open_new_windows = false; | 513 can_open_new_windows = false; |
| 514 #endif // OS_WIN | 514 #endif // OS_WIN |
| 515 | 515 |
| 516 SetResult(Value::CreateBooleanValue(can_open_new_windows)); | 516 SetResult(Value::CreateBooleanValue(can_open_new_windows)); |
| 517 return true; | 517 return true; |
| 518 } | 518 } |
| OLD | NEW |