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

Side by Side Diff: chrome/browser/profiles/profile_manager.h

Issue 14923004: [Mac] AppController needs to update its "last profile" pointer when the active profile is deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: derp. no test on CrOS either. Created 7 years, 5 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 // 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 9
10 #include <list> 10 #include <list>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 private: 282 private:
283 DISALLOW_COPY_AND_ASSIGN(ProfileInfo); 283 DISALLOW_COPY_AND_ASSIGN(ProfileInfo);
284 }; 284 };
285 285
286 // Adds a pre-existing Profile object to the set managed by this 286 // Adds a pre-existing Profile object to the set managed by this
287 // ProfileManager. This ProfileManager takes ownership of the Profile. 287 // ProfileManager. This ProfileManager takes ownership of the Profile.
288 // The Profile should not already be managed by this ProfileManager. 288 // The Profile should not already be managed by this ProfileManager.
289 // Returns true if the profile was added, false otherwise. 289 // Returns true if the profile was added, false otherwise.
290 bool AddProfile(Profile* profile); 290 bool AddProfile(Profile* profile);
291 291
292 // Schedules the profile at the given path to be deleted on shutdown.
293 void FinishDeletingProfile(const base::FilePath& profile_dir);
294
292 // Registers profile with given info. Returns pointer to created ProfileInfo 295 // Registers profile with given info. Returns pointer to created ProfileInfo
293 // entry. 296 // entry.
294 ProfileInfo* RegisterProfile(Profile* profile, bool created); 297 ProfileInfo* RegisterProfile(Profile* profile, bool created);
295 298
296 // Returns ProfileInfo associated with given |path|, registred earlier with 299 // Returns ProfileInfo associated with given |path|, registred earlier with
297 // RegisterProfile. 300 // RegisterProfile.
298 ProfileInfo* GetProfileInfoByPath(const base::FilePath& path) const; 301 ProfileInfo* GetProfileInfoByPath(const base::FilePath& path) const;
299 302
300 typedef std::pair<base::FilePath, string16> ProfilePathAndName; 303 typedef std::pair<base::FilePath, string16> ProfilePathAndName;
301 typedef std::vector<ProfilePathAndName> ProfilePathAndNames; 304 typedef std::vector<ProfilePathAndName> ProfilePathAndNames;
(...skipping 17 matching lines...) Expand all
319 // count. 322 // count.
320 // Lack of side effects: 323 // Lack of side effects:
321 // This function doesn't actually create the directory or touch the file 324 // This function doesn't actually create the directory or touch the file
322 // system. 325 // system.
323 base::FilePath GenerateNextProfileDirectoryPath(); 326 base::FilePath GenerateNextProfileDirectoryPath();
324 327
325 void RunCallbacks(const std::vector<CreateCallback>& callbacks, 328 void RunCallbacks(const std::vector<CreateCallback>& callbacks,
326 Profile* profile, 329 Profile* profile,
327 Profile::CreateStatus status); 330 Profile::CreateStatus status);
328 331
332 // If the |loaded_profile| has been loaded succesfully (according to |status|)
333 // and isn't already scheduled for deletion, then finishes adding
334 // |profile_to_delete_dir| to the queue of profiles to be deleted, and updates
335 // the kProfileLastUsed preference based on |last_non_managed_profile_path|.
336 void OnNewActiveProfileLoaded(
337 const base::FilePath& profile_to_delete_path,
338 const base::FilePath& last_non_managed_profile_path,
339 const CreateCallback& original_callback,
340 Profile* loaded_profile,
341 Profile::CreateStatus status);
342
329 content::NotificationRegistrar registrar_; 343 content::NotificationRegistrar registrar_;
330 344
331 // The path to the user data directory (DIR_USER_DATA). 345 // The path to the user data directory (DIR_USER_DATA).
332 const base::FilePath user_data_dir_; 346 const base::FilePath user_data_dir_;
333 347
334 // Indicates that a user has logged in and that the profile specified 348 // Indicates that a user has logged in and that the profile specified
335 // in the --login-profile command line argument should be used as the 349 // in the --login-profile command line argument should be used as the
336 // default. 350 // default.
337 bool logged_in_; 351 bool logged_in_;
338 352
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 class ProfileManagerWithoutInit : public ProfileManager { 401 class ProfileManagerWithoutInit : public ProfileManager {
388 public: 402 public:
389 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); 403 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir);
390 404
391 protected: 405 protected:
392 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} 406 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {}
393 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} 407 virtual void DoFinalInitLogging(Profile*) OVERRIDE {}
394 }; 408 };
395 409
396 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 410 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/app_controller_mac_unittest.mm ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698