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

Unified Diff: trunk/src/chrome/browser/process_singleton_linux.cc

Issue 23708026: Revert 222159 "Improve the UI for handling profile lock contention." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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
Index: trunk/src/chrome/browser/process_singleton_linux.cc
===================================================================
--- trunk/src/chrome/browser/process_singleton_linux.cc (revision 222182)
+++ trunk/src/chrome/browser/process_singleton_linux.cc (working copy)
@@ -294,28 +294,23 @@
return true;
}
-// Returns true if the user opted to unlock the profile.
-bool DisplayProfileInUseError(const base::FilePath& lock_path,
+void DisplayProfileInUseError(const std::string& lock_path,
const std::string& hostname,
int pid) {
string16 error = l10n_util::GetStringFUTF16(
IDS_PROFILE_IN_USE_LINUX,
base::IntToString16(pid),
ASCIIToUTF16(hostname),
+ WideToUTF16(base::SysNativeMBToWide(lock_path)),
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
- string16 relaunch_button_text = l10n_util::GetStringFUTF16(
- IDS_PROFILE_IN_USE_LINUX_RELAUNCH,
- string16());
LOG(ERROR) << base::SysWideToNativeMB(UTF16ToWide(error)).c_str();
if (!g_disable_prompt) {
#if defined(TOOLKIT_GTK)
- return ProcessSingletonDialog::ShowAndRun(
- UTF16ToUTF8(error), UTF16ToUTF8(relaunch_button_text));
+ ProcessSingletonDialog::ShowAndRun(UTF16ToUTF8(error));
#else
NOTIMPLEMENTED();
#endif
}
- return false;
}
bool IsChromeProcess(pid_t pid) {
@@ -739,13 +734,9 @@
return PROCESS_NONE;
}
- if (hostname != net::GetHostName() && !IsChromeProcess(pid)) {
- // Locked by process on another host. If the user selected to unlock
- // the profile, try to continue; otherwise quit.
- if (DisplayProfileInUseError(lock_path_, hostname, pid)) {
- UnlinkPath(lock_path_);
- return PROCESS_NONE;
- }
+ if (hostname != net::GetHostName()) {
+ // Locked by process on another host.
+ DisplayProfileInUseError(lock_path_.value(), hostname, pid);
return PROFILE_IN_USE;
}
@@ -967,7 +958,8 @@
ParseLockPath(lock_path_, &hostname, &pid);
if (!hostname.empty() && hostname != net::GetHostName()) {
- return DisplayProfileInUseError(lock_path_, hostname, pid);
+ DisplayProfileInUseError(lock_path_.value(), hostname, pid);
+ return false;
}
UnlinkPath(lock_path_);
« no previous file with comments | « trunk/src/chrome/app/google_chrome_strings.grd ('k') | trunk/src/chrome/browser/ui/gtk/process_singleton_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698