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

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

Issue 1828143002: Profile path is sent instead of an index to focus a user pod (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo and nits Created 4 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_window_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 24 matching lines...) Expand all
35 #include "components/flags_ui/pref_service_flags_storage.h" 35 #include "components/flags_ui/pref_service_flags_storage.h"
36 #include "components/prefs/pref_service.h" 36 #include "components/prefs/pref_service.h"
37 #include "components/signin/core/browser/account_reconcilor.h" 37 #include "components/signin/core/browser/account_reconcilor.h"
38 #include "components/signin/core/browser/account_tracker_service.h" 38 #include "components/signin/core/browser/account_tracker_service.h"
39 #include "components/signin/core/browser/signin_manager.h" 39 #include "components/signin/core/browser/signin_manager.h"
40 #include "components/signin/core/common/profile_management_switches.h" 40 #include "components/signin/core/common/profile_management_switches.h"
41 #include "components/signin/core/common/signin_pref_names.h" 41 #include "components/signin/core/common/signin_pref_names.h"
42 #include "components/signin/core/common/signin_switches.h" 42 #include "components/signin/core/common/signin_switches.h"
43 #include "content/public/browser/browser_thread.h" 43 #include "content/public/browser/browser_thread.h"
44 #include "content/public/browser/user_metrics.h" 44 #include "content/public/browser/user_metrics.h"
45 #include "net/base/escape.h"
45 46
46 #if defined(ENABLE_EXTENSIONS) 47 #if defined(ENABLE_EXTENSIONS)
47 #include "chrome/browser/extensions/extension_service.h" 48 #include "chrome/browser/extensions/extension_service.h"
48 #include "extensions/browser/extension_prefs.h" 49 #include "extensions/browser/extension_prefs.h"
49 #include "extensions/browser/extension_registry.h" 50 #include "extensions/browser/extension_registry.h"
50 #include "extensions/browser/extension_registry_factory.h" 51 #include "extensions/browser/extension_registry_factory.h"
51 #include "extensions/browser/extension_system.h" 52 #include "extensions/browser/extension_system.h"
52 #endif // defined(ENABLE_EXTENSIONS) 53 #endif // defined(ENABLE_EXTENSIONS)
53 54
54 #if !defined(OS_ANDROID) 55 #if !defined(OS_ANDROID)
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) 199 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null())
199 return; 200 return;
200 201
201 // Tell the webui which user should be focused. 202 // Tell the webui which user should be focused.
202 std::string page = switches::IsMaterialDesignUserManager() ? 203 std::string page = switches::IsMaterialDesignUserManager() ?
203 chrome::kChromeUIMdUserManagerUrl : chrome::kChromeUIUserManagerURL; 204 chrome::kChromeUIMdUserManagerUrl : chrome::kChromeUIUserManagerURL;
204 205
205 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { 206 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) {
206 page += profiles::kUserManagerDisplayTutorial; 207 page += profiles::kUserManagerDisplayTutorial;
207 } else if (!profile_path_to_focus.empty()) { 208 } else if (!profile_path_to_focus.empty()) {
208 const ProfileInfoCache& cache = 209 // The file path is processed in the same way as base::CreateFilePathValue
209 g_browser_process->profile_manager()->GetProfileInfoCache(); 210 // (i.e. convert to std::string with AsUTF8Unsafe()), and then URI encoded.
210 size_t index = cache.GetIndexOfProfileWithPath(profile_path_to_focus); 211 page += "#";
211 if (index != std::string::npos) { 212 page += net::EscapeUrlEncodedData(profile_path_to_focus.AsUTF8Unsafe(),
212 page += "#"; 213 false);
213 page += base::SizeTToString(index);
214 }
215 } else if (profile_open_action == 214 } else if (profile_open_action ==
216 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) { 215 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) {
217 page += profiles::kUserManagerSelectProfileTaskManager; 216 page += profiles::kUserManagerSelectProfileTaskManager;
218 } else if (profile_open_action == 217 } else if (profile_open_action ==
219 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) { 218 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) {
220 page += profiles::kUserManagerSelectProfileAboutChrome; 219 page += profiles::kUserManagerSelectProfileAboutChrome;
221 } else if (profile_open_action == 220 } else if (profile_open_action ==
222 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS) { 221 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS) {
223 page += profiles::kUserManagerSelectProfileChromeSettings; 222 page += profiles::kUserManagerSelectProfileChromeSettings;
224 } else if (profile_open_action == 223 } else if (profile_open_action ==
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 PrefService* local_state = g_browser_process->local_state(); 531 PrefService* local_state = g_browser_process->local_state();
533 const bool dismissed = local_state->GetBoolean( 532 const bool dismissed = local_state->GetBoolean(
534 prefs::kProfileAvatarRightClickTutorialDismissed); 533 prefs::kProfileAvatarRightClickTutorialDismissed);
535 534
536 // Don't show the tutorial if it's already been dismissed or if right-clicking 535 // Don't show the tutorial if it's already been dismissed or if right-clicking
537 // wouldn't show any targets. 536 // wouldn't show any targets.
538 return !dismissed && HasProfileSwitchTargets(profile); 537 return !dismissed && HasProfileSwitchTargets(profile);
539 } 538 }
540 539
541 } // namespace profiles 540 } // namespace profiles
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_window_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698