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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 1128173005: Clean up ProfileManager interface. Base URL: https://chromium.googlesource.com/chromium/src@issue479309
Patch Set: sync Created 5 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 unified diff | Download patch
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/ui/startup/startup_browser_creator.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 #include <set> 8 #include <set>
9 9
10 #include "apps/app_load_service.h" 10 #include "apps/app_load_service.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 // static 833 // static
834 bool StartupBrowserCreator::ActivatedProfile() { 834 bool StartupBrowserCreator::ActivatedProfile() {
835 return profile_launch_observer.Get().activated_profile(); 835 return profile_launch_observer.Get().activated_profile();
836 } 836 }
837 837
838 bool HasPendingUncleanExit(Profile* profile) { 838 bool HasPendingUncleanExit(Profile* profile) {
839 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && 839 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
840 !profile_launch_observer.Get().HasBeenLaunched(profile); 840 !profile_launch_observer.Get().HasBeenLaunched(profile);
841 } 841 }
842 842
843 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, 843 base::FilePath GetStartupProfilePath(const base::CommandLine& command_line) {
844 const base::CommandLine& command_line) { 844 ProfileManager* profile_manager = g_browser_process->profile_manager();
845 if (command_line.HasSwitch(switches::kProfileDirectory)) { 845 if (command_line.HasSwitch(switches::kProfileDirectory)) {
846 return user_data_dir.Append( 846 return profile_manager->user_data_dir().Append(
847 command_line.GetSwitchValuePath(switches::kProfileDirectory)); 847 command_line.GetSwitchValuePath(switches::kProfileDirectory));
848 } 848 }
849 849
850 // If we are showing the app list then chrome isn't shown so load the app 850 // If we are showing the app list then chrome isn't shown so load the app
851 // list's profile rather than chrome's. 851 // list's profile rather than chrome's.
852 if (command_line.HasSwitch(switches::kShowAppList)) { 852 if (command_line.HasSwitch(switches::kShowAppList)) {
853 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> 853 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)
854 GetProfilePath(user_data_dir); 854 ->GetProfilePath();
855 } 855 }
856 856
857 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 857 return profile_manager->GetLastUsedProfileDir();
858 user_data_dir);
859 } 858 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.h ('k') | chrome/browser/ui/views/app_list/win/app_list_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698