| 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/browser_process.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" |
| 9 #include "chrome/browser/signin/signin_manager.h" | 11 #include "chrome/browser/signin/signin_manager.h" |
| 10 #include "chrome/browser/signin/signin_manager_factory.h" | 12 #include "chrome/browser/signin/signin_manager_factory.h" |
| 11 #include "chrome/browser/signin/signin_promo.h" | 13 #include "chrome/browser/signin/signin_promo.h" |
| 12 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
| 13 #include "chrome/browser/ui/browser_navigator.h" | 15 #include "chrome/browser/ui/browser_navigator.h" |
| 14 #include "chrome/browser/ui/chrome_pages.h" | 16 #include "chrome/browser/ui/chrome_pages.h" |
| 15 #include "chrome/browser/ui/extensions/application_launch.h" | 17 #include "chrome/browser/ui/extensions/application_launch.h" |
| 16 #include "chrome/browser/ui/host_desktop.h" | 18 #include "chrome/browser/ui/host_desktop.h" |
| 17 #include "chrome/common/extensions/extension_constants.h" | 19 #include "chrome/common/extensions/extension_constants.h" |
| 18 #include "content/public/common/page_transition_types.h" | 20 #include "content/public/common/page_transition_types.h" |
| 19 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
| 20 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 22 | 24 |
| 23 namespace { | 25 namespace { |
| 24 | 26 |
| 25 SigninManagerBase* GetSigninManager(Profile* profile) { | 27 SigninManagerBase* GetSigninManager(Profile* profile) { |
| 26 return SigninManagerFactory::GetForProfile(profile); | 28 return SigninManagerFactory::GetForProfile(profile); |
| 27 } | 29 } |
| 28 | 30 |
| 29 } // namespace | 31 } // namespace |
| 30 | 32 |
| 31 ChromeSigninDelegate::ChromeSigninDelegate(Profile* profile) | 33 ChromeSigninDelegate::ChromeSigninDelegate() {} |
| 32 : profile_(profile) {} | 34 |
| 35 ChromeSigninDelegate::~ChromeSigninDelegate() {} |
| 36 |
| 37 void ChromeSigninDelegate::SetProfile(Profile* profile) { |
| 38 profile_ = profile; |
| 39 } |
| 33 | 40 |
| 34 bool ChromeSigninDelegate::NeedSignin() { | 41 bool ChromeSigninDelegate::NeedSignin() { |
| 35 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
| 36 return false; | 43 return false; |
| 37 #else | 44 #else |
| 38 if (!profile_) | 45 if (!profile_) |
| 39 return false; | 46 return false; |
| 40 | 47 |
| 41 if (!GetSigninManager(profile_)) | 48 if (!GetSigninManager(profile_)) |
| 42 return false; | 49 return false; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 96 |
| 90 string16 ChromeSigninDelegate::GetLearnMoreLinkText() { | 97 string16 ChromeSigninDelegate::GetLearnMoreLinkText() { |
| 91 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 98 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 92 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_LEARN_MORE_TEXT); | 99 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_LEARN_MORE_TEXT); |
| 93 } | 100 } |
| 94 | 101 |
| 95 string16 ChromeSigninDelegate::GetSettingsLinkText() { | 102 string16 ChromeSigninDelegate::GetSettingsLinkText() { |
| 96 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 103 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 97 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_SETTINGS_TEXT); | 104 return rb.GetLocalizedString(IDS_APP_LIST_SIGNIN_SETTINGS_TEXT); |
| 98 } | 105 } |
| 99 | |
| 100 ChromeSigninDelegate::~ChromeSigninDelegate() {} | |
| OLD | NEW |