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

Unified Diff: chrome/browser/profiles/profile_window.cc

Issue 2061593002: Fix crash when switching to a profile that cannot be opened (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug-614753-fix
Patch Set: Created 4 years, 6 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: chrome/browser/profiles/profile_window.cc
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc
index 9ed0f49bb4aa0aa942a5305a1907ce8a0b20609a..da85a1a3ca298beb8ee970801e8c58aaf9dce8d8 100644
--- a/chrome/browser/profiles/profile_window.cc
+++ b/chrome/browser/profiles/profile_window.cc
@@ -31,9 +31,11 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/profile_chooser_constants.h"
+#include "chrome/browser/ui/profile_error_dialog.h"
#include "chrome/browser/ui/user_manager.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "chrome/grit/generated_resources.h"
#include "components/browser_sync/browser/profile_sync_service.h"
#include "components/flags_ui/pref_service_flags_storage.h"
#include "components/prefs/pref_service.h"
@@ -213,6 +215,12 @@ void OpenBrowserWindowForProfile(
Profile::CreateStatus status) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (status == Profile::CREATE_STATUS_LOCAL_FAIL) {
+ ShowProfileErrorDialog(PROFILE_ERROR_SWITCH_TO_FAILURE,
+ IDS_COULDNT_SWITCH_PROFILE_ERROR);
+ return;
Peter Kasting 2016/06/13 04:43:20 Nit: Not necessary (next conditional does this for
WC Leung 2016/06/13 08:06:45 Acknowledged.
+ }
+
if (status != Profile::CREATE_STATUS_INITIALIZED)
return;

Powered by Google App Engine
This is Rietveld 408576698