| 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/ui/webui/cookies_tree_model_util.h" | 5 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include <vector> | 8 #include <vector> |
| 8 | 9 |
| 9 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 17 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 18 #include "chrome/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
| 19 #include "content/public/browser/cache_storage_context.h" | 19 #include "content/public/browser/cache_storage_context.h" |
| 20 #include "content/public/browser/indexed_db_context.h" | 20 #include "content/public/browser/indexed_db_context.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 #endif | 318 #endif |
| 319 | 319 |
| 320 return true; | 320 return true; |
| 321 } | 321 } |
| 322 | 322 |
| 323 void CookiesTreeModelUtil::GetChildNodeList(const CookieTreeNode* parent, | 323 void CookiesTreeModelUtil::GetChildNodeList(const CookieTreeNode* parent, |
| 324 int start, | 324 int start, |
| 325 int count, | 325 int count, |
| 326 base::ListValue* nodes) { | 326 base::ListValue* nodes) { |
| 327 for (int i = 0; i < count; ++i) { | 327 for (int i = 0; i < count; ++i) { |
| 328 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); | 328 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue); |
| 329 const CookieTreeNode* child = parent->GetChild(start + i); | 329 const CookieTreeNode* child = parent->GetChild(start + i); |
| 330 if (GetCookieTreeNodeDictionary(*child, dict.get())) | 330 if (GetCookieTreeNodeDictionary(*child, dict.get())) |
| 331 nodes->Append(dict.release()); | 331 nodes->Append(dict.release()); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 const CookieTreeNode* CookiesTreeModelUtil::GetTreeNodeFromPath( | 335 const CookieTreeNode* CookiesTreeModelUtil::GetTreeNodeFromPath( |
| 336 const CookieTreeNode* root, | 336 const CookieTreeNode* root, |
| 337 const std::string& path) { | 337 const std::string& path) { |
| 338 const CookieTreeNode* child = NULL; | 338 const CookieTreeNode* child = NULL; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 349 child = id_map_.Lookup(node_id); | 349 child = id_map_.Lookup(node_id); |
| 350 child_index = parent->GetIndexOf(child); | 350 child_index = parent->GetIndexOf(child); |
| 351 if (child_index == -1) | 351 if (child_index == -1) |
| 352 break; | 352 break; |
| 353 | 353 |
| 354 parent = child; | 354 parent = child; |
| 355 } | 355 } |
| 356 | 356 |
| 357 return child_index >= 0 ? child : NULL; | 357 return child_index >= 0 ? child : NULL; |
| 358 } | 358 } |
| OLD | NEW |