OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extension_management.h" | 5 #include "chrome/browser/extensions/extension_management.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } | 367 } |
368 | 368 |
369 if (dict_pref) { | 369 if (dict_pref) { |
370 // Parse new extension management preference. | 370 // Parse new extension management preference. |
371 for (base::DictionaryValue::Iterator iter(*dict_pref); !iter.IsAtEnd(); | 371 for (base::DictionaryValue::Iterator iter(*dict_pref); !iter.IsAtEnd(); |
372 iter.Advance()) { | 372 iter.Advance()) { |
373 if (iter.key() == schema_constants::kWildcard) | 373 if (iter.key() == schema_constants::kWildcard) |
374 continue; | 374 continue; |
375 if (!iter.value().GetAsDictionary(&subdict)) | 375 if (!iter.value().GetAsDictionary(&subdict)) |
376 continue; | 376 continue; |
377 if (base::StartsWithASCII(iter.key(), schema_constants::kUpdateUrlPrefix, | 377 if (base::StartsWith(iter.key(), schema_constants::kUpdateUrlPrefix, |
378 true)) { | 378 base::CompareCase::SENSITIVE)) { |
379 const std::string& update_url = | 379 const std::string& update_url = |
380 iter.key().substr(strlen(schema_constants::kUpdateUrlPrefix)); | 380 iter.key().substr(strlen(schema_constants::kUpdateUrlPrefix)); |
381 if (!GURL(update_url).is_valid()) { | 381 if (!GURL(update_url).is_valid()) { |
382 LOG(WARNING) << "Invalid update URL: " << update_url << "."; | 382 LOG(WARNING) << "Invalid update URL: " << update_url << "."; |
383 continue; | 383 continue; |
384 } | 384 } |
385 internal::IndividualSettings* by_update_url = | 385 internal::IndividualSettings* by_update_url = |
386 AccessByUpdateUrl(update_url); | 386 AccessByUpdateUrl(update_url); |
387 if (!by_update_url->Parse( | 387 if (!by_update_url->Parse( |
388 subdict, internal::IndividualSettings::SCOPE_UPDATE_URL)) { | 388 subdict, internal::IndividualSettings::SCOPE_UPDATE_URL)) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 content::BrowserContext* context) const { | 490 content::BrowserContext* context) const { |
491 return chrome::GetBrowserContextRedirectedInIncognito(context); | 491 return chrome::GetBrowserContextRedirectedInIncognito(context); |
492 } | 492 } |
493 | 493 |
494 void ExtensionManagementFactory::RegisterProfilePrefs( | 494 void ExtensionManagementFactory::RegisterProfilePrefs( |
495 user_prefs::PrefRegistrySyncable* user_prefs) { | 495 user_prefs::PrefRegistrySyncable* user_prefs) { |
496 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement); | 496 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement); |
497 } | 497 } |
498 | 498 |
499 } // namespace extensions | 499 } // namespace extensions |
OLD | NEW |