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 <cstdio> | 5 #include <cstdio> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 for (syncable::ModelTypePayloadMap::const_iterator it = | 44 for (syncable::ModelTypePayloadMap::const_iterator it = |
45 type_payloads.begin(); it != type_payloads.end(); ++it) { | 45 type_payloads.begin(); it != type_payloads.end(); ++it) { |
46 LOG(INFO) << (source == sync_notifier::REMOTE_NOTIFICATION ? | 46 LOG(INFO) << (source == sync_notifier::REMOTE_NOTIFICATION ? |
47 "Remote" : "Local") | 47 "Remote" : "Local") |
48 << " Notification: type = " | 48 << " Notification: type = " |
49 << syncable::ModelTypeToString(it->first) | 49 << syncable::ModelTypeToString(it->first) |
50 << ", payload = " << it->second; | 50 << ", payload = " << it->second; |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 virtual void OnNotificationStateChange( | 54 virtual void OnSyncNotifierStateChange( |
55 bool notifications_enabled) OVERRIDE { | 55 sync_notifier::SyncNotifierState sync_notifier_state) OVERRIDE { |
56 LOG(INFO) << "Notifications enabled: " << notifications_enabled; | 56 LOG(INFO) << "SyncNotifierState: " |
| 57 << sync_notifier::SyncNotifierStateToString(sync_notifier_state); |
57 } | 58 } |
58 | 59 |
59 private: | 60 private: |
60 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); | 61 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); |
61 }; | 62 }; |
62 | 63 |
63 class NullInvalidationStateTracker | 64 class NullInvalidationStateTracker |
64 : public base::SupportsWeakPtr<NullInvalidationStateTracker>, | 65 : public base::SupportsWeakPtr<NullInvalidationStateTracker>, |
65 public sync_notifier::InvalidationStateTracker { | 66 public sync_notifier::InvalidationStateTracker { |
66 public: | 67 public: |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 sync_notifier->UpdateCredentials(email, token); | 224 sync_notifier->UpdateCredentials(email, token); |
224 // Listen for notifications for all known types. | 225 // Listen for notifications for all known types. |
225 sync_notifier->UpdateEnabledTypes(syncable::ModelTypeSet::All()); | 226 sync_notifier->UpdateEnabledTypes(syncable::ModelTypeSet::All()); |
226 | 227 |
227 ui_loop.Run(); | 228 ui_loop.Run(); |
228 | 229 |
229 sync_notifier->RemoveObserver(¬ification_printer); | 230 sync_notifier->RemoveObserver(¬ification_printer); |
230 io_thread.Stop(); | 231 io_thread.Stop(); |
231 return 0; | 232 return 0; |
232 } | 233 } |
OLD | NEW |