| OLD | NEW |
| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 activated_profile_(false) { | 107 activated_profile_(false) { |
| 108 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 108 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 109 content::NotificationService::AllSources()); | 109 content::NotificationService::AllSources()); |
| 110 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 110 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 111 content::NotificationService::AllSources()); | 111 content::NotificationService::AllSources()); |
| 112 } | 112 } |
| 113 virtual ~ProfileLaunchObserver() {} | 113 virtual ~ProfileLaunchObserver() {} |
| 114 | 114 |
| 115 virtual void Observe(int type, | 115 virtual void Observe(int type, |
| 116 const content::NotificationSource& source, | 116 const content::NotificationSource& source, |
| 117 const content::NotificationDetails& details) OVERRIDE { | 117 const content::NotificationDetails& details) override { |
| 118 switch (type) { | 118 switch (type) { |
| 119 case chrome::NOTIFICATION_PROFILE_DESTROYED: { | 119 case chrome::NOTIFICATION_PROFILE_DESTROYED: { |
| 120 Profile* profile = content::Source<Profile>(source).ptr(); | 120 Profile* profile = content::Source<Profile>(source).ptr(); |
| 121 launched_profiles_.erase(profile); | 121 launched_profiles_.erase(profile); |
| 122 opened_profiles_.erase(profile); | 122 opened_profiles_.erase(profile); |
| 123 if (profile == profile_to_activate_) | 123 if (profile == profile_to_activate_) |
| 124 profile_to_activate_ = NULL; | 124 profile_to_activate_ = NULL; |
| 125 // If this profile was the last launched one without an opened window, | 125 // If this profile was the last launched one without an opened window, |
| 126 // then we may be ready to activate |profile_to_activate_|. | 126 // then we may be ready to activate |profile_to_activate_|. |
| 127 MaybeActivateProfile(); | 127 MaybeActivateProfile(); |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 // If we are showing the app list then chrome isn't shown so load the app | 739 // If we are showing the app list then chrome isn't shown so load the app |
| 740 // list's profile rather than chrome's. | 740 // list's profile rather than chrome's. |
| 741 if (command_line.HasSwitch(switches::kShowAppList)) { | 741 if (command_line.HasSwitch(switches::kShowAppList)) { |
| 742 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> | 742 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> |
| 743 GetProfilePath(user_data_dir); | 743 GetProfilePath(user_data_dir); |
| 744 } | 744 } |
| 745 | 745 |
| 746 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 746 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
| 747 user_data_dir); | 747 user_data_dir); |
| 748 } | 748 } |
| OLD | NEW |