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/token_service.h" | 5 #include "chrome/browser/signin/token_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 token_loading_query_(0), | 52 token_loading_query_(0), |
53 tokens_loaded_(false) { | 53 tokens_loaded_(false) { |
54 // Allow constructor to be called outside the UI thread, so it can be mocked | 54 // Allow constructor to be called outside the UI thread, so it can be mocked |
55 // out for unit tests. | 55 // out for unit tests. |
56 | 56 |
57 COMPILE_ASSERT(arraysize(kServices) == arraysize(fetchers_), | 57 COMPILE_ASSERT(arraysize(kServices) == arraysize(fetchers_), |
58 kServices_and_fetchers_dont_have_same_size); | 58 kServices_and_fetchers_dont_have_same_size); |
59 } | 59 } |
60 | 60 |
61 TokenService::~TokenService() { | 61 TokenService::~TokenService() { |
| 62 } |
| 63 |
| 64 void TokenService::Shutdown() { |
62 if (!source_.empty()) { | 65 if (!source_.empty()) { |
63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
64 ResetCredentialsInMemory(); | 67 ResetCredentialsInMemory(); |
65 } | 68 } |
| 69 web_data_service_ = NULL; |
66 } | 70 } |
67 | 71 |
68 void TokenService::Initialize(const char* const source, | 72 void TokenService::Initialize(const char* const source, |
69 Profile* profile) { | 73 Profile* profile) { |
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
71 if (!source_.empty()) { | 75 if (!source_.empty()) { |
72 // Already initialized. | 76 // Already initialized. |
73 return; | 77 return; |
74 } | 78 } |
75 DCHECK(!profile_); | 79 DCHECK(!profile_); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 457 |
454 void TokenService::AddSigninDiagnosticsObserver( | 458 void TokenService::AddSigninDiagnosticsObserver( |
455 SigninDiagnosticsObserver* observer) { | 459 SigninDiagnosticsObserver* observer) { |
456 signin_diagnostics_observers_.AddObserver(observer); | 460 signin_diagnostics_observers_.AddObserver(observer); |
457 } | 461 } |
458 | 462 |
459 void TokenService::RemoveSigninDiagnosticsObserver( | 463 void TokenService::RemoveSigninDiagnosticsObserver( |
460 SigninDiagnosticsObserver* observer) { | 464 SigninDiagnosticsObserver* observer) { |
461 signin_diagnostics_observers_.RemoveObserver(observer); | 465 signin_diagnostics_observers_.RemoveObserver(observer); |
462 } | 466 } |
OLD | NEW |