OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/app_mode/kiosk_app_manager.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 #include "chrome/browser/extensions/external_loader.h" | 31 #include "chrome/browser/extensions/external_loader.h" |
32 #include "chrome/browser/extensions/external_provider_impl.h" | 32 #include "chrome/browser/extensions/external_provider_impl.h" |
33 #include "chrome/browser/lifetime/application_lifetime.h" | 33 #include "chrome/browser/lifetime/application_lifetime.h" |
34 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
35 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
36 #include "chromeos/chromeos_paths.h" | 36 #include "chromeos/chromeos_paths.h" |
37 #include "chromeos/cryptohome/async_method_caller.h" | 37 #include "chromeos/cryptohome/async_method_caller.h" |
38 #include "chromeos/dbus/dbus_thread_manager.h" | 38 #include "chromeos/dbus/dbus_thread_manager.h" |
39 #include "chromeos/settings/cros_settings_names.h" | 39 #include "chromeos/settings/cros_settings_names.h" |
40 #include "components/ownership/owner_key_util.h" | 40 #include "components/ownership/owner_key_util.h" |
41 #include "components/signin/core/account_id/account_id.h" | |
41 #include "components/user_manager/user_manager.h" | 42 #include "components/user_manager/user_manager.h" |
42 #include "content/public/browser/browser_thread.h" | 43 #include "content/public/browser/browser_thread.h" |
43 #include "extensions/common/extension_urls.h" | 44 #include "extensions/common/extension_urls.h" |
44 | 45 |
45 namespace chromeos { | 46 namespace chromeos { |
46 | 47 |
47 namespace { | 48 namespace { |
48 | 49 |
49 // Domain that is used for kiosk-app account IDs. | 50 // Domain that is used for kiosk-app account IDs. |
50 const char kKioskAppAccountDomain[] = "kiosk-apps"; | 51 const char kKioskAppAccountDomain[] = "kiosk-apps"; |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 new_app->Load(); | 634 new_app->Load(); |
634 } | 635 } |
635 CancelDelayedCryptohomeRemoval(it->user_id); | 636 CancelDelayedCryptohomeRemoval(it->user_id); |
636 } | 637 } |
637 | 638 |
638 base::Closure cryptohomes_barrier_closure; | 639 base::Closure cryptohomes_barrier_closure; |
639 | 640 |
640 const user_manager::User* active_user = | 641 const user_manager::User* active_user = |
641 user_manager::UserManager::Get()->GetActiveUser(); | 642 user_manager::UserManager::Get()->GetActiveUser(); |
642 if (active_user) { | 643 if (active_user) { |
643 std::string active_user_id = active_user->GetUserID(); | 644 const AccountId active_account_id = active_user->GetAccountId(); |
644 for (const auto& it : old_apps) { | 645 for (const auto& it : old_apps) { |
645 if (it.second->user_id() == active_user_id) { | 646 if (it.second->user_id() == active_account_id.GetUserEmail()) { |
stevenjb
2015/10/23 17:17:02
Is GetUserEmail() just an accessor? If so, we shou
Alexander Alekseev
2015/10/23 23:21:22
user_id must return AccountId (and it will shortly
stevenjb
2015/10/26 18:28:00
So then, in case GetUserEmail doesn't get removed
| |
646 VLOG(1) << "Currently running kiosk app removed from policy, exiting"; | 647 VLOG(1) << "Currently running kiosk app removed from policy, exiting"; |
647 cryptohomes_barrier_closure = BarrierClosure( | 648 cryptohomes_barrier_closure = BarrierClosure( |
648 old_apps.size(), base::Bind(&chrome::AttemptUserExit)); | 649 old_apps.size(), base::Bind(&chrome::AttemptUserExit)); |
649 break; | 650 break; |
650 } | 651 } |
651 } | 652 } |
652 } | 653 } |
653 | 654 |
654 // Clears cache and deletes the remaining old data. | 655 // Clears cache and deletes the remaining old data. |
655 std::vector<std::string> apps_to_remove; | 656 std::vector<std::string> apps_to_remove; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 *cache_dir = user_data_dir.AppendASCII(kCrxCacheDir); | 766 *cache_dir = user_data_dir.AppendASCII(kCrxCacheDir); |
766 } | 767 } |
767 | 768 |
768 void KioskAppManager::GetCrxUnpackDir(base::FilePath* unpack_dir) { | 769 void KioskAppManager::GetCrxUnpackDir(base::FilePath* unpack_dir) { |
769 base::FilePath temp_dir; | 770 base::FilePath temp_dir; |
770 base::GetTempDir(&temp_dir); | 771 base::GetTempDir(&temp_dir); |
771 *unpack_dir = temp_dir.AppendASCII(kCrxUnpackDir); | 772 *unpack_dir = temp_dir.AppendASCII(kCrxUnpackDir); |
772 } | 773 } |
773 | 774 |
774 } // namespace chromeos | 775 } // namespace chromeos |
OLD | NEW |