Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
| 26 #include "chrome/browser/signin/account_reconcilor_factory.h" | 26 #include "chrome/browser/signin/account_reconcilor_factory.h" |
| 27 #include "chrome/browser/signin/account_tracker_service_factory.h" | 27 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| 28 #include "chrome/browser/signin/signin_manager_factory.h" | 28 #include "chrome/browser/signin/signin_manager_factory.h" |
| 29 #include "chrome/browser/signin/signin_ui_util.h" | 29 #include "chrome/browser/signin/signin_ui_util.h" |
| 30 #include "chrome/browser/sync/profile_sync_service_factory.h" | 30 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 31 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
| 32 #include "chrome/browser/ui/browser_dialogs.h" | 32 #include "chrome/browser/ui/browser_dialogs.h" |
| 33 #include "chrome/browser/ui/profile_chooser_constants.h" | 33 #include "chrome/browser/ui/profile_chooser_constants.h" |
| 34 #include "chrome/browser/ui/user_manager.h" | 34 #include "chrome/browser/ui/user_manager.h" |
| 35 #include "chrome/common/chrome_features.h" | |
| 35 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
| 36 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 37 #include "components/browser_sync/browser/profile_sync_service.h" | 38 #include "components/browser_sync/browser/profile_sync_service.h" |
| 38 #include "components/flags_ui/pref_service_flags_storage.h" | 39 #include "components/flags_ui/pref_service_flags_storage.h" |
| 39 #include "components/prefs/pref_service.h" | 40 #include "components/prefs/pref_service.h" |
| 40 #include "components/signin/core/browser/account_reconcilor.h" | 41 #include "components/signin/core/browser/account_reconcilor.h" |
| 41 #include "components/signin/core/browser/account_tracker_service.h" | 42 #include "components/signin/core/browser/account_tracker_service.h" |
| 42 #include "components/signin/core/browser/signin_manager.h" | 43 #include "components/signin/core/browser/signin_manager.h" |
| 43 #include "components/signin/core/common/profile_management_switches.h" | 44 #include "components/signin/core/common/profile_management_switches.h" |
| 44 #include "components/signin/core/common/signin_pref_names.h" | 45 #include "components/signin/core/common/signin_pref_names.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 void OnUserManagerSystemProfileCreated( | 126 void OnUserManagerSystemProfileCreated( |
| 126 const base::FilePath& profile_path_to_focus, | 127 const base::FilePath& profile_path_to_focus, |
| 127 profiles::UserManagerTutorialMode tutorial_mode, | 128 profiles::UserManagerTutorialMode tutorial_mode, |
| 128 profiles::UserManagerProfileSelected profile_open_action, | 129 profiles::UserManagerProfileSelected profile_open_action, |
| 129 const base::Callback<void(Profile*, const std::string&)>& callback, | 130 const base::Callback<void(Profile*, const std::string&)>& callback, |
| 130 Profile* system_profile, | 131 Profile* system_profile, |
| 131 Profile::CreateStatus status) { | 132 Profile::CreateStatus status) { |
| 132 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) | 133 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) |
| 133 return; | 134 return; |
| 134 | 135 |
| 136 // Force Material Design user manager on when Material Design settings are on. | |
| 137 bool useMaterialDesignUserManager = | |
|
Dan Beam
2016/06/07 00:25:08
use_material_design_user_manager
this is not coco
groby-ooo-7-16
2016/06/09 00:18:24
Done.
| |
| 138 switches::IsMaterialDesignUserManager() || | |
| 139 base::FeatureList::IsEnabled(features::kMaterialDesignSettingsFeature); | |
| 140 | |
| 135 // Tell the webui which user should be focused. | 141 // Tell the webui which user should be focused. |
| 136 std::string page = switches::IsMaterialDesignUserManager() ? | 142 std::string page = useMaterialDesignUserManager |
| 137 chrome::kChromeUIMdUserManagerUrl : chrome::kChromeUIUserManagerURL; | 143 ? chrome::kChromeUIMdUserManagerUrl |
| 144 : chrome::kChromeUIUserManagerURL; | |
| 138 | 145 |
| 139 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { | 146 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { |
| 140 page += profiles::kUserManagerDisplayTutorial; | 147 page += profiles::kUserManagerDisplayTutorial; |
| 141 } else if (!profile_path_to_focus.empty()) { | 148 } else if (!profile_path_to_focus.empty()) { |
| 142 // The file path is processed in the same way as base::CreateFilePathValue | 149 // The file path is processed in the same way as base::CreateFilePathValue |
| 143 // (i.e. convert to std::string with AsUTF8Unsafe()), and then URI encoded. | 150 // (i.e. convert to std::string with AsUTF8Unsafe()), and then URI encoded. |
| 144 page += "#"; | 151 page += "#"; |
| 145 page += net::EscapeUrlEncodedData(profile_path_to_focus.AsUTF8Unsafe(), | 152 page += net::EscapeUrlEncodedData(profile_path_to_focus.AsUTF8Unsafe(), |
| 146 false); | 153 false); |
| 147 } else if (profile_open_action == | 154 } else if (profile_open_action == |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 491 PrefService* local_state = g_browser_process->local_state(); | 498 PrefService* local_state = g_browser_process->local_state(); |
| 492 const bool dismissed = local_state->GetBoolean( | 499 const bool dismissed = local_state->GetBoolean( |
| 493 prefs::kProfileAvatarRightClickTutorialDismissed); | 500 prefs::kProfileAvatarRightClickTutorialDismissed); |
| 494 | 501 |
| 495 // Don't show the tutorial if it's already been dismissed or if right-clicking | 502 // Don't show the tutorial if it's already been dismissed or if right-clicking |
| 496 // wouldn't show any targets. | 503 // wouldn't show any targets. |
| 497 return !dismissed && HasProfileSwitchTargets(profile); | 504 return !dismissed && HasProfileSwitchTargets(profile); |
| 498 } | 505 } |
| 499 | 506 |
| 500 } // namespace profiles | 507 } // namespace profiles |
| OLD | NEW |