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/prefs/incognito_mode_prefs.h" | 10 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 int route_id) { | 254 int route_id) { |
255 #if defined(OS_IOS) | 255 #if defined(OS_IOS) |
256 NOTREACHED(); | 256 NOTREACHED(); |
257 #else | 257 #else |
258 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 258 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
259 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) | 259 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) |
260 return; | 260 return; |
261 | 261 |
262 const content::ResourceRequestInfo* info = | 262 const content::ResourceRequestInfo* info = |
263 content::ResourceRequestInfo::ForRequest(request); | 263 content::ResourceRequestInfo::ForRequest(request); |
264 if (!(info && info->IsMainFrame() && | 264 if (!(info && info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME)) |
265 (info->HasUserGesture() || | |
266 !ui::PageTransitionIsWebTriggerable(info->GetPageTransition())))) | |
267 return; | 265 return; |
268 | 266 |
269 std::string header_value; | 267 std::string header_value; |
270 if (!request->response_headers()->GetNormalizedHeader( | 268 if (!request->response_headers()->GetNormalizedHeader( |
271 kChromeManageAccountsHeader, &header_value)) { | 269 kChromeManageAccountsHeader, &header_value)) { |
272 return; | 270 return; |
273 } | 271 } |
274 | 272 |
275 DCHECK(switches::IsEnableAccountConsistency() && !io_data->IsOffTheRecord()); | 273 DCHECK(switches::IsEnableAccountConsistency() && !io_data->IsOffTheRecord()); |
276 ManageAccountsParams params(BuildManageAccountsParams(header_value)); | 274 ManageAccountsParams params(BuildManageAccountsParams(header_value)); |
277 if (params.service_type == GAIA_SERVICE_TYPE_NONE) | 275 if (params.service_type == GAIA_SERVICE_TYPE_NONE) |
278 return; | 276 return; |
279 | 277 |
280 params.child_id = child_id; | 278 params.child_id = child_id; |
281 params.route_id = route_id; | 279 params.route_id = route_id; |
282 content::BrowserThread::PostTask( | 280 content::BrowserThread::PostTask( |
283 content::BrowserThread::UI, FROM_HERE, | 281 content::BrowserThread::UI, FROM_HERE, |
284 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); | 282 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); |
285 #endif // defined(OS_IOS) | 283 #endif // defined(OS_IOS) |
286 } | 284 } |
287 | 285 |
288 } // namespace signin | 286 } // namespace signin |
OLD | NEW |