| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 Add(IDR_ECHO_MANIFEST, echo_extension_path); | 408 Add(IDR_ECHO_MANIFEST, echo_extension_path); |
| 409 } | 409 } |
| 410 | 410 |
| 411 // Load ChromeVox extension now if spoken feedback is enabled. | 411 // Load ChromeVox extension now if spoken feedback is enabled. |
| 412 if (local_state_->GetBoolean(prefs::kSpokenFeedbackEnabled)) { | 412 if (local_state_->GetBoolean(prefs::kSpokenFeedbackEnabled)) { |
| 413 FilePath path = FilePath(extension_misc::kChromeVoxExtensionPath); | 413 FilePath path = FilePath(extension_misc::kChromeVoxExtensionPath); |
| 414 Add(IDR_CHROMEVOX_MANIFEST, path); | 414 Add(IDR_CHROMEVOX_MANIFEST, path); |
| 415 } | 415 } |
| 416 #endif | 416 #endif |
| 417 | 417 |
| 418 #if defined(ENABLE_GOOGLE_NOW) |
| 419 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 420 switches::kEnableGoogleNowIntegration)) { |
| 421 Add(IDR_GOOGLE_NOW_MANIFEST, FilePath(FILE_PATH_LITERAL("google_now"))); |
| 422 } |
| 423 #endif |
| 418 } | 424 } |
| 419 | 425 |
| 420 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 426 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
| 421 delete component->manifest; | 427 delete component->manifest; |
| 422 if (extension_service_->is_ready()) { | 428 if (extension_service_->is_ready()) { |
| 423 extension_service_-> | 429 extension_service_-> |
| 424 UnloadExtension(component->extension_id, | 430 UnloadExtension(component->extension_id, |
| 425 extension_misc::UNLOAD_REASON_DISABLE); | 431 extension_misc::UNLOAD_REASON_DISABLE); |
| 426 } | 432 } |
| 427 } | 433 } |
| 428 | 434 |
| 429 // static | 435 // static |
| 430 void ComponentLoader::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 436 void ComponentLoader::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 431 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 437 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
| 432 std::string() /* default_value */, | 438 std::string() /* default_value */, |
| 433 PrefServiceSyncable::UNSYNCABLE_PREF); | 439 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 434 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 440 prefs->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
| 435 std::string() /* default_value */, | 441 std::string() /* default_value */, |
| 436 PrefServiceSyncable::UNSYNCABLE_PREF); | 442 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 437 } | 443 } |
| 438 | 444 |
| 439 } // namespace extensions | 445 } // namespace extensions |
| OLD | NEW |