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

Side by Side Diff: chrome/browser/profiles/profile_window.cc

Issue 1782583003: Puts the new Material Design User Manager behind a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 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
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/profiles/profile_window.h" 5 #include "chrome/browser/profiles/profile_window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string>
9 #include <vector>
8 10
9 #include "base/command_line.h" 11 #include "base/command_line.h"
10 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
11 #include "base/macros.h" 13 #include "base/macros.h"
12 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
14 #include "build/build_config.h" 16 #include "build/build_config.h"
15 #include "chrome/browser/about_flags.h" 17 #include "chrome/browser/about_flags.h"
16 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/lifetime/application_lifetime.h" 19 #include "chrome/browser/lifetime/application_lifetime.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const base::FilePath& profile_path_to_focus, 192 const base::FilePath& profile_path_to_focus,
191 profiles::UserManagerTutorialMode tutorial_mode, 193 profiles::UserManagerTutorialMode tutorial_mode,
192 profiles::UserManagerProfileSelected profile_open_action, 194 profiles::UserManagerProfileSelected profile_open_action,
193 const base::Callback<void(Profile*, const std::string&)>& callback, 195 const base::Callback<void(Profile*, const std::string&)>& callback,
194 Profile* system_profile, 196 Profile* system_profile,
195 Profile::CreateStatus status) { 197 Profile::CreateStatus status) {
196 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) 198 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null())
197 return; 199 return;
198 200
199 // Tell the webui which user should be focused. 201 // Tell the webui which user should be focused.
200 std::string page = chrome::kChromeUIUserManagerURL; 202 std::string page = switches::IsMaterialDesignUserManager() ?
203 chrome::kChromeUIMdUserManagerUrl : chrome::kChromeUIUserManagerURL;
Roger Tawa OOO till Jul 10th 2016/03/10 18:23:17 Not part of this CL, but I wonder if this constant
201 204
202 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { 205 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) {
203 page += profiles::kUserManagerDisplayTutorial; 206 page += profiles::kUserManagerDisplayTutorial;
204 } else if (!profile_path_to_focus.empty()) { 207 } else if (!profile_path_to_focus.empty()) {
205 const ProfileInfoCache& cache = 208 const ProfileInfoCache& cache =
206 g_browser_process->profile_manager()->GetProfileInfoCache(); 209 g_browser_process->profile_manager()->GetProfileInfoCache();
207 size_t index = cache.GetIndexOfProfileWithPath(profile_path_to_focus); 210 size_t index = cache.GetIndexOfProfileWithPath(profile_path_to_focus);
208 if (index != std::string::npos) { 211 if (index != std::string::npos) {
209 page += "#"; 212 page += "#";
210 page += base::SizeTToString(index); 213 page += base::SizeTToString(index);
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 PrefService* local_state = g_browser_process->local_state(); 536 PrefService* local_state = g_browser_process->local_state();
534 const bool dismissed = local_state->GetBoolean( 537 const bool dismissed = local_state->GetBoolean(
535 prefs::kProfileAvatarRightClickTutorialDismissed); 538 prefs::kProfileAvatarRightClickTutorialDismissed);
536 539
537 // Don't show the tutorial if it's already been dismissed or if right-clicking 540 // Don't show the tutorial if it's already been dismissed or if right-clicking
538 // wouldn't show any targets. 541 // wouldn't show any targets.
539 return !dismissed && HasProfileSwitchTargets(profile); 542 return !dismissed && HasProfileSwitchTargets(profile);
540 } 543 }
541 544
542 } // namespace profiles 545 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/signin/core/common/profile_management_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698