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

Unified Diff: chrome/browser/prefs/incognito_mode_prefs.cc

Issue 15859011: Don't show post extension install bubbles when incognito mode is forced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved incognito_mode_prefs from another CL 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
Index: chrome/browser/prefs/incognito_mode_prefs.cc
diff --git a/chrome/browser/prefs/incognito_mode_prefs.cc b/chrome/browser/prefs/incognito_mode_prefs.cc
index 4f5f7cf9b03eb8cc1a0e372acdb40e7748d10cb6..e6a0e50570c32472904eb4720d0e4fe0647e0f9a 100644
--- a/chrome/browser/prefs/incognito_mode_prefs.cc
+++ b/chrome/browser/prefs/incognito_mode_prefs.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/prefs/pref_service.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/user_prefs/pref_registry_syncable.h"
@@ -70,3 +71,19 @@ bool IncognitoModePrefs::ShouldLaunchIncognito(
(command_line.HasSwitch(switches::kIncognito) ||
incognito_avail == IncognitoModePrefs::FORCED);
}
+
+// static
+bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) {
+ switch (GetAvailability(profile->GetPrefs())) {
+ case IncognitoModePrefs::ENABLED:
+ return true;
+ case IncognitoModePrefs::DISABLED:
+ return !profile->IsOffTheRecord();
+ case IncognitoModePrefs::FORCED:
+ return profile->IsOffTheRecord();
+ case IncognitoModePrefs::AVAILABILITY_NUM_TYPES:
+ NOTREACHED();
+ }
+ NOTREACHED();
+ return false;
+}
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.h ('k') | chrome/browser/ui/extensions/extension_install_ui_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698