| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, PurgeUnappliedTypes); | 205 FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, PurgeUnappliedTypes); |
| 206 | 206 |
| 207 struct NotificationInfo { | 207 struct NotificationInfo { |
| 208 NotificationInfo(); | 208 NotificationInfo(); |
| 209 ~NotificationInfo(); | 209 ~NotificationInfo(); |
| 210 | 210 |
| 211 int total_count; | 211 int total_count; |
| 212 std::string payload; | 212 std::string payload; |
| 213 | 213 |
| 214 // Returned pointer owned by the caller. | 214 // Returned pointer owned by the caller. |
| 215 DictionaryValue* ToValue() const; | 215 base::DictionaryValue* ToValue() const; |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 base::TimeDelta GetNudgeDelayTimeDelta(const ModelType& model_type); | 218 base::TimeDelta GetNudgeDelayTimeDelta(const ModelType& model_type); |
| 219 | 219 |
| 220 typedef std::map<ModelType, NotificationInfo> NotificationInfoMap; | 220 typedef std::map<ModelType, NotificationInfo> NotificationInfoMap; |
| 221 typedef JsArgList (SyncManagerImpl::*UnboundJsMessageHandler)( | 221 typedef JsArgList (SyncManagerImpl::*UnboundJsMessageHandler)( |
| 222 const JsArgList&); | 222 const JsArgList&); |
| 223 typedef base::Callback<JsArgList(const JsArgList&)> JsMessageHandler; | 223 typedef base::Callback<JsArgList(const JsArgList&)> JsMessageHandler; |
| 224 typedef std::map<std::string, JsMessageHandler> JsMessageHandlerMap; | 224 typedef std::map<std::string, JsMessageHandler> JsMessageHandlerMap; |
| 225 | 225 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 const ModelTypeInvalidationMap& invalidation_map); | 272 const ModelTypeInvalidationMap& invalidation_map); |
| 273 | 273 |
| 274 // Checks for server reachabilty and requests a nudge. | 274 // Checks for server reachabilty and requests a nudge. |
| 275 void OnNetworkConnectivityChangedImpl(); | 275 void OnNetworkConnectivityChangedImpl(); |
| 276 | 276 |
| 277 // Helper function used only by the constructor. | 277 // Helper function used only by the constructor. |
| 278 void BindJsMessageHandler( | 278 void BindJsMessageHandler( |
| 279 const std::string& name, UnboundJsMessageHandler unbound_message_handler); | 279 const std::string& name, UnboundJsMessageHandler unbound_message_handler); |
| 280 | 280 |
| 281 // Returned pointer is owned by the caller. | 281 // Returned pointer is owned by the caller. |
| 282 static DictionaryValue* NotificationInfoToValue( | 282 static base::DictionaryValue* NotificationInfoToValue( |
| 283 const NotificationInfoMap& notification_info); | 283 const NotificationInfoMap& notification_info); |
| 284 | 284 |
| 285 static std::string NotificationInfoToString( | 285 static std::string NotificationInfoToString( |
| 286 const NotificationInfoMap& notification_info); | 286 const NotificationInfoMap& notification_info); |
| 287 | 287 |
| 288 // JS message handlers. | 288 // JS message handlers. |
| 289 JsArgList GetNotificationState(const JsArgList& args); | 289 JsArgList GetNotificationState(const JsArgList& args); |
| 290 JsArgList GetNotificationInfo(const JsArgList& args); | 290 JsArgList GetNotificationInfo(const JsArgList& args); |
| 291 JsArgList GetRootNodeDetails(const JsArgList& args); | 291 JsArgList GetRootNodeDetails(const JsArgList& args); |
| 292 JsArgList GetAllNodes(const JsArgList& args); | 292 JsArgList GetAllNodes(const JsArgList& args); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // changing passphrases, and in general handles sync-specific interactions | 387 // changing passphrases, and in general handles sync-specific interactions |
| 388 // with the cryptographer. | 388 // with the cryptographer. |
| 389 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; | 389 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; |
| 390 | 390 |
| 391 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); | 391 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); |
| 392 }; | 392 }; |
| 393 | 393 |
| 394 } // namespace syncer | 394 } // namespace syncer |
| 395 | 395 |
| 396 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 396 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
| OLD | NEW |