OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // The NewProfileLauncher class is created when to wait for a multi-profile | 61 // The NewProfileLauncher class is created when to wait for a multi-profile |
62 // to be created asynchronously. Upon completion of profile creation, the | 62 // to be created asynchronously. Upon completion of profile creation, the |
63 // NPL takes care of launching a new browser window and signing the user | 63 // NPL takes care of launching a new browser window and signing the user |
64 // in to their Google account. | 64 // in to their Google account. |
65 class NewProfileLauncher : public ProfileManagerObserver { | 65 class NewProfileLauncher : public ProfileManagerObserver { |
66 public: | 66 public: |
67 virtual void OnProfileCreated(Profile* profile, Status status) { | 67 virtual void OnProfileCreated(Profile* profile, Status status) { |
68 if (status == STATUS_INITIALIZED) { | 68 if (status == STATUS_INITIALIZED) { |
69 DCHECK(profile); | 69 DCHECK(profile); |
70 Browser* browser = Browser::Create(profile); | 70 Browser* browser = Browser::Create(profile); |
71 browser->AddSelectedTabWithURL(GURL(chrome::kChromeUINewProfile), | 71 browser->AddSelectedTabWithURL(GURL(chrome::kChromeUINewTabURL), |
72 PageTransition::LINK); | 72 PageTransition::LINK); |
73 browser->window()->Show(); | 73 browser->window()->Show(); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 virtual bool DeleteAfter() OVERRIDE { return true; } | 77 virtual bool DeleteAfter() OVERRIDE { return true; } |
78 }; | 78 }; |
79 | 79 |
80 // static | 80 // static |
81 void ProfileManager::ShutdownSessionServices() { | 81 void ProfileManager::ShutdownSessionServices() { |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 cache.DeleteProfileFromCache(profile_dir); | 560 cache.DeleteProfileFromCache(profile_dir); |
561 } | 561 } |
562 | 562 |
563 // static | 563 // static |
564 bool ProfileManager::IsMultipleProfilesEnabled() { | 564 bool ProfileManager::IsMultipleProfilesEnabled() { |
565 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) | 565 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) |
566 return true; | 566 return true; |
567 #endif | 567 #endif |
568 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); | 568 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); |
569 } | 569 } |
OLD | NEW |