| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 default: | 148 default: |
| 149 bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT; | 149 bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT; |
| 150 } | 150 } |
| 151 browser->window()->ShowAvatarBubbleFromAvatarButton( | 151 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 152 bubble_mode, manage_accounts_params); | 152 bubble_mode, manage_accounts_params); |
| 153 } | 153 } |
| 154 #else // defined(OS_ANDROID) | 154 #else // defined(OS_ANDROID) |
| 155 if (service_type == signin::GAIA_SERVICE_TYPE_INCOGNITO) { | 155 if (service_type == signin::GAIA_SERVICE_TYPE_INCOGNITO) { |
| 156 web_contents->OpenURL(content::OpenURLParams( | 156 web_contents->OpenURL(content::OpenURLParams( |
| 157 GURL(chrome::kChromeUINativeNewTabURL), content::Referrer(), | 157 GURL(chrome::kChromeUINativeNewTabURL), content::Referrer(), |
| 158 OFF_THE_RECORD, content::PAGE_TRANSITION_AUTO_TOPLEVEL, false)); | 158 OFF_THE_RECORD, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false)); |
| 159 } else { | 159 } else { |
| 160 AccountManagementScreenHelper::OpenAccountManagementScreen( | 160 AccountManagementScreenHelper::OpenAccountManagementScreen( |
| 161 Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 161 Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
| 162 service_type); | 162 service_type); |
| 163 } | 163 } |
| 164 #endif // OS_ANDROID | 164 #endif // OS_ANDROID |
| 165 } | 165 } |
| 166 #endif // !defined(OS_IOS) | 166 #endif // !defined(OS_IOS) |
| 167 | 167 |
| 168 bool IsDriveOrigin(const GURL& url) { | 168 bool IsDriveOrigin(const GURL& url) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() && | 259 if (!(info && info->IsMainFrame() && |
| 260 (info->HasUserGesture() || | 260 (info->HasUserGesture() || |
| 261 !content::PageTransitionIsWebTriggerable(info->GetPageTransition())))) | 261 !ui::PageTransitionIsWebTriggerable(info->GetPageTransition())))) |
| 262 return; | 262 return; |
| 263 | 263 |
| 264 std::string header_value; | 264 std::string header_value; |
| 265 if (!request->response_headers()->GetNormalizedHeader( | 265 if (!request->response_headers()->GetNormalizedHeader( |
| 266 kChromeManageAccountsHeader, &header_value)) { | 266 kChromeManageAccountsHeader, &header_value)) { |
| 267 return; | 267 return; |
| 268 } | 268 } |
| 269 | 269 |
| 270 DCHECK(switches::IsEnableAccountConsistency() && !io_data->IsOffTheRecord()); | 270 DCHECK(switches::IsEnableAccountConsistency() && !io_data->IsOffTheRecord()); |
| 271 ManageAccountsParams params(BuildManageAccountsParams(header_value)); | 271 ManageAccountsParams params(BuildManageAccountsParams(header_value)); |
| 272 if (params.service_type == GAIA_SERVICE_TYPE_NONE) | 272 if (params.service_type == GAIA_SERVICE_TYPE_NONE) |
| 273 return; | 273 return; |
| 274 | 274 |
| 275 params.child_id = child_id; | 275 params.child_id = child_id; |
| 276 params.route_id = route_id; | 276 params.route_id = route_id; |
| 277 content::BrowserThread::PostTask( | 277 content::BrowserThread::PostTask( |
| 278 content::BrowserThread::UI, FROM_HERE, | 278 content::BrowserThread::UI, FROM_HERE, |
| 279 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); | 279 base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); |
| 280 #endif // defined(OS_IOS) | 280 #endif // defined(OS_IOS) |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace signin | 283 } // namespace signin |
| OLD | NEW |