OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/signin/easy_unlock_service.h" | 5 #include "chrome/browser/signin/easy_unlock_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 const base::CommandLine* command_line = | 517 const base::CommandLine* command_line = |
518 base::CommandLine::ForCurrentProcess(); | 518 base::CommandLine::ForCurrentProcess(); |
519 if (command_line->HasSwitch(switches::kEasyUnlockAppPath)) { | 519 if (command_line->HasSwitch(switches::kEasyUnlockAppPath)) { |
520 easy_unlock_path = | 520 easy_unlock_path = |
521 command_line->GetSwitchValuePath(switches::kEasyUnlockAppPath); | 521 command_line->GetSwitchValuePath(switches::kEasyUnlockAppPath); |
522 } | 522 } |
523 #endif // !defined(NDEBUG) | 523 #endif // !defined(NDEBUG) |
524 | 524 |
525 if (!easy_unlock_path.empty()) { | 525 if (!easy_unlock_path.empty()) { |
526 extensions::ComponentLoader* loader = GetComponentLoader(profile_); | 526 extensions::ComponentLoader* loader = GetComponentLoader(profile_); |
527 if (!loader->Exists(extension_misc::kEasyUnlockAppId)) | 527 if (!loader->Exists(extension_misc::kEasyUnlockAppId)) { |
528 loader->Add(IDR_EASY_UNLOCK_MANIFEST, easy_unlock_path); | 528 int manifest_id = |
| 529 GetType() == TYPE_REGULAR ? IDR_EASY_UNLOCK_MANIFEST : |
| 530 IDR_EASY_UNLOCK_MANIFEST_SIGNIN; |
| 531 loader->Add(manifest_id, easy_unlock_path); |
| 532 } |
529 | 533 |
530 ExtensionService* extension_service = | 534 ExtensionService* extension_service = |
531 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 535 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
532 extension_service->EnableExtension(extension_misc::kEasyUnlockAppId); | 536 extension_service->EnableExtension(extension_misc::kEasyUnlockAppId); |
533 | 537 |
534 NotifyUserUpdated(); | 538 NotifyUserUpdated(); |
535 } | 539 } |
536 #endif // defined(GOOGLE_CHROME_BUILD) | 540 #endif // defined(GOOGLE_CHROME_BUILD) |
537 } | 541 } |
538 | 542 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 723 |
720 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 724 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
721 // failed. | 725 // failed. |
722 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 726 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
723 ->PrepareTpmKey(true /* check_private_key */, | 727 ->PrepareTpmKey(true /* check_private_key */, |
724 base::Closure()); | 728 base::Closure()); |
725 #endif // defined(OS_CHROMEOS) | 729 #endif // defined(OS_CHROMEOS) |
726 | 730 |
727 tpm_key_checked_ = true; | 731 tpm_key_checked_ = true; |
728 } | 732 } |
OLD | NEW |