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" | |
42 #include "components/user_manager/user_manager.h" | 41 #include "components/user_manager/user_manager.h" |
43 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
44 #include "extensions/common/extension_urls.h" | 43 #include "extensions/common/extension_urls.h" |
45 | 44 |
46 namespace chromeos { | 45 namespace chromeos { |
47 | 46 |
48 namespace { | 47 namespace { |
49 | 48 |
50 // Domain that is used for kiosk-app account IDs. | 49 // Domain that is used for kiosk-app account IDs. |
51 const char kKioskAppAccountDomain[] = "kiosk-apps"; | 50 const char kKioskAppAccountDomain[] = "kiosk-apps"; |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 new_app->Load(); | 633 new_app->Load(); |
635 } | 634 } |
636 CancelDelayedCryptohomeRemoval(it->user_id); | 635 CancelDelayedCryptohomeRemoval(it->user_id); |
637 } | 636 } |
638 | 637 |
639 base::Closure cryptohomes_barrier_closure; | 638 base::Closure cryptohomes_barrier_closure; |
640 | 639 |
641 const user_manager::User* active_user = | 640 const user_manager::User* active_user = |
642 user_manager::UserManager::Get()->GetActiveUser(); | 641 user_manager::UserManager::Get()->GetActiveUser(); |
643 if (active_user) { | 642 if (active_user) { |
644 const AccountId active_account_id = active_user->GetAccountId(); | 643 std::string active_user_id = active_user->GetUserID(); |
645 for (const auto& it : old_apps) { | 644 for (const auto& it : old_apps) { |
646 if (it.second->user_id() == active_account_id.GetUserEmail()) { | 645 if (it.second->user_id() == active_user_id) { |
647 VLOG(1) << "Currently running kiosk app removed from policy, exiting"; | 646 VLOG(1) << "Currently running kiosk app removed from policy, exiting"; |
648 cryptohomes_barrier_closure = BarrierClosure( | 647 cryptohomes_barrier_closure = BarrierClosure( |
649 old_apps.size(), base::Bind(&chrome::AttemptUserExit)); | 648 old_apps.size(), base::Bind(&chrome::AttemptUserExit)); |
650 break; | 649 break; |
651 } | 650 } |
652 } | 651 } |
653 } | 652 } |
654 | 653 |
655 // Clears cache and deletes the remaining old data. | 654 // Clears cache and deletes the remaining old data. |
656 std::vector<std::string> apps_to_remove; | 655 std::vector<std::string> apps_to_remove; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 *cache_dir = user_data_dir.AppendASCII(kCrxCacheDir); | 765 *cache_dir = user_data_dir.AppendASCII(kCrxCacheDir); |
767 } | 766 } |
768 | 767 |
769 void KioskAppManager::GetCrxUnpackDir(base::FilePath* unpack_dir) { | 768 void KioskAppManager::GetCrxUnpackDir(base::FilePath* unpack_dir) { |
770 base::FilePath temp_dir; | 769 base::FilePath temp_dir; |
771 base::GetTempDir(&temp_dir); | 770 base::GetTempDir(&temp_dir); |
772 *unpack_dir = temp_dir.AppendASCII(kCrxUnpackDir); | 771 *unpack_dir = temp_dir.AppendASCII(kCrxUnpackDir); |
773 } | 772 } |
774 | 773 |
775 } // namespace chromeos | 774 } // namespace chromeos |
OLD | NEW |