OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/lock_screen_apps/app_manager_impl.h" |
| 6 |
| 7 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 8 |
| 9 namespace lock_screen_apps { |
| 10 |
| 11 AppManagerImpl::AppManagerImpl() = default; |
| 12 |
| 13 AppManagerImpl::~AppManagerImpl() = default; |
| 14 |
| 15 void AppManagerImpl::Initialize(Profile* primary_profile, |
| 16 Profile* lock_screen_profile) { |
| 17 DCHECK(primary_profile); |
| 18 DCHECK(lock_screen_profile); |
| 19 DCHECK_NE(primary_profile, lock_screen_profile); |
| 20 // Do not use OTR profile for lock screen apps. This is important for |
| 21 // profile usage in |LaunchNoteTaking| - lock screen app background page runs |
| 22 // in original, non off the record profile, so the launch event has to be |
| 23 // dispatched to that profile. For other |lock_screen_profile_|, it makes no |
| 24 // difference - the profile is used to get browser context keyed services, all |
| 25 // of which redirect OTR profile to the original one. |
| 26 DCHECK(!lock_screen_profile->IsOffTheRecord()); |
| 27 |
| 28 CHECK(!chromeos::ProfileHelper::Get()->GetUserByProfile(lock_screen_profile)) |
| 29 << "Lock screen profile should not be associated with any users."; |
| 30 |
| 31 primary_profile_ = primary_profile; |
| 32 lock_screen_profile_ = lock_screen_profile; |
| 33 } |
| 34 |
| 35 void AppManagerImpl::Start(const base::Closure& note_taking_changed_callback) { |
| 36 note_taking_changed_callback_ = note_taking_changed_callback; |
| 37 } |
| 38 |
| 39 void AppManagerImpl::Stop() {} |
| 40 |
| 41 bool AppManagerImpl::IsNoteTakingAppAvailable() const { |
| 42 return false; |
| 43 } |
| 44 |
| 45 std::string AppManagerImpl::GetNoteTakingAppId() const { |
| 46 return std::string(); |
| 47 } |
| 48 |
| 49 bool AppManagerImpl::LaunchNoteTaking() { |
| 50 return false; |
| 51 } |
| 52 |
| 53 } // namespace lock_screen_apps |
OLD | NEW |