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

Side by Side Diff: chrome/browser/prefs/incognito_mode_prefs.cc

Issue 202993002: Fix "unreachable code" warnings (MSVC warning 4702) in chrome/browser/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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/browser/profiles/profile.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return incognito_avail != IncognitoModePrefs::DISABLED && 70 return incognito_avail != IncognitoModePrefs::DISABLED &&
71 (command_line.HasSwitch(switches::kIncognito) || 71 (command_line.HasSwitch(switches::kIncognito) ||
72 incognito_avail == IncognitoModePrefs::FORCED); 72 incognito_avail == IncognitoModePrefs::FORCED);
73 } 73 }
74 74
75 // static 75 // static
76 bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) { 76 bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) {
77 switch (GetAvailability(profile->GetPrefs())) { 77 switch (GetAvailability(profile->GetPrefs())) {
78 case IncognitoModePrefs::ENABLED: 78 case IncognitoModePrefs::ENABLED:
79 return true; 79 return true;
80
80 case IncognitoModePrefs::DISABLED: 81 case IncognitoModePrefs::DISABLED:
81 return !profile->IsOffTheRecord(); 82 return !profile->IsOffTheRecord();
83
82 case IncognitoModePrefs::FORCED: 84 case IncognitoModePrefs::FORCED:
83 return profile->IsOffTheRecord(); 85 return profile->IsOffTheRecord();
84 case IncognitoModePrefs::AVAILABILITY_NUM_TYPES: 86
87 default:
85 NOTREACHED(); 88 NOTREACHED();
89 return false;
86 } 90 }
87 NOTREACHED();
88 return false;
89 } 91 }
90 92
91 // static 93 // static
92 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() { 94 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() {
93 #if defined(OS_WIN) 95 #if defined(OS_WIN)
94 // Disable incognito mode windows if parental controls are on. This is only 96 // Disable incognito mode windows if parental controls are on. This is only
95 // for Windows Vista and above. 97 // for Windows Vista and above.
96 return base::win::IsParentalControlActivityLoggingOn(); 98 return base::win::IsParentalControlActivityLoggingOn();
97 #elif defined(OS_ANDROID) 99 #elif defined(OS_ANDROID)
98 return chrome::android::ChromiumApplication::AreParentalControlsEnabled(); 100 return chrome::android::ChromiumApplication::AreParentalControlsEnabled();
101 #else
102 return false;
99 #endif 103 #endif
100 return false;
101 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698