[Profiles] Create a profile moar better after deleting the only existing profile.
commit602b5a29f74202a4c36acfedcf1562f78abfce3c
authornoms@chromium.org <noms@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 18 Jul 2014 15:39:33 +0000 (18 15:39 +0000)
committernoms@chromium.org <noms@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 18 Jul 2014 15:39:33 +0000 (18 15:39 +0000)
tree30b10c3e97b6047fcfbc9e8dd87acd39a460edaf
parent6f562220ff06895b3c859215c34c4b1935fceb02
[Profiles] Create a profile moar better after deleting the only existing profile.

The problem was that we only created the new profile if we deleted the
active profile, and it was the only existing profile. Since guest mode came
along, we could also delete the only profile when the active profile was
the guest one (which doesn't really count as a profile), so you'd be left in
this borked state of "no profiles in Chrome, oops".

For brownie points, I also added tests for both of these "only existing profile
deleted" scenarios. :)

BUG=393901
TEST=See bug description.

Review URL: https://codereview.chromium.org/396773002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284096 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/profiles/profile_manager.cc
chrome/browser/profiles/profile_manager_unittest.cc