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

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: 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
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 google_util::IsGoogleDomainUrl( 170 google_util::IsGoogleDomainUrl(
171 url, 171 url,
172 google_util::ALLOW_SUBDOMAIN, 172 google_util::ALLOW_SUBDOMAIN,
173 google_util::DISALLOW_NON_STANDARD_PORTS); 173 google_util::DISALLOW_NON_STANDARD_PORTS);
174 if (!is_google_url && !IsDriveOrigin(origin)) 174 if (!is_google_url && !IsDriveOrigin(origin))
175 return false; 175 return false;
176 176
177 std::string account_id(io_data->google_services_account_id()->GetValue()); 177 std::string account_id(io_data->google_services_account_id()->GetValue());
178 178
179 int profile_mode_mask = PROFILE_MODE_DEFAULT; 179 int profile_mode_mask = PROFILE_MODE_DEFAULT;
180 // TODO(guohui): Needs to check for parent control as well.
181 if (io_data->incognito_availibility()->GetValue() == 180 if (io_data->incognito_availibility()->GetValue() ==
182 IncognitoModePrefs::DISABLED) { 181 IncognitoModePrefs::DISABLED ||
182 io_data->ArePlatformParentalControlsEnabledCached()) {
183 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED; 183 profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED;
184 } 184 }
185 185
186 // TODO(guohui): needs to make a new flag for enabling account consistency. 186 // TODO(guohui): needs to make a new flag for enabling account consistency.
187 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s", 187 std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s",
188 kGaiaIdAttrName, account_id.c_str(), 188 kGaiaIdAttrName, account_id.c_str(),
189 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(), 189 kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(),
190 kEnableAccountConsistencyAttrName, 190 kEnableAccountConsistencyAttrName,
191 is_new_profile_management ? "true" : "false")); 191 is_new_profile_management ? "true" : "false"));
192 request->SetExtraRequestHeaderByName( 192 request->SetExtraRequestHeaderByName(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if (params.service_type == GAIA_SERVICE_TYPE_NONE) 232 if (params.service_type == GAIA_SERVICE_TYPE_NONE)
233 return; 233 return;
234 234
235 content::BrowserThread::PostTask( 235 content::BrowserThread::PostTask(
236 content::BrowserThread::UI, FROM_HERE, 236 content::BrowserThread::UI, FROM_HERE,
237 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); 237 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params));
238 #endif // defined(OS_IOS) 238 #endif // defined(OS_IOS)
239 } 239 }
240 240
241 } // namespace signin 241 } // namespace signin
OLDNEW
« chrome/browser/profiles/profile_io_data.cc ('K') | « chrome/browser/profiles/profile_io_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698