| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/signin/signin_supervised_user_import_handler.h
" | 5 #include "chrome/browser/ui/webui/signin/signin_supervised_user_import_handler.h
" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 void SigninSupervisedUserImportHandler::OpenUrlInLastActiveProfileBrowser( | 85 void SigninSupervisedUserImportHandler::OpenUrlInLastActiveProfileBrowser( |
| 86 const base::ListValue* args) { | 86 const base::ListValue* args) { |
| 87 CHECK_EQ(1U, args->GetSize()); | 87 CHECK_EQ(1U, args->GetSize()); |
| 88 std::string url; | 88 std::string url; |
| 89 bool success = args->GetString(0, &url); | 89 bool success = args->GetString(0, &url); |
| 90 DCHECK(success); | 90 DCHECK(success); |
| 91 content::OpenURLParams params(GURL(url), | 91 content::OpenURLParams params(GURL(url), |
| 92 content::Referrer(), | 92 content::Referrer(), |
| 93 NEW_BACKGROUND_TAB, | 93 NEW_FOREGROUND_TAB, |
| 94 ui::PAGE_TRANSITION_LINK, | 94 ui::PAGE_TRANSITION_LINK, |
| 95 false); | 95 false); |
| 96 // Get the browser owned by the last used profile. | 96 // Get the browser owned by the last used profile. |
| 97 Browser* browser = | 97 Browser* browser = |
| 98 chrome::FindLastActiveWithProfile(ProfileManager::GetLastUsedProfile()); | 98 chrome::FindLastActiveWithProfile(ProfileManager::GetLastUsedProfile()); |
| 99 DCHECK(browser); | 99 DCHECK(browser); |
| 100 if (browser) | 100 if (browser) |
| 101 browser->OpenURL(params); | 101 browser->OpenURL(params); |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 bool SigninSupervisedUserImportHandler::HasAuthError(Profile* profile) const { | 265 bool SigninSupervisedUserImportHandler::HasAuthError(Profile* profile) const { |
| 266 SigninErrorController* error_controller = | 266 SigninErrorController* error_controller = |
| 267 SigninErrorControllerFactory::GetForProfile(profile); | 267 SigninErrorControllerFactory::GetForProfile(profile); |
| 268 if (!error_controller) | 268 if (!error_controller) |
| 269 return true; | 269 return true; |
| 270 | 270 |
| 271 GoogleServiceAuthError::State state = error_controller->auth_error().state(); | 271 GoogleServiceAuthError::State state = error_controller->auth_error().state(); |
| 272 return state != GoogleServiceAuthError::NONE; | 272 return state != GoogleServiceAuthError::NONE; |
| 273 } | 273 } |
| OLD | NEW |