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

Side by Side 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, 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
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 #include "chrome/browser/prefs/incognito_mode_prefs.h" 5 #include "chrome/browser/prefs/incognito_mode_prefs.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
11 #include "chrome/common/pref_names.h" 12 #include "chrome/common/pref_names.h"
12 #include "components/user_prefs/pref_registry_syncable.h" 13 #include "components/user_prefs/pref_registry_syncable.h"
13 14
14 #if defined(OS_WIN) 15 #if defined(OS_WIN)
15 #include "base/win/metro.h" 16 #include "base/win/metro.h"
16 #endif // OS_WIN 17 #endif // OS_WIN
17 18
18 // static 19 // static
19 bool IncognitoModePrefs::IntToAvailability(int in_value, 20 bool IncognitoModePrefs::IntToAvailability(int in_value,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 64
64 // static 65 // static
65 bool IncognitoModePrefs::ShouldLaunchIncognito( 66 bool IncognitoModePrefs::ShouldLaunchIncognito(
66 const CommandLine& command_line, 67 const CommandLine& command_line,
67 const PrefService* prefs) { 68 const PrefService* prefs) {
68 Availability incognito_avail = GetAvailability(prefs); 69 Availability incognito_avail = GetAvailability(prefs);
69 return incognito_avail != IncognitoModePrefs::DISABLED && 70 return incognito_avail != IncognitoModePrefs::DISABLED &&
70 (command_line.HasSwitch(switches::kIncognito) || 71 (command_line.HasSwitch(switches::kIncognito) ||
71 incognito_avail == IncognitoModePrefs::FORCED); 72 incognito_avail == IncognitoModePrefs::FORCED);
72 } 73 }
74
75 // static
76 bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) {
77 switch (GetAvailability(profile->GetPrefs())) {
78 case IncognitoModePrefs::ENABLED:
79 return true;
80 case IncognitoModePrefs::DISABLED:
81 return !profile->IsOffTheRecord();
82 case IncognitoModePrefs::FORCED:
83 return profile->IsOffTheRecord();
84 case IncognitoModePrefs::AVAILABILITY_NUM_TYPES:
85 NOTREACHED();
86 }
87 NOTREACHED();
88 return false;
89 }
OLDNEW
« 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