OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |