| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
| 10 #include "base/memory/scoped_ptr.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 "chrome/browser/browsing_data/cookies_tree_model.h" | 16 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 17 #include "content/public/browser/indexed_db_context.h" | 17 #include "content/public/browser/indexed_db_context.h" |
| 18 #include "extensions/common/extension_set.h" |
| 18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 19 #include "net/cookies/canonical_cookie.h" | 20 #include "net/cookies/canonical_cookie.h" |
| 20 #include "net/ssl/ssl_client_cert_type.h" | 21 #include "net/ssl/ssl_client_cert_type.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/base/text/bytes_formatting.h" | 23 #include "ui/base/text/bytes_formatting.h" |
| 23 #include "webkit/common/fileapi/file_system_types.h" | 24 #include "webkit/common/fileapi/file_system_types.h" |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 | 27 |
| 27 const char kKeyId[] = "id"; | 28 const char kKeyId[] = "id"; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 262 |
| 262 dict->SetString(kKeyDomain, node.GetDetailedInfo().flash_lso_domain); | 263 dict->SetString(kKeyDomain, node.GetDetailedInfo().flash_lso_domain); |
| 263 } | 264 } |
| 264 default: | 265 default: |
| 265 #if defined(OS_MACOSX) | 266 #if defined(OS_MACOSX) |
| 266 dict->SetString(kKeyIcon, "chrome://theme/IDR_BOOKMARK_BAR_FOLDER"); | 267 dict->SetString(kKeyIcon, "chrome://theme/IDR_BOOKMARK_BAR_FOLDER"); |
| 267 #endif | 268 #endif |
| 268 break; | 269 break; |
| 269 } | 270 } |
| 270 | 271 |
| 271 const ExtensionSet* protecting_apps = | 272 const extensions::ExtensionSet* protecting_apps = |
| 272 node.GetModel()->ExtensionsProtectingNode(node); | 273 node.GetModel()->ExtensionsProtectingNode(node); |
| 273 if (protecting_apps && !protecting_apps->is_empty()) { | 274 if (protecting_apps && !protecting_apps->is_empty()) { |
| 274 base::ListValue* app_infos = new base::ListValue; | 275 base::ListValue* app_infos = new base::ListValue; |
| 275 for (ExtensionSet::const_iterator it = protecting_apps->begin(); | 276 for (extensions::ExtensionSet::const_iterator it = protecting_apps->begin(); |
| 276 it != protecting_apps->end(); ++it) { | 277 it != protecting_apps->end(); ++it) { |
| 277 base::DictionaryValue* app_info = new base::DictionaryValue(); | 278 base::DictionaryValue* app_info = new base::DictionaryValue(); |
| 278 app_info->SetString(kKeyId, (*it)->id()); | 279 app_info->SetString(kKeyId, (*it)->id()); |
| 279 app_info->SetString(kKeyName, (*it)->name()); | 280 app_info->SetString(kKeyName, (*it)->name()); |
| 280 app_infos->Append(app_info); | 281 app_infos->Append(app_info); |
| 281 } | 282 } |
| 282 dict->Set(kKeyAppsProtectingThis, app_infos); | 283 dict->Set(kKeyAppsProtectingThis, app_infos); |
| 283 } | 284 } |
| 284 | 285 |
| 285 return true; | 286 return true; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 316 child = id_map_.Lookup(node_id); | 317 child = id_map_.Lookup(node_id); |
| 317 child_index = parent->GetIndexOf(child); | 318 child_index = parent->GetIndexOf(child); |
| 318 if (child_index == -1) | 319 if (child_index == -1) |
| 319 break; | 320 break; |
| 320 | 321 |
| 321 parent = child; | 322 parent = child; |
| 322 } | 323 } |
| 323 | 324 |
| 324 return child_index >= 0 ? child : NULL; | 325 return child_index >= 0 ? child : NULL; |
| 325 } | 326 } |
| OLD | NEW |