| OLD | NEW | 
|    1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2012 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/login_ui_service.h" |    5 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 
|    6  |    6  | 
|    7 #include "build/build_config.h" |    7 #include "build/build_config.h" | 
|    8 #include "chrome/browser/profiles/profile.h" |    8 #include "chrome/browser/profiles/profile.h" | 
|    9 #include "chrome/browser/signin/signin_promo.h" |    9 #include "chrome/browser/signin/signin_promo.h" | 
|   10 #include "chrome/browser/ui/browser.h" |   10 #include "chrome/browser/ui/browser.h" | 
|   11 #include "chrome/browser/ui/browser_window.h" |   11 #include "chrome/browser/ui/browser_window.h" | 
|   12 #include "chrome/browser/ui/chrome_pages.h" |   12 #include "chrome/browser/ui/chrome_pages.h" | 
|   13 #include "chrome/browser/ui/profile_chooser_constants.h" |  | 
|   14 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |   13 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 
|   15 #include "chrome/browser/ui/user_manager.h" |   14 #include "chrome/browser/ui/user_manager.h" | 
|   16 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |   15 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 
|   17 #include "chrome/common/url_constants.h" |   16 #include "chrome/common/url_constants.h" | 
|   18 #include "components/signin/core/browser/signin_header_helper.h" |   17 #include "components/signin/core/browser/signin_header_helper.h" | 
|   19 #include "components/signin/core/common/profile_management_switches.h" |   18 #include "components/signin/core/common/profile_management_switches.h" | 
|   20  |   19  | 
|   21 LoginUIService::LoginUIService(Profile* profile) |   20 LoginUIService::LoginUIService(Profile* profile) | 
|   22 #if !defined(OS_CHROMEOS) |   21 #if !defined(OS_CHROMEOS) | 
|   23     : profile_(profile) |   22     : profile_(profile) | 
| (...skipping 28 matching lines...) Expand all  Loading... | 
|   52     SyncConfirmationUIClosedResult result) { |   51     SyncConfirmationUIClosedResult result) { | 
|   53   for (Observer& observer : observer_list_) |   52   for (Observer& observer : observer_list_) | 
|   54     observer.OnSyncConfirmationUIClosed(result); |   53     observer.OnSyncConfirmationUIClosed(result); | 
|   55 } |   54 } | 
|   56  |   55  | 
|   57 void LoginUIService::ShowLoginPopup() { |   56 void LoginUIService::ShowLoginPopup() { | 
|   58 #if defined(OS_CHROMEOS) |   57 #if defined(OS_CHROMEOS) | 
|   59   NOTREACHED(); |   58   NOTREACHED(); | 
|   60 #else |   59 #else | 
|   61   chrome::ScopedTabbedBrowserDisplayer displayer(profile_); |   60   chrome::ScopedTabbedBrowserDisplayer displayer(profile_); | 
|   62   profiles::BubbleViewMode signin_mode = profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN; |   61   chrome::ShowBrowserSignin( | 
|   63   if (SigninViewController::ShouldShowModalSigninForMode(signin_mode)) { |   62       displayer.browser(), | 
|   64     displayer.browser()->ShowModalSigninWindow(signin_mode, |   63       signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); | 
|   65         signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); |  | 
|   66   } else { |  | 
|   67     chrome::ShowBrowserSignin( |  | 
|   68         displayer.browser(), |  | 
|   69         signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); |  | 
|   70   } |  | 
|   71 #endif |   64 #endif | 
|   72 } |   65 } | 
|   73  |   66  | 
|   74 void LoginUIService::DisplayLoginResult(Browser* browser, |   67 void LoginUIService::DisplayLoginResult(Browser* browser, | 
|   75                                         const base::string16& error_message, |   68                                         const base::string16& error_message, | 
|   76                                         const base::string16& email) { |   69                                         const base::string16& email) { | 
|   77 #if defined(OS_CHROMEOS) |   70 #if defined(OS_CHROMEOS) | 
|   78   // ChromeOS doesn't have the avatar bubble so it never calls this function. |   71   // ChromeOS doesn't have the avatar bubble so it never calls this function. | 
|   79   NOTREACHED(); |   72   NOTREACHED(); | 
|   80 #endif |   73 #endif | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
|   94   } |   87   } | 
|   95 } |   88 } | 
|   96  |   89  | 
|   97 const base::string16& LoginUIService::GetLastLoginResult() const { |   90 const base::string16& LoginUIService::GetLastLoginResult() const { | 
|   98   return last_login_result_; |   91   return last_login_result_; | 
|   99 } |   92 } | 
|  100  |   93  | 
|  101 const base::string16& LoginUIService::GetLastLoginErrorEmail() const { |   94 const base::string16& LoginUIService::GetLastLoginErrorEmail() const { | 
|  102   return last_login_error_email_; |   95   return last_login_error_email_; | 
|  103 } |   96 } | 
| OLD | NEW |