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

Unified Diff: chrome/browser/profiles/profile_manager.cc

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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index a806af70d3029a5be74572ed8082190a21aa40b9..75644422434ef83258d4013d6d5fd201c8de7d73 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
#include "chrome/browser/profiles/profile_destroyer.h"
@@ -272,6 +273,16 @@ Profile* ProfileManager::GetLastUsedProfile() {
}
// static
+Profile* ProfileManager::GetLastUsedProfileAllowedByPolicy() {
+ Profile* profile = GetLastUsedProfile();
+ if (IncognitoModePrefs::GetAvailability(profile->GetPrefs()) ==
+ IncognitoModePrefs::FORCED) {
+ return profile->GetOffTheRecordProfile();
+ }
+ return profile;
+}
+
+// static
std::vector<Profile*> ProfileManager::GetLastOpenedProfiles() {
ProfileManager* profile_manager = g_browser_process->profile_manager();
return profile_manager->GetLastOpenedProfiles(
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698