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: fixup Created 3 years, 10 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
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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 base::StringValue(""), base::FundamentalValue(0)); 1008 base::StringValue(""), base::FundamentalValue(0));
1008 } 1009 }
1009 } 1010 }
1010 1011
1011 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) { 1012 void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) {
1012 DCHECK(browser); 1013 DCHECK(browser);
1013 DCHECK(browser->window()); 1014 DCHECK(browser->window());
1014 1015
1015 // Unlock the profile after browser opens so startup can read the lock bit. 1016 // Unlock the profile after browser opens so startup can read the lock bit.
1016 // Any necessary authentication must have been successful to reach this point. 1017 // Any necessary authentication must have been successful to reach this point.
1018 ProfileAttributesEntry* entry = nullptr;
1017 if (!browser->profile()->IsGuestSession()) { 1019 if (!browser->profile()->IsGuestSession()) {
1018 ProfileAttributesEntry* entry = nullptr;
1019 bool has_entry = g_browser_process->profile_manager()-> 1020 bool has_entry = g_browser_process->profile_manager()->
1020 GetProfileAttributesStorage(). 1021 GetProfileAttributesStorage().
1021 GetProfileAttributesWithPath(browser->profile()->GetPath(), &entry); 1022 GetProfileAttributesWithPath(browser->profile()->GetPath(), &entry);
1022 DCHECK(has_entry); 1023 DCHECK(has_entry);
1024 // If force sign in is enabled and profile is not signed in, do not close
1025 // UserManager and unlock profile.
1026 if (signin_util::IsForceSigninEnabled() && !entry->IsAuthenticated())
1027 return;
1023 entry->SetIsSigninRequired(false); 1028 entry->SetIsSigninRequired(false);
1024 } 1029 }
1025 1030
1026 if (!url_hash_.empty()) { 1031 if (!url_hash_.empty()) {
1027 base::ThreadTaskRunnerHandle::Get()->PostTask( 1032 base::ThreadTaskRunnerHandle::Get()->PostTask(
1028 FROM_HERE, 1033 FROM_HERE,
1029 base::Bind(&UrlHashHelper::ExecuteUrlHash, 1034 base::Bind(&UrlHashHelper::ExecuteUrlHash,
1030 base::Owned(new UrlHashHelper(browser, url_hash_)))); 1035 base::Owned(new UrlHashHelper(browser, url_hash_))));
1031 } 1036 }
1032 1037
(...skipping 22 matching lines...) Expand all
1055 Profile* profile, Profile::CreateStatus profile_create_status) { 1060 Profile* profile, Profile::CreateStatus profile_create_status) {
1056 Browser* browser = chrome::FindAnyBrowser(profile, false); 1061 Browser* browser = chrome::FindAnyBrowser(profile, false);
1057 if (browser && browser->window()) { 1062 if (browser && browser->window()) {
1058 OnBrowserWindowReady(browser); 1063 OnBrowserWindowReady(browser);
1059 } else { 1064 } else {
1060 registrar_.Add(this, 1065 registrar_.Add(this,
1061 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 1066 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
1062 content::NotificationService::AllSources()); 1067 content::NotificationService::AllSources());
1063 } 1068 }
1064 } 1069 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698