| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/feature_list.h" | |
| 14 #include "base/location.h" | 13 #include "base/location.h" |
| 15 #include "base/macros.h" | 14 #include "base/macros.h" |
| 16 #include "base/metrics/user_metrics.h" | 15 #include "base/metrics/user_metrics.h" |
| 17 #include "base/profiler/scoped_tracker.h" | 16 #include "base/profiler/scoped_tracker.h" |
| 18 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "base/value_conversions.h" | 20 #include "base/value_conversions.h" |
| 22 #include "base/values.h" | 21 #include "base/values.h" |
| 23 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 40 #include "chrome/browser/ui/browser_dialogs.h" | 39 #include "chrome/browser/ui/browser_dialogs.h" |
| 41 #include "chrome/browser/ui/browser_finder.h" | 40 #include "chrome/browser/ui/browser_finder.h" |
| 42 #include "chrome/browser/ui/browser_list.h" | 41 #include "chrome/browser/ui/browser_list.h" |
| 43 #include "chrome/browser/ui/browser_list_observer.h" | 42 #include "chrome/browser/ui/browser_list_observer.h" |
| 44 #include "chrome/browser/ui/chrome_pages.h" | 43 #include "chrome/browser/ui/chrome_pages.h" |
| 45 #include "chrome/browser/ui/singleton_tabs.h" | 44 #include "chrome/browser/ui/singleton_tabs.h" |
| 46 #include "chrome/browser/ui/user_manager.h" | 45 #include "chrome/browser/ui/user_manager.h" |
| 47 #include "chrome/browser/ui/webui/profile_helper.h" | 46 #include "chrome/browser/ui/webui/profile_helper.h" |
| 48 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 47 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 49 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 48 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 50 #include "chrome/common/chrome_features.h" | |
| 51 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 52 #include "chrome/common/url_constants.h" | 50 #include "chrome/common/url_constants.h" |
| 53 #include "chrome/grit/chromium_strings.h" | 51 #include "chrome/grit/chromium_strings.h" |
| 54 #include "chrome/grit/generated_resources.h" | 52 #include "chrome/grit/generated_resources.h" |
| 55 #include "components/prefs/pref_service.h" | 53 #include "components/prefs/pref_service.h" |
| 56 #include "components/proximity_auth/screenlock_bridge.h" | 54 #include "components/proximity_auth/screenlock_bridge.h" |
| 57 #include "components/signin/core/account_id/account_id.h" | 55 #include "components/signin/core/account_id/account_id.h" |
| 58 #include "components/signin/core/common/profile_management_switches.h" | 56 #include "components/signin/core/common/profile_management_switches.h" |
| 59 #include "components/strings/grit/components_strings.h" | 57 #include "components/strings/grit/components_strings.h" |
| 60 #include "content/public/browser/notification_service.h" | 58 #include "content/public/browser/notification_service.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 297 |
| 300 // TODO(mahmadi): Remove the following once prefs are cleared for everyone. | 298 // TODO(mahmadi): Remove the following once prefs are cleared for everyone. |
| 301 PrefService* service = g_browser_process->local_state(); | 299 PrefService* service = g_browser_process->local_state(); |
| 302 DCHECK(service); | 300 DCHECK(service); |
| 303 | 301 |
| 304 const PrefService::Preference* guest_mode_enabled_pref = | 302 const PrefService::Preference* guest_mode_enabled_pref = |
| 305 service->FindPreference(prefs::kBrowserGuestModeEnabled); | 303 service->FindPreference(prefs::kBrowserGuestModeEnabled); |
| 306 const PrefService::Preference* add_person_enabled_pref = | 304 const PrefService::Preference* add_person_enabled_pref = |
| 307 service->FindPreference(prefs::kBrowserAddPersonEnabled); | 305 service->FindPreference(prefs::kBrowserAddPersonEnabled); |
| 308 | 306 |
| 309 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && | 307 if (guest_mode_enabled_pref->HasUserSetting() || |
| 310 (guest_mode_enabled_pref->HasUserSetting() || | 308 add_person_enabled_pref->HasUserSetting()) { |
| 311 add_person_enabled_pref->HasUserSetting())) { | |
| 312 service->ClearPref(guest_mode_enabled_pref->name()); | 309 service->ClearPref(guest_mode_enabled_pref->name()); |
| 313 service->ClearPref(add_person_enabled_pref->name()); | 310 service->ClearPref(add_person_enabled_pref->name()); |
| 314 base::RecordAction( | 311 base::RecordAction( |
| 315 base::UserMetricsAction("UserManager_Cleared_Legacy_User_Prefs")); | 312 base::UserMetricsAction("UserManager_Cleared_Legacy_User_Prefs")); |
| 316 } | 313 } |
| 317 } | 314 } |
| 318 | 315 |
| 319 UserManagerScreenHandler::~UserManagerScreenHandler() { | 316 UserManagerScreenHandler::~UserManagerScreenHandler() { |
| 320 proximity_auth::ScreenlockBridge::Get()->SetLockHandler(NULL); | 317 proximity_auth::ScreenlockBridge::Get()->SetLockHandler(NULL); |
| 321 } | 318 } |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 Profile* profile, Profile::CreateStatus profile_create_status) { | 1053 Profile* profile, Profile::CreateStatus profile_create_status) { |
| 1057 Browser* browser = chrome::FindAnyBrowser(profile, false); | 1054 Browser* browser = chrome::FindAnyBrowser(profile, false); |
| 1058 if (browser && browser->window()) { | 1055 if (browser && browser->window()) { |
| 1059 OnBrowserWindowReady(browser); | 1056 OnBrowserWindowReady(browser); |
| 1060 } else { | 1057 } else { |
| 1061 registrar_.Add(this, | 1058 registrar_.Add(this, |
| 1062 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 1059 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 1063 content::NotificationService::AllSources()); | 1060 content::NotificationService::AllSources()); |
| 1064 } | 1061 } |
| 1065 } | 1062 } |
| OLD | NEW |