| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/profile_info_watcher.h" | 5 #include "chrome/browser/ui/webui/profile_info_watcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/prefs/pref_service.h" | |
| 10 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_info_cache.h" | 11 #include "chrome/browser/profiles/profile_info_cache.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
| 15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 15 #include "components/prefs/pref_service.h" |
| 16 #include "components/signin/core/browser/signin_manager.h" | 16 #include "components/signin/core/browser/signin_manager.h" |
| 17 #include "components/signin/core/common/signin_pref_names.h" | 17 #include "components/signin/core/common/signin_pref_names.h" |
| 18 | 18 |
| 19 ProfileInfoWatcher::ProfileInfoWatcher( | 19 ProfileInfoWatcher::ProfileInfoWatcher( |
| 20 Profile* profile, const base::Closure& callback) | 20 Profile* profile, const base::Closure& callback) |
| 21 : profile_(profile), callback_(callback) { | 21 : profile_(profile), callback_(callback) { |
| 22 DCHECK(profile_); | 22 DCHECK(profile_); |
| 23 DCHECK(!callback_.is_null()); | 23 DCHECK(!callback_.is_null()); |
| 24 | 24 |
| 25 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 25 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 SigninManagerBase* ProfileInfoWatcher::GetSigninManager() const { | 54 SigninManagerBase* ProfileInfoWatcher::GetSigninManager() const { |
| 55 return SigninManagerFactory::GetForProfile(profile_); | 55 return SigninManagerFactory::GetForProfile(profile_); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ProfileInfoWatcher::RunCallback() { | 58 void ProfileInfoWatcher::RunCallback() { |
| 59 if (GetSigninManager()) | 59 if (GetSigninManager()) |
| 60 callback_.Run(); | 60 callback_.Run(); |
| 61 } | 61 } |
| OLD | NEW |