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 <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 break; | 302 break; |
303 } | 303 } |
304 | 304 |
305 #if defined(ENABLE_EXTENSIONS) | 305 #if defined(ENABLE_EXTENSIONS) |
306 const extensions::ExtensionSet* protecting_apps = | 306 const extensions::ExtensionSet* protecting_apps = |
307 node.GetModel()->ExtensionsProtectingNode(node); | 307 node.GetModel()->ExtensionsProtectingNode(node); |
308 if (protecting_apps && !protecting_apps->is_empty()) { | 308 if (protecting_apps && !protecting_apps->is_empty()) { |
309 base::ListValue* app_infos = new base::ListValue; | 309 base::ListValue* app_infos = new base::ListValue; |
310 for (extensions::ExtensionSet::const_iterator it = protecting_apps->begin(); | 310 for (extensions::ExtensionSet::const_iterator it = protecting_apps->begin(); |
311 it != protecting_apps->end(); ++it) { | 311 it != protecting_apps->end(); ++it) { |
312 base::DictionaryValue* app_info = new base::DictionaryValue(); | 312 std::unique_ptr<base::DictionaryValue> app_info( |
| 313 new base::DictionaryValue()); |
313 app_info->SetString(kKeyId, (*it)->id()); | 314 app_info->SetString(kKeyId, (*it)->id()); |
314 app_info->SetString(kKeyName, (*it)->name()); | 315 app_info->SetString(kKeyName, (*it)->name()); |
315 app_infos->Append(app_info); | 316 app_infos->Append(std::move(app_info)); |
316 } | 317 } |
317 dict->Set(kKeyAppsProtectingThis, app_infos); | 318 dict->Set(kKeyAppsProtectingThis, app_infos); |
318 } | 319 } |
319 #endif | 320 #endif |
320 | 321 |
321 return true; | 322 return true; |
322 } | 323 } |
323 | 324 |
324 void CookiesTreeModelUtil::GetChildNodeList(const CookieTreeNode* parent, | 325 void CookiesTreeModelUtil::GetChildNodeList(const CookieTreeNode* parent, |
325 int start, | 326 int start, |
(...skipping 24 matching lines...) Expand all Loading... |
350 child = id_map_.Lookup(node_id); | 351 child = id_map_.Lookup(node_id); |
351 child_index = parent->GetIndexOf(child); | 352 child_index = parent->GetIndexOf(child); |
352 if (child_index == -1) | 353 if (child_index == -1) |
353 break; | 354 break; |
354 | 355 |
355 parent = child; | 356 parent = child; |
356 } | 357 } |
357 | 358 |
358 return child_index >= 0 ? child : NULL; | 359 return child_index >= 0 ? child : NULL; |
359 } | 360 } |
OLD | NEW |