| 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/ui/app_list/chrome_signin_delegate.h" | 5 #include "chrome/browser/ui/app_list/chrome_signin_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/signin/signin_manager.h" | 9 #include "chrome/browser/signin/signin_manager.h" |
| 10 #include "chrome/browser/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 SigninManagerBase* GetSigninManager(Profile* profile) { | 25 SigninManagerBase* GetSigninManager(Profile* profile) { |
| 26 return SigninManagerFactory::GetForProfile(profile); | 26 return SigninManagerFactory::GetForProfile(profile); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 ChromeSigninDelegate::ChromeSigninDelegate(Profile* profile) | 31 ChromeSigninDelegate::ChromeSigninDelegate() {} |
| 32 : profile_(profile) {} | 32 |
| 33 ChromeSigninDelegate::~ChromeSigninDelegate() {} |
| 34 |
| 35 void ChromeSigninDelegate::SetProfile(Profile* profile) { |
| 36 profile_ = profile; |
| 37 } |
| 33 | 38 |
| 34 bool ChromeSigninDelegate::NeedSignin() { | 39 bool ChromeSigninDelegate::NeedSignin() { |
| 35 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| 36 return false; | 41 return false; |
| 37 #else | 42 #else |
| 38 if (!profile_) | 43 if (!profile_) |
| 39 return false; | 44 return false; |
| 40 | 45 |
| 41 if (!GetSigninManager(profile_)) | 46 if (!GetSigninManager(profile_)) |
| 42 return false; | 47 return false; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 94 |
| 90 string16 ChromeSigninDelegate::GetLearnMoreLinkText() { | 95 string16 ChromeSigninDelegate::GetLearnMoreLinkText() { |
| 91 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 96 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 92 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_LEARN_MORE_TEXT); | 97 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_LEARN_MORE_TEXT); |
| 93 } | 98 } |
| 94 | 99 |
| 95 string16 ChromeSigninDelegate::GetSettingsLinkText() { | 100 string16 ChromeSigninDelegate::GetSettingsLinkText() { |
| 96 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 101 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 97 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_SETTINGS_TEXT); | 102 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_SETTINGS_TEXT); |
| 98 } | 103 } |
| 99 | |
| 100 ChromeSigninDelegate::~ChromeSigninDelegate() {} | |
| OLD | NEW |