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/ui/webui/signin/user_manager_screen_handler.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" |
8 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
9 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| 11 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/thread_task_runner_handle.h" |
11 #include "base/value_conversions.h" | 14 #include "base/value_conversions.h" |
12 #include "base/values.h" | 15 #include "base/values.h" |
13 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
15 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" | 18 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" |
16 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 20 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
18 #include "chrome/browser/profiles/profile_info_cache.h" | 21 #include "chrome/browser/profiles/profile_info_cache.h" |
19 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 22 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 // Any necessary authentication must have been successful to reach this point. | 822 // Any necessary authentication must have been successful to reach this point. |
820 if (!browser->profile()->IsGuestSession()) { | 823 if (!browser->profile()->IsGuestSession()) { |
821 ProfileInfoCache& info_cache = | 824 ProfileInfoCache& info_cache = |
822 g_browser_process->profile_manager()->GetProfileInfoCache(); | 825 g_browser_process->profile_manager()->GetProfileInfoCache(); |
823 size_t index = info_cache.GetIndexOfProfileWithPath( | 826 size_t index = info_cache.GetIndexOfProfileWithPath( |
824 browser->profile()->GetPath()); | 827 browser->profile()->GetPath()); |
825 info_cache.SetProfileSigninRequiredAtIndex(index, false); | 828 info_cache.SetProfileSigninRequiredAtIndex(index, false); |
826 } | 829 } |
827 | 830 |
828 if (!url_hash_.empty()) { | 831 if (!url_hash_.empty()) { |
829 base::MessageLoop::current()->PostTask( | 832 base::ThreadTaskRunnerHandle::Get()->PostTask( |
830 FROM_HERE, | 833 FROM_HERE, |
831 base::Bind(&UrlHashHelper::ExecuteUrlHash, | 834 base::Bind(&UrlHashHelper::ExecuteUrlHash, |
832 base::Owned(new UrlHashHelper(browser, url_hash_)))); | 835 base::Owned(new UrlHashHelper(browser, url_hash_)))); |
833 } | 836 } |
834 | 837 |
835 // This call is last as it deletes this object. | 838 // This call is last as it deletes this object. |
836 UserManager::Hide(); | 839 UserManager::Hide(); |
837 } | 840 } |
838 | 841 |
839 void UserManagerScreenHandler::Observe( | 842 void UserManagerScreenHandler::Observe( |
(...skipping 22 matching lines...) Expand all Loading... |
862 Profile* profile, Profile::CreateStatus profile_create_status) { | 865 Profile* profile, Profile::CreateStatus profile_create_status) { |
863 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); | 866 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); |
864 if (browser && browser->window()) { | 867 if (browser && browser->window()) { |
865 OnBrowserWindowReady(browser); | 868 OnBrowserWindowReady(browser); |
866 } else { | 869 } else { |
867 registrar_.Add(this, | 870 registrar_.Add(this, |
868 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 871 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
869 content::NotificationService::AllSources()); | 872 content::NotificationService::AllSources()); |
870 } | 873 } |
871 } | 874 } |
OLD | NEW |