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 const char kEnablePrefix[] = "Enable"; |
| 474 const char kFieldTrialName[] = "GoogleNow"; |
| 475 std::string enable_prefix(kEnablePrefix); |
| 476 std::string field_trial_result = |
| 477 base::FieldTrialList::FindFullName(kFieldTrialName); |
| 478 if ((field_trial_result.compare( |
| 479 0, |
| 480 enable_prefix.length(), |
| 481 enable_prefix) == 0) || |
474 CommandLine::ForCurrentProcess()->HasSwitch( | 482 CommandLine::ForCurrentProcess()->HasSwitch( |
475 switches::kEnableGoogleNowIntegration)) { | 483 switches::kEnableGoogleNowIntegration)) { |
476 Add(IDR_GOOGLE_NOW_MANIFEST, | 484 Add(IDR_GOOGLE_NOW_MANIFEST, |
477 base::FilePath(FILE_PATH_LITERAL("google_now"))); | 485 base::FilePath(FILE_PATH_LITERAL("google_now"))); |
478 } | 486 } |
479 #endif | 487 #endif |
480 } | 488 } |
481 | 489 |
482 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 490 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
483 delete component->manifest; | 491 delete component->manifest; |
484 if (extension_service_->is_ready()) { | 492 if (extension_service_->is_ready()) { |
485 extension_service_-> | 493 extension_service_-> |
486 UnloadExtension(component->extension_id, | 494 UnloadExtension(component->extension_id, |
487 extension_misc::UNLOAD_REASON_DISABLE); | 495 extension_misc::UNLOAD_REASON_DISABLE); |
488 } | 496 } |
489 } | 497 } |
490 | 498 |
491 } // namespace extensions | 499 } // namespace extensions |
OLD | NEW |