| 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/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 : manifest(manifest), | 62 : manifest(manifest), |
| 63 root_directory(directory) { | 63 root_directory(directory) { |
| 64 if (!root_directory.IsAbsolute()) { | 64 if (!root_directory.IsAbsolute()) { |
| 65 CHECK(PathService::Get(chrome::DIR_RESOURCES, &root_directory)); | 65 CHECK(PathService::Get(chrome::DIR_RESOURCES, &root_directory)); |
| 66 root_directory = root_directory.Append(directory); | 66 root_directory = root_directory.Append(directory); |
| 67 } | 67 } |
| 68 extension_id = GenerateId(manifest, root_directory); | 68 extension_id = GenerateId(manifest, root_directory); |
| 69 } | 69 } |
| 70 | 70 |
| 71 ComponentLoader::ComponentLoader(ExtensionServiceInterface* extension_service, | 71 ComponentLoader::ComponentLoader(ExtensionServiceInterface* extension_service, |
| 72 PrefService* prefs, | 72 PrefServiceSyncable* prefs, |
| 73 PrefService* local_state) | 73 PrefServiceSimple* local_state) |
| 74 : prefs_(prefs), | 74 : prefs_(prefs), |
| 75 local_state_(local_state), | 75 local_state_(local_state), |
| 76 extension_service_(extension_service) { | 76 extension_service_(extension_service) { |
| 77 pref_change_registrar_.Init(prefs); | 77 pref_change_registrar_.Init(prefs); |
| 78 | 78 |
| 79 // This pref is set by policy. We have to watch it for change because on | 79 // This pref is set by policy. We have to watch it for change because on |
| 80 // ChromeOS, policy isn't loaded until after the browser process is started. | 80 // ChromeOS, policy isn't loaded until after the browser process is started. |
| 81 pref_change_registrar_.Add( | 81 pref_change_registrar_.Add( |
| 82 prefs::kEnterpriseWebStoreURL, | 82 prefs::kEnterpriseWebStoreURL, |
| 83 base::Bind(&ComponentLoader::AddOrReloadEnterpriseWebStore, | 83 base::Bind(&ComponentLoader::AddOrReloadEnterpriseWebStore, |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 419 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
| 420 delete component->manifest; | 420 delete component->manifest; |
| 421 if (extension_service_->is_ready()) { | 421 if (extension_service_->is_ready()) { |
| 422 extension_service_-> | 422 extension_service_-> |
| 423 UnloadExtension(component->extension_id, | 423 UnloadExtension(component->extension_id, |
| 424 extension_misc::UNLOAD_REASON_DISABLE); | 424 extension_misc::UNLOAD_REASON_DISABLE); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 // static | 428 // static |
| 429 void ComponentLoader::RegisterUserPrefs(PrefService* prefs) { | 429 void ComponentLoader::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 430 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 430 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
| 431 std::string() /* default_value */, | 431 std::string() /* default_value */, |
| 432 PrefService::UNSYNCABLE_PREF); | 432 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 433 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 433 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
| 434 std::string() /* default_value */, | 434 std::string() /* default_value */, |
| 435 PrefService::UNSYNCABLE_PREF); | 435 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace extensions | 438 } // namespace extensions |
| OLD | NEW |