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

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

Issue 16072014: Don't open the 'stats for nerds' in a non-incognito window when incognito is forced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: renamed getter, left a comment at GetLastUsedProfile Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Returns the directory where the first created profile is stored, 102 // Returns the directory where the first created profile is stored,
103 // relative to the user data directory currently in use.. 103 // relative to the user data directory currently in use..
104 base::FilePath GetInitialProfileDir(); 104 base::FilePath GetInitialProfileDir();
105 105
106 // Get the Profile last used (the Profile to which owns the most recently 106 // Get the Profile last used (the Profile to which owns the most recently
107 // focused window) with this Chrome build. If no signed profile has been 107 // focused window) with this Chrome build. If no signed profile has been
108 // stored in Local State, hand back the Default profile. 108 // stored in Local State, hand back the Default profile.
109 Profile* GetLastUsedProfile(const base::FilePath& user_data_dir); 109 Profile* GetLastUsedProfile(const base::FilePath& user_data_dir);
110 110
111 // Same as instance method but provides the default user_data_dir as well. 111 // Same as instance method but provides the default user_data_dir as well.
112 // If the Profile is going to be used to open a new window then consider using
113 // GetLastUsedProfileAllowedByPolicy() instead.
112 static Profile* GetLastUsedProfile(); 114 static Profile* GetLastUsedProfile();
113 115
116 // Same as GetLastUsedProfile() but returns the incognito Profile if
117 // incognito mode is forced. This should be used if the last used Profile
118 // will be used to open new browser windows.
119 static Profile* GetLastUsedProfileAllowedByPolicy();
120
114 // Get the path of the last used profile, or if that's undefined, the default 121 // Get the path of the last used profile, or if that's undefined, the default
115 // profile. 122 // profile.
116 base::FilePath GetLastUsedProfileDir(const base::FilePath& user_data_dir); 123 base::FilePath GetLastUsedProfileDir(const base::FilePath& user_data_dir);
117 124
118 // Get the Profiles which are currently open, i.e., have open browsers, or 125 // Get the Profiles which are currently open, i.e., have open browsers, or
119 // were open the last time Chrome was running. The Profiles appear in the 126 // were open the last time Chrome was running. The Profiles appear in the
120 // order they were opened. The last used profile will be on the list, but its 127 // order they were opened. The last used profile will be on the list, but its
121 // index on the list will depend on when it was opened (it is not necessarily 128 // index on the list will depend on when it was opened (it is not necessarily
122 // the last one). 129 // the last one).
123 std::vector<Profile*> GetLastOpenedProfiles( 130 std::vector<Profile*> GetLastOpenedProfiles(
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 class ProfileManagerWithoutInit : public ProfileManager { 384 class ProfileManagerWithoutInit : public ProfileManager {
378 public: 385 public:
379 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); 386 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir);
380 387
381 protected: 388 protected:
382 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} 389 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {}
383 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} 390 virtual void DoFinalInitLogging(Profile*) OVERRIDE {}
384 }; 391 };
385 392
386 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 393 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698