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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_window_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_window.cc
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc
index 35bbc96f69d4fb2538744caf90088f30565b447a..0a416623dab61bd8d88e8e63d8db52da31f2de8c 100644
--- a/chrome/browser/profiles/profile_window.cc
+++ b/chrome/browser/profiles/profile_window.cc
@@ -42,6 +42,7 @@
#include "components/signin/core/common/signin_switches.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/user_metrics.h"
+#include "net/base/escape.h"
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
@@ -205,13 +206,11 @@ void OnUserManagerSystemProfileCreated(
if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) {
page += profiles::kUserManagerDisplayTutorial;
} else if (!profile_path_to_focus.empty()) {
- const ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t index = cache.GetIndexOfProfileWithPath(profile_path_to_focus);
- if (index != std::string::npos) {
- page += "#";
- page += base::SizeTToString(index);
- }
+ // The file path is processed in the same way as base::CreateFilePathValue
+ // (i.e. convert to std::string with AsUTF8Unsafe()), and then URI encoded.
+ page += "#";
+ page += net::EscapeUrlEncodedData(profile_path_to_focus.AsUTF8Unsafe(),
+ false);
} else if (profile_open_action ==
profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) {
page += profiles::kUserManagerSelectProfileTaskManager;
« 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