| 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 <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 // Load ChromeVox extension now if spoken feedback is enabled. | 463 // Load ChromeVox extension now if spoken feedback is enabled. |
| 464 if (chromeos::AccessibilityManager::Get() && | 464 if (chromeos::AccessibilityManager::Get() && |
| 465 chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { | 465 chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { |
| 466 base::FilePath path = | 466 base::FilePath path = |
| 467 base::FilePath(extension_misc::kChromeVoxExtensionPath); | 467 base::FilePath(extension_misc::kChromeVoxExtensionPath); |
| 468 Add(IDR_CHROMEVOX_MANIFEST, path); | 468 Add(IDR_CHROMEVOX_MANIFEST, path); |
| 469 } | 469 } |
| 470 #endif // defined(OS_CHROMEOS) | 470 #endif // defined(OS_CHROMEOS) |
| 471 | 471 |
| 472 #if defined(ENABLE_GOOGLE_NOW) | 472 #if defined(ENABLE_GOOGLE_NOW) |
| 473 if (base::FieldTrialList::FindFullName("GoogleNow") == "Enable" || | 473 std::string enablePrefix("Enable"); |
| 474 std::string fieldTrialResult = |
| 475 base::FieldTrialList::FindFullName("GoogleNow"); |
| 476 if ((fieldTrialResult.compare(0, enablePrefix.length(), enablePrefix) == 0) || |
| 474 CommandLine::ForCurrentProcess()->HasSwitch( | 477 CommandLine::ForCurrentProcess()->HasSwitch( |
| 475 switches::kEnableGoogleNowIntegration)) { | 478 switches::kEnableGoogleNowIntegration)) { |
| 476 Add(IDR_GOOGLE_NOW_MANIFEST, | 479 Add(IDR_GOOGLE_NOW_MANIFEST, |
| 477 base::FilePath(FILE_PATH_LITERAL("google_now"))); | 480 base::FilePath(FILE_PATH_LITERAL("google_now"))); |
| 478 } | 481 } |
| 479 #endif | 482 #endif |
| 480 } | 483 } |
| 481 | 484 |
| 482 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 485 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
| 483 delete component->manifest; | 486 delete component->manifest; |
| 484 if (extension_service_->is_ready()) { | 487 if (extension_service_->is_ready()) { |
| 485 extension_service_-> | 488 extension_service_-> |
| 486 UnloadExtension(component->extension_id, | 489 UnloadExtension(component->extension_id, |
| 487 extension_misc::UNLOAD_REASON_DISABLE); | 490 extension_misc::UNLOAD_REASON_DISABLE); |
| 488 } | 491 } |
| 489 } | 492 } |
| 490 | 493 |
| 491 } // namespace extensions | 494 } // namespace extensions |
| OLD | NEW |