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 // This class keeps track of the currently-active profiles in the runtime. | 5 // This class keeps track of the currently-active profiles in the runtime. |
6 | 6 |
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <list> | 11 #include <list> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
17 #include "base/hash_tables.h" | 17 #include "base/hash_tables.h" |
18 #include "base/memory/linked_ptr.h" | 18 #include "base/memory/linked_ptr.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/message_loop.h" | 20 #include "base/message_loop.h" |
21 #include "base/threading/non_thread_safe.h" | 21 #include "base/threading/non_thread_safe.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/ui/browser_list.h" | 23 #include "chrome/browser/ui/browser_list.h" |
24 #include "chrome/browser/ui/startup/startup_types.h" | 24 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
25 #include "content/public/browser/notification_observer.h" | 25 #include "content/public/browser/notification_observer.h" |
26 #include "content/public/browser/notification_registrar.h" | 26 #include "content/public/browser/notification_registrar.h" |
27 | 27 |
28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
29 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" | 29 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" |
30 #endif | 30 #endif |
31 | 31 |
32 class NewProfileLauncher; | 32 class NewProfileLauncher; |
33 class ProfileInfoCache; | 33 class ProfileInfoCache; |
34 | 34 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // otherwise return NULL. | 140 // otherwise return NULL. |
141 Profile* GetProfileByPath(const FilePath& path) const; | 141 Profile* GetProfileByPath(const FilePath& path) const; |
142 | 142 |
143 // Activates a window for |profile|. If no such window yet exists, or if | 143 // Activates a window for |profile|. If no such window yet exists, or if |
144 // |always_create| is true, this first creates a new window, then activates | 144 // |always_create| is true, this first creates a new window, then activates |
145 // that. If activating an exiting window and multiple windows exists then the | 145 // that. If activating an exiting window and multiple windows exists then the |
146 // window that was most recently active is activated. This is used for | 146 // window that was most recently active is activated. This is used for |
147 // creation of a window from the multi-profile dropdown menu. | 147 // creation of a window from the multi-profile dropdown menu. |
148 static void FindOrCreateNewWindowForProfile( | 148 static void FindOrCreateNewWindowForProfile( |
149 Profile* profile, | 149 Profile* profile, |
150 browser::startup::IsProcessStartup process_startup, | 150 StartupBrowserCreator::IsProcessStartup process_startup, |
151 browser::startup::IsFirstRun is_first_run, | 151 StartupBrowserCreator::IsFirstRun is_first_run, |
152 bool always_create); | 152 bool always_create); |
153 | 153 |
154 // Profile::Delegate implementation: | 154 // Profile::Delegate implementation: |
155 virtual void OnProfileCreated(Profile* profile, | 155 virtual void OnProfileCreated(Profile* profile, |
156 bool success, | 156 bool success, |
157 bool is_new_profile) OVERRIDE; | 157 bool is_new_profile) OVERRIDE; |
158 | 158 |
159 // Add or remove a profile launcher to/from the list of launchers waiting for | 159 // Add or remove a profile launcher to/from the list of launchers waiting for |
160 // new profiles to be created from the multi-profile menu. | 160 // new profiles to be created from the multi-profile menu. |
161 void AddProfileLauncher(NewProfileLauncher* profile_launcher); | 161 void AddProfileLauncher(NewProfileLauncher* profile_launcher); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 class ProfileManagerWithoutInit : public ProfileManager { | 346 class ProfileManagerWithoutInit : public ProfileManager { |
347 public: | 347 public: |
348 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir); | 348 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir); |
349 | 349 |
350 protected: | 350 protected: |
351 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 351 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} |
352 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 352 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} |
353 }; | 353 }; |
354 | 354 |
355 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 355 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |