| 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/signin/signin_manager_base.h" | 5 #include "chrome/browser/signin/signin_manager_base.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/browser_process.h" | |
| 17 #include "chrome/browser/signin/about_signin_internals.h" | 16 #include "chrome/browser/signin/about_signin_internals.h" |
| 18 #include "chrome/browser/signin/about_signin_internals_factory.h" | 17 #include "chrome/browser/signin/about_signin_internals_factory.h" |
| 19 #include "chrome/browser/signin/signin_global_error.h" | 18 #include "chrome/browser/signin/signin_global_error.h" |
| 20 #include "chrome/browser/signin/signin_manager_cookie_helper.h" | 19 #include "chrome/browser/signin/signin_manager_cookie_helper.h" |
| 21 #include "chrome/browser/signin/token_service.h" | 20 #include "chrome/browser/signin/token_service.h" |
| 22 #include "chrome/browser/signin/token_service_factory.h" | 21 #include "chrome/browser/signin/token_service_factory.h" |
| 23 #include "chrome/browser/sync/sync_prefs.h" | 22 #include "chrome/browser/sync/sync_prefs.h" |
| 24 #include "chrome/browser/ui/global_error/global_error_service.h" | 23 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 25 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 24 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 26 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 38 : profile_(NULL), | 37 : profile_(NULL), |
| 39 weak_pointer_factory_(this) { | 38 weak_pointer_factory_(this) { |
| 40 } | 39 } |
| 41 | 40 |
| 42 SigninManagerBase::~SigninManagerBase() { | 41 SigninManagerBase::~SigninManagerBase() { |
| 43 DCHECK(!signin_global_error_.get()) << | 42 DCHECK(!signin_global_error_.get()) << |
| 44 "SigninManagerBase::Initialize called but not " | 43 "SigninManagerBase::Initialize called but not " |
| 45 "SigninManagerBase::Shutdown"; | 44 "SigninManagerBase::Shutdown"; |
| 46 } | 45 } |
| 47 | 46 |
| 48 void SigninManagerBase::Initialize(Profile* profile) { | 47 void SigninManagerBase::Initialize(Profile* profile, PrefService* local_state) { |
| 49 // Should never call Initialize() twice. | 48 // Should never call Initialize() twice. |
| 50 DCHECK(!IsInitialized()); | 49 DCHECK(!IsInitialized()); |
| 51 profile_ = profile; | 50 profile_ = profile; |
| 52 signin_global_error_.reset(new SigninGlobalError(this, profile)); | 51 signin_global_error_.reset(new SigninGlobalError(this, profile)); |
| 53 GlobalErrorServiceFactory::GetForProfile(profile_)->AddGlobalError( | 52 GlobalErrorServiceFactory::GetForProfile(profile_)->AddGlobalError( |
| 54 signin_global_error_.get()); | 53 signin_global_error_.get()); |
| 55 | 54 |
| 56 // If the user is clearing the token service from the command line, then | 55 // If the user is clearing the token service from the command line, then |
| 57 // clear their login info also (not valid to be logged in without any | 56 // clear their login info also (not valid to be logged in without any |
| 58 // tokens). | 57 // tokens). |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 NotifySigninValueChanged(field, value)); | 143 NotifySigninValueChanged(field, value)); |
| 145 } | 144 } |
| 146 | 145 |
| 147 void SigninManagerBase::NotifyDiagnosticsObservers( | 146 void SigninManagerBase::NotifyDiagnosticsObservers( |
| 148 const TimedSigninStatusField& field, | 147 const TimedSigninStatusField& field, |
| 149 const std::string& value) { | 148 const std::string& value) { |
| 150 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, | 149 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, |
| 151 signin_diagnostics_observers_, | 150 signin_diagnostics_observers_, |
| 152 NotifySigninValueChanged(field, value)); | 151 NotifySigninValueChanged(field, value)); |
| 153 } | 152 } |
| OLD | NEW |