Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/browser/signin/easy_unlock_service.cc

Issue 834233005: Make Easy Unlock app have separate instance in incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/easy_unlock/manifest_signin.json ('k') | chrome/browser/signin/easy_unlock_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698