| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 if (allowed_types_pref) { | 383 if (allowed_types_pref) { |
| 384 global_settings_->has_restricted_allowed_types = true; | 384 global_settings_->has_restricted_allowed_types = true; |
| 385 for (base::ListValue::const_iterator it = allowed_types_pref->begin(); | 385 for (base::ListValue::const_iterator it = allowed_types_pref->begin(); |
| 386 it != allowed_types_pref->end(); ++it) { | 386 it != allowed_types_pref->end(); ++it) { |
| 387 int int_value; | 387 int int_value; |
| 388 std::string string_value; | 388 std::string string_value; |
| 389 if (it->GetAsInteger(&int_value) && int_value >= 0 && | 389 if (it->GetAsInteger(&int_value) && int_value >= 0 && |
| 390 int_value < Manifest::Type::NUM_LOAD_TYPES) { | 390 int_value <= Manifest::Type::TYPE_MAX) { |
| 391 global_settings_->allowed_types.push_back( | 391 global_settings_->allowed_types.push_back( |
| 392 static_cast<Manifest::Type>(int_value)); | 392 static_cast<Manifest::Type>(int_value)); |
| 393 } else if (it->GetAsString(&string_value)) { | 393 } else if (it->GetAsString(&string_value)) { |
| 394 Manifest::Type manifest_type = | 394 Manifest::Type manifest_type = |
| 395 schema_constants::GetManifestType(string_value); | 395 schema_constants::GetManifestType(string_value); |
| 396 if (manifest_type != Manifest::TYPE_UNKNOWN) | 396 if (manifest_type != Manifest::TYPE_UNKNOWN) |
| 397 global_settings_->allowed_types.push_back(manifest_type); | 397 global_settings_->allowed_types.push_back(manifest_type); |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 } | 400 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 content::BrowserContext* context) const { | 560 content::BrowserContext* context) const { |
| 561 return chrome::GetBrowserContextRedirectedInIncognito(context); | 561 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void ExtensionManagementFactory::RegisterProfilePrefs( | 564 void ExtensionManagementFactory::RegisterProfilePrefs( |
| 565 user_prefs::PrefRegistrySyncable* user_prefs) { | 565 user_prefs::PrefRegistrySyncable* user_prefs) { |
| 566 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement); | 566 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement); |
| 567 } | 567 } |
| 568 | 568 |
| 569 } // namespace extensions | 569 } // namespace extensions |
| OLD | NEW |