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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 Add(IDR_CHROMEVOX_MANIFEST, path); | 499 Add(IDR_CHROMEVOX_MANIFEST, path); |
500 } | 500 } |
501 #endif // defined(OS_CHROMEOS) | 501 #endif // defined(OS_CHROMEOS) |
502 | 502 |
503 #if defined(ENABLE_GOOGLE_NOW) | 503 #if defined(ENABLE_GOOGLE_NOW) |
504 const char kEnablePrefix[] = "Enable"; | 504 const char kEnablePrefix[] = "Enable"; |
505 const char kFieldTrialName[] = "GoogleNow"; | 505 const char kFieldTrialName[] = "GoogleNow"; |
506 std::string enable_prefix(kEnablePrefix); | 506 std::string enable_prefix(kEnablePrefix); |
507 std::string field_trial_result = | 507 std::string field_trial_result = |
508 base::FieldTrialList::FindFullName(kFieldTrialName); | 508 base::FieldTrialList::FindFullName(kFieldTrialName); |
509 if ((field_trial_result.compare( | 509 if (((field_trial_result.compare( |
510 0, | 510 0, |
511 enable_prefix.length(), | 511 enable_prefix.length(), |
512 enable_prefix) == 0) || | 512 enable_prefix) == 0) && |
513 CommandLine::ForCurrentProcess()->HasSwitch( | 513 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 514 switches::kDisableGoogleNowIntegration)) || |
| 515 CommandLine::ForCurrentProcess()->HasSwitch( |
514 switches::kEnableGoogleNowIntegration)) { | 516 switches::kEnableGoogleNowIntegration)) { |
515 Add(IDR_GOOGLE_NOW_MANIFEST, | 517 Add(IDR_GOOGLE_NOW_MANIFEST, |
516 base::FilePath(FILE_PATH_LITERAL("google_now"))); | 518 base::FilePath(FILE_PATH_LITERAL("google_now"))); |
517 } | 519 } |
518 #endif | 520 #endif |
519 } | 521 } |
520 | 522 |
521 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 523 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
522 delete component->manifest; | 524 delete component->manifest; |
523 if (extension_service_->is_ready()) { | 525 if (extension_service_->is_ready()) { |
524 extension_service_-> | 526 extension_service_-> |
525 RemoveComponentExtension(component->extension_id); | 527 RemoveComponentExtension(component->extension_id); |
526 } | 528 } |
527 } | 529 } |
528 | 530 |
529 } // namespace extensions | 531 } // namespace extensions |
OLD | NEW |