| 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/profiles/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/profiles/profile_manager.h" | 28 #include "chrome/browser/profiles/profile_manager.h" |
| 29 #include "chrome/browser/signin/account_reconcilor_factory.h" | 29 #include "chrome/browser/signin/account_reconcilor_factory.h" |
| 30 #include "chrome/browser/signin/account_tracker_service_factory.h" | 30 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| 31 #include "chrome/browser/signin/signin_manager_factory.h" | 31 #include "chrome/browser/signin/signin_manager_factory.h" |
| 32 #include "chrome/browser/signin/signin_ui_util.h" | 32 #include "chrome/browser/signin/signin_ui_util.h" |
| 33 #include "chrome/browser/sync/profile_sync_service_factory.h" | 33 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 34 #include "chrome/browser/ui/browser.h" | 34 #include "chrome/browser/ui/browser.h" |
| 35 #include "chrome/browser/ui/browser_dialogs.h" | 35 #include "chrome/browser/ui/browser_dialogs.h" |
| 36 #include "chrome/browser/ui/profile_chooser_constants.h" | 36 #include "chrome/browser/ui/profile_chooser_constants.h" |
| 37 #include "chrome/browser/ui/user_manager.h" | 37 #include "chrome/browser/ui/user_manager.h" |
| 38 #include "chrome/common/chrome_features.h" |
| 38 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 39 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
| 40 #include "components/browser_sync/browser/profile_sync_service.h" | 41 #include "components/browser_sync/browser/profile_sync_service.h" |
| 41 #include "components/flags_ui/pref_service_flags_storage.h" | 42 #include "components/flags_ui/pref_service_flags_storage.h" |
| 42 #include "components/prefs/pref_service.h" | 43 #include "components/prefs/pref_service.h" |
| 43 #include "components/signin/core/browser/account_reconcilor.h" | 44 #include "components/signin/core/browser/account_reconcilor.h" |
| 44 #include "components/signin/core/browser/account_tracker_service.h" | 45 #include "components/signin/core/browser/account_tracker_service.h" |
| 45 #include "components/signin/core/browser/signin_manager.h" | 46 #include "components/signin/core/browser/signin_manager.h" |
| 46 #include "components/signin/core/common/profile_management_switches.h" | 47 #include "components/signin/core/common/profile_management_switches.h" |
| 47 #include "components/signin/core/common/signin_pref_names.h" | 48 #include "components/signin/core/common/signin_pref_names.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void OnUserManagerSystemProfileCreated( | 129 void OnUserManagerSystemProfileCreated( |
| 129 const base::FilePath& profile_path_to_focus, | 130 const base::FilePath& profile_path_to_focus, |
| 130 profiles::UserManagerTutorialMode tutorial_mode, | 131 profiles::UserManagerTutorialMode tutorial_mode, |
| 131 profiles::UserManagerProfileSelected profile_open_action, | 132 profiles::UserManagerProfileSelected profile_open_action, |
| 132 const base::Callback<void(Profile*, const std::string&)>& callback, | 133 const base::Callback<void(Profile*, const std::string&)>& callback, |
| 133 Profile* system_profile, | 134 Profile* system_profile, |
| 134 Profile::CreateStatus status) { | 135 Profile::CreateStatus status) { |
| 135 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) | 136 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) |
| 136 return; | 137 return; |
| 137 | 138 |
| 139 // Force Material Design user manager on when Material Design settings are on. |
| 140 bool use_material_design_user_manager = |
| 141 switches::IsMaterialDesignUserManager() || |
| 142 base::FeatureList::IsEnabled(features::kMaterialDesignSettingsFeature); |
| 143 |
| 138 // Tell the webui which user should be focused. | 144 // Tell the webui which user should be focused. |
| 139 std::string page = switches::IsMaterialDesignUserManager() ? | 145 std::string page = use_material_design_user_manager |
| 140 chrome::kChromeUIMdUserManagerUrl : chrome::kChromeUIUserManagerURL; | 146 ? chrome::kChromeUIMdUserManagerUrl |
| 147 : chrome::kChromeUIUserManagerURL; |
| 141 | 148 |
| 142 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { | 149 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { |
| 143 page += profiles::kUserManagerDisplayTutorial; | 150 page += profiles::kUserManagerDisplayTutorial; |
| 144 } else if (!profile_path_to_focus.empty()) { | 151 } else if (!profile_path_to_focus.empty()) { |
| 145 // The file path is processed in the same way as base::CreateFilePathValue | 152 // The file path is processed in the same way as base::CreateFilePathValue |
| 146 // (i.e. convert to std::string with AsUTF8Unsafe()), and then URI encoded. | 153 // (i.e. convert to std::string with AsUTF8Unsafe()), and then URI encoded. |
| 147 page += "#"; | 154 page += "#"; |
| 148 page += net::EscapeUrlEncodedData(profile_path_to_focus.AsUTF8Unsafe(), | 155 page += net::EscapeUrlEncodedData(profile_path_to_focus.AsUTF8Unsafe(), |
| 149 false); | 156 false); |
| 150 } else if (profile_open_action == | 157 } else if (profile_open_action == |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 PrefService* local_state = g_browser_process->local_state(); | 523 PrefService* local_state = g_browser_process->local_state(); |
| 517 const bool dismissed = local_state->GetBoolean( | 524 const bool dismissed = local_state->GetBoolean( |
| 518 prefs::kProfileAvatarRightClickTutorialDismissed); | 525 prefs::kProfileAvatarRightClickTutorialDismissed); |
| 519 | 526 |
| 520 // Don't show the tutorial if it's already been dismissed or if right-clicking | 527 // Don't show the tutorial if it's already been dismissed or if right-clicking |
| 521 // wouldn't show any targets. | 528 // wouldn't show any targets. |
| 522 return !dismissed && HasProfileSwitchTargets(profile); | 529 return !dismissed && HasProfileSwitchTargets(profile); |
| 523 } | 530 } |
| 524 | 531 |
| 525 } // namespace profiles | 532 } // namespace profiles |
| OLD | NEW |