| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/sync/engine/auth_watcher.h" | 5 #include "chrome/browser/sync/engine/auth_watcher.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/sync/engine/all_status.h" | 9 #include "chrome/browser/sync/engine/all_status.h" |
| 10 #include "chrome/browser/sync/engine/authenticator.h" | 10 #include "chrome/browser/sync/engine/authenticator.h" |
| 11 #include "chrome/browser/sync/engine/net/gaia_authenticator.h" | 11 #include "chrome/browser/sync/engine/net/gaia_authenticator.h" |
| 12 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 12 #include "chrome/browser/sync/engine/net/server_connection_manager.h" |
| 13 #include "chrome/browser/sync/notifier/listener/talk_mediator.h" | |
| 14 #include "chrome/browser/sync/syncable/directory_manager.h" | 13 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 15 #include "chrome/browser/sync/syncable/syncable.h" | 14 #include "chrome/browser/sync/syncable/syncable.h" |
| 16 #include "chrome/browser/sync/util/user_settings.h" | 15 #include "chrome/browser/sync/util/user_settings.h" |
| 17 #include "chrome/common/deprecated/event_sys-inl.h" | 16 #include "chrome/common/deprecated/event_sys-inl.h" |
| 17 #include "chrome/common/net/notifier/listener/talk_mediator.h" |
| 18 | 18 |
| 19 // How authentication happens: | 19 // How authentication happens: |
| 20 // | 20 // |
| 21 // Kick Off: | 21 // Kick Off: |
| 22 // The sync API looks to see if the user's name and | 22 // The sync API looks to see if the user's name and |
| 23 // password are stored. If so, it calls authwatcher.Authenticate() with | 23 // password are stored. If so, it calls authwatcher.Authenticate() with |
| 24 // them. Otherwise it fires an error event. | 24 // them. Otherwise it fires an error event. |
| 25 // | 25 // |
| 26 // On failed Gaia Auth: | 26 // On failed Gaia Auth: |
| 27 // The AuthWatcher attempts to use saved hashes to authenticate | 27 // The AuthWatcher attempts to use saved hashes to authenticate |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 string AuthWatcher::email() const { | 370 string AuthWatcher::email() const { |
| 371 return gaia_->email(); | 371 return gaia_->email(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 void AuthWatcher::NotifyListeners(AuthWatcherEvent* event) { | 374 void AuthWatcher::NotifyListeners(AuthWatcherEvent* event) { |
| 375 event->trigger = current_attempt_trigger_; | 375 event->trigger = current_attempt_trigger_; |
| 376 channel_->NotifyListeners(*event); | 376 channel_->NotifyListeners(*event); |
| 377 } | 377 } |
| 378 | 378 |
| 379 } // namespace browser_sync | 379 } // namespace browser_sync |
| OLD | NEW |