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

Side by Side Diff: chrome/browser/signin/signin_header_helper.cc

Issue 336213005: Disable incognito link if parental control is on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky's comments addressed Created 6 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
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/signin/signin_header_helper.h" 5 #include "chrome/browser/signin/signin_header_helper.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/google/google_util.h" 10 #include "chrome/browser/google/google_util.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 google_util::IsYoutubeDomainUrl( 174 google_util::IsYoutubeDomainUrl(
175 url, 175 url,
176 google_util::ALLOW_SUBDOMAIN, 176 google_util::ALLOW_SUBDOMAIN,
177 google_util::DISALLOW_NON_STANDARD_PORTS)); 177 google_util::DISALLOW_NON_STANDARD_PORTS));
178 if (!is_google_url && !IsDriveOrigin(origin)) 178 if (!is_google_url && !IsDriveOrigin(origin))
179 return false; 179 return false;
180 180
181 std::string account_id(io_data->google_services_account_id()->GetValue()); 181 std::string account_id(io_data->google_services_account_id()->GetValue());
182 182
183 int profile_mode_mask = PROFILE_MODE_DEFAULT; 183 int profile_mode_mask = PROFILE_MODE_DEFAULT;
184 // TODO(guohui): Needs to check for parent control as well.
185 if (io_data->incognito_availibility()->GetValue() == 184 if (io_data->incognito_availibility()->GetValue() ==
186 IncognitoModePrefs::DISABLED) { 185 IncognitoModePrefs::DISABLED ||
186 IncognitoModePrefs::ArePlatformParentalControlsEnabledCached()) {
187 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED; 187 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED;
188 } 188 }
189 189
190 // TODO(guohui): needs to make a new flag for enabling account consistency. 190 // TODO(guohui): needs to make a new flag for enabling account consistency.
191 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s", 191 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s",
192 kGaiaIdAttrName, account_id.c_str(), 192 kGaiaIdAttrName, account_id.c_str(),
193 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(), 193 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(),
194 kEnableAccountConsistencyAttrName, 194 kEnableAccountConsistencyAttrName,
195 is_new_profile_management ? "true" : "false")); 195 is_new_profile_management ? "true" : "false"));
196 request->SetExtraRequestHeaderByName( 196 request->SetExtraRequestHeaderByName(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 if (params.service_type == GAIA_SERVICE_TYPE_NONE) 236 if (params.service_type == GAIA_SERVICE_TYPE_NONE)
237 return; 237 return;
238 238
239 content::BrowserThread::PostTask( 239 content::BrowserThread::PostTask(
240 content::BrowserThread::UI, FROM_HERE, 240 content::BrowserThread::UI, FROM_HERE,
241 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); 241 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params));
242 #endif // defined(OS_IOS) 242 #endif // defined(OS_IOS)
243 } 243 }
244 244
245 } // namespace signin 245 } // namespace signin
OLDNEW
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698