| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::kChromeUINewTabURL), | 71 browser->AddSelectedTabWithURL(GURL(chrome::kChromeUINewTabURL), |
| 72 PageTransition::LINK); | 72 PageTransition::LINK); |
| 73 browser->window()->Show(); | 73 browser->window()->Show(BrowserWindow::SHOW_CONTEXT_NORMAL); |
| 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() { |
| 82 ProfileManager* pm = g_browser_process->profile_manager(); | 82 ProfileManager* pm = g_browser_process->profile_manager(); |
| 83 if (!pm) // Is NULL when running unit tests. | 83 if (!pm) // Is NULL when running unit tests. |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 cache.DeleteProfileFromCache(profile_dir); | 571 cache.DeleteProfileFromCache(profile_dir); |
| 572 } | 572 } |
| 573 | 573 |
| 574 // static | 574 // static |
| 575 bool ProfileManager::IsMultipleProfilesEnabled() { | 575 bool ProfileManager::IsMultipleProfilesEnabled() { |
| 576 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) | 576 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) |
| 577 return true; | 577 return true; |
| 578 #endif | 578 #endif |
| 579 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); | 579 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); |
| 580 } | 580 } |
| OLD | NEW |