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 enable_prefix("Enable"); |
474 std::string field_trial_result = | |
475 base::FieldTrialList::FindFullName("GoogleNow"); | |
miket_OOO
2013/08/13 16:59:37
Can these be const? It might enable some simpler c
| |
476 if ((field_trial_result.compare( | |
477 0, | |
478 enable_prefix.length(), | |
479 enable_prefix) == 0) || | |
474 CommandLine::ForCurrentProcess()->HasSwitch( | 480 CommandLine::ForCurrentProcess()->HasSwitch( |
475 switches::kEnableGoogleNowIntegration)) { | 481 switches::kEnableGoogleNowIntegration)) { |
476 Add(IDR_GOOGLE_NOW_MANIFEST, | 482 Add(IDR_GOOGLE_NOW_MANIFEST, |
477 base::FilePath(FILE_PATH_LITERAL("google_now"))); | 483 base::FilePath(FILE_PATH_LITERAL("google_now"))); |
478 } | 484 } |
479 #endif | 485 #endif |
480 } | 486 } |
481 | 487 |
482 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 488 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
483 delete component->manifest; | 489 delete component->manifest; |
484 if (extension_service_->is_ready()) { | 490 if (extension_service_->is_ready()) { |
485 extension_service_-> | 491 extension_service_-> |
486 UnloadExtension(component->extension_id, | 492 UnloadExtension(component->extension_id, |
487 extension_misc::UNLOAD_REASON_DISABLE); | 493 extension_misc::UNLOAD_REASON_DISABLE); |
488 } | 494 } |
489 } | 495 } |
490 | 496 |
491 } // namespace extensions | 497 } // namespace extensions |
OLD | NEW |