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