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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 547663002: Never open guest pre-NewAvatarMenu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) 335 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
336 // On ChromeOS and Android the ProfileManager will use the same path as the 336 // On ChromeOS and Android the ProfileManager will use the same path as the
337 // one we got passed. GetActiveUserProfile will therefore use the correct path 337 // one we got passed. GetActiveUserProfile will therefore use the correct path
338 // automatically. 338 // automatically.
339 DCHECK_EQ(user_data_dir.value(), 339 DCHECK_EQ(user_data_dir.value(),
340 g_browser_process->profile_manager()->user_data_dir().value()); 340 g_browser_process->profile_manager()->user_data_dir().value());
341 profile = ProfileManager::GetActiveUserProfile(); 341 profile = ProfileManager::GetActiveUserProfile();
342 #else 342 #else
343 base::FilePath profile_path = 343 base::FilePath profile_path =
344 GetStartupProfilePath(user_data_dir, parsed_command_line); 344 GetStartupProfilePath(user_data_dir, parsed_command_line);
345
346 // Without NewAvatarMenu, replace guest with the default profile.
347 if (!switches::IsNewAvatarMenu() &&
348 profile_path == ProfileManager::GetGuestProfilePath()) {
349 profile_path = g_browser_process->profile_manager()->GetProfileInfoCache().
350 GetPathOfProfileAtIndex(0);
jochen (gone - plz use gerrit) 2014/09/08 12:14:21 is zero the default profile? Should maybe be a con
Mike Lerman 2014/09/08 14:02:33 The problem with the last used profile is the last
351 }
345 profile = g_browser_process->profile_manager()->GetProfile( 352 profile = g_browser_process->profile_manager()->GetProfile(
346 profile_path); 353 profile_path);
347 354
348 // If we're using the --new-profile-management flag and this profile is 355 // If we're using the --new-profile-management flag and this profile is
349 // signed out, then we should show the user manager instead. By switching 356 // signed out, then we should show the user manager instead. By switching
350 // the active profile to the guest profile we ensure that no 357 // the active profile to the guest profile we ensure that no
351 // browser windows will be opened for the guest profile. 358 // browser windows will be opened for the guest profile.
352 if (switches::IsNewProfileManagement() && !profile->IsGuestSession()) { 359 if (switches::IsNewProfileManagement() && !profile->IsGuestSession()) {
353 ProfileInfoCache& cache = 360 ProfileInfoCache& cache =
354 g_browser_process->profile_manager()->GetProfileInfoCache(); 361 g_browser_process->profile_manager()->GetProfileInfoCache();
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 chromeos::CrosSettings::Shutdown(); 1687 chromeos::CrosSettings::Shutdown();
1681 #endif 1688 #endif
1682 #endif 1689 #endif
1683 } 1690 }
1684 1691
1685 // Public members: 1692 // Public members:
1686 1693
1687 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1694 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1688 chrome_extra_parts_.push_back(parts); 1695 chrome_extra_parts_.push_back(parts);
1689 } 1696 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698