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

Side by Side Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 2712883005: Sign out profile when local_state file has been changed. (Closed)
Patch Set: Merge from master Created 3 years, 9 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
« no previous file with comments | « chrome/browser/signin/token_revoker_test_utils.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 #include "chrome/browser/profiles/profile_attributes_entry.h" 26 #include "chrome/browser/profiles/profile_attributes_entry.h"
27 #include "chrome/browser/profiles/profile_attributes_storage.h" 27 #include "chrome/browser/profiles/profile_attributes_storage.h"
28 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 28 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
29 #include "chrome/browser/profiles/profile_manager.h" 29 #include "chrome/browser/profiles/profile_manager.h"
30 #include "chrome/browser/profiles/profile_metrics.h" 30 #include "chrome/browser/profiles/profile_metrics.h"
31 #include "chrome/browser/profiles/profile_statistics.h" 31 #include "chrome/browser/profiles/profile_statistics.h"
32 #include "chrome/browser/profiles/profile_statistics_factory.h" 32 #include "chrome/browser/profiles/profile_statistics_factory.h"
33 #include "chrome/browser/profiles/profile_window.h" 33 #include "chrome/browser/profiles/profile_window.h"
34 #include "chrome/browser/profiles/profiles_state.h" 34 #include "chrome/browser/profiles/profiles_state.h"
35 #include "chrome/browser/signin/local_auth.h" 35 #include "chrome/browser/signin/local_auth.h"
36 #include "chrome/browser/signin/signin_util.h"
36 #include "chrome/browser/ui/app_list/app_list_service.h" 37 #include "chrome/browser/ui/app_list/app_list_service.h"
37 #include "chrome/browser/ui/browser_commands.h" 38 #include "chrome/browser/ui/browser_commands.h"
38 #include "chrome/browser/ui/browser_dialogs.h" 39 #include "chrome/browser/ui/browser_dialogs.h"
39 #include "chrome/browser/ui/browser_finder.h" 40 #include "chrome/browser/ui/browser_finder.h"
40 #include "chrome/browser/ui/browser_list.h" 41 #include "chrome/browser/ui/browser_list.h"
41 #include "chrome/browser/ui/browser_list_observer.h" 42 #include "chrome/browser/ui/browser_list_observer.h"
42 #include "chrome/browser/ui/chrome_pages.h" 43 #include "chrome/browser/ui/chrome_pages.h"
43 #include "chrome/browser/ui/singleton_tabs.h" 44 #include "chrome/browser/ui/singleton_tabs.h"
44 #include "chrome/browser/ui/user_manager.h" 45 #include "chrome/browser/ui/user_manager.h"
45 #include "chrome/browser/ui/webui/profile_helper.h" 46 #include "chrome/browser/ui/webui/profile_helper.h"
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 base::Value(""), base::Value(0)); 1004 base::Value(""), base::Value(0));
1004 } 1005 }
1005 } 1006 }
1006 1007
1007 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) { 1008 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) {
1008 DCHECK(browser); 1009 DCHECK(browser);
1009 DCHECK(browser->window()); 1010 DCHECK(browser->window());
1010 1011
1011 // Unlock the profile after browser opens so startup can read the lock bit. 1012 // Unlock the profile after browser opens so startup can read the lock bit.
1012 // Any necessary authentication must have been successful to reach this point. 1013 // Any necessary authentication must have been successful to reach this point.
1014 ProfileAttributesEntry* entry = nullptr;
1013 if (!browser->profile()->IsGuestSession()) { 1015 if (!browser->profile()->IsGuestSession()) {
1014 ProfileAttributesEntry* entry = nullptr;
1015 bool has_entry = g_browser_process->profile_manager()-> 1016 bool has_entry = g_browser_process->profile_manager()->
1016 GetProfileAttributesStorage(). 1017 GetProfileAttributesStorage().
1017 GetProfileAttributesWithPath(browser->profile()->GetPath(), &entry); 1018 GetProfileAttributesWithPath(browser->profile()->GetPath(), &entry);
1018 DCHECK(has_entry); 1019 DCHECK(has_entry);
1020 // If force sign in is enabled and profile is not signed in, do not close
1021 // UserManager and unlock profile.
1022 if (signin_util::IsForceSigninEnabled() && !entry->IsAuthenticated())
1023 return;
1019 entry->SetIsSigninRequired(false); 1024 entry->SetIsSigninRequired(false);
1020 } 1025 }
1021 1026
1022 if (!url_hash_.empty()) { 1027 if (!url_hash_.empty()) {
1023 base::ThreadTaskRunnerHandle::Get()->PostTask( 1028 base::ThreadTaskRunnerHandle::Get()->PostTask(
1024 FROM_HERE, 1029 FROM_HERE,
1025 base::Bind(&UrlHashHelper::ExecuteUrlHash, 1030 base::Bind(&UrlHashHelper::ExecuteUrlHash,
1026 base::Owned(new UrlHashHelper(browser, url_hash_)))); 1031 base::Owned(new UrlHashHelper(browser, url_hash_))));
1027 } 1032 }
1028 1033
(...skipping 22 matching lines...) Expand all
1051 Profile* profile, Profile::CreateStatus profile_create_status) { 1056 Profile* profile, Profile::CreateStatus profile_create_status) {
1052 Browser* browser = chrome::FindAnyBrowser(profile, false); 1057 Browser* browser = chrome::FindAnyBrowser(profile, false);
1053 if (browser && browser->window()) { 1058 if (browser && browser->window()) {
1054 OnBrowserWindowReady(browser); 1059 OnBrowserWindowReady(browser);
1055 } else { 1060 } else {
1056 registrar_.Add(this, 1061 registrar_.Add(this,
1057 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 1062 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
1058 content::NotificationService::AllSources()); 1063 content::NotificationService::AllSources());
1059 } 1064 }
1060 } 1065 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/token_revoker_test_utils.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698