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