OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """An implementation of the server side of the Chromium sync protocol. | 5 """An implementation of the server side of the Chromium sync protocol. |
6 | 6 |
7 The details of the protocol are described mostly by comments in the protocol | 7 The details of the protocol are described mostly by comments in the protocol |
8 buffer definition at chrome/browser/sync/protocol/sync.proto. | 8 buffer definition at chrome/browser/sync/protocol/sync.proto. |
9 """ | 9 """ |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 HISTORY_DELETE_DIRECTIVE, | 82 HISTORY_DELETE_DIRECTIVE, |
83 MANAGED_USER_SETTING, | 83 MANAGED_USER_SETTING, |
84 MANAGED_USER_SHARED_SETTING, | 84 MANAGED_USER_SHARED_SETTING, |
85 MANAGED_USER_WHITELIST, | 85 MANAGED_USER_WHITELIST, |
86 MANAGED_USER, | 86 MANAGED_USER, |
87 NIGORI, | 87 NIGORI, |
88 PASSWORD, | 88 PASSWORD, |
89 PREFERENCE, | 89 PREFERENCE, |
90 PRINTERS, | 90 PRINTERS, |
91 PRIORITY_PREFERENCE, | 91 PRIORITY_PREFERENCE, |
| 92 READING_LIST, |
92 SEARCH_ENGINE, | 93 SEARCH_ENGINE, |
93 SESSION, | 94 SESSION, |
94 SYNCED_NOTIFICATION, | 95 SYNCED_NOTIFICATION, |
95 SYNCED_NOTIFICATION_APP_INFO, | 96 SYNCED_NOTIFICATION_APP_INFO, |
96 THEME, | 97 THEME, |
97 TYPED_URL, | 98 TYPED_URL, |
98 EXTENSION_SETTINGS, | 99 EXTENSION_SETTINGS, |
99 FAVICON_IMAGES, | 100 FAVICON_IMAGES, |
100 FAVICON_TRACKING, | 101 FAVICON_TRACKING, |
101 WIFI_CREDENTIAL) = range(36) | 102 WIFI_CREDENTIAL) = range(37) |
102 | 103 |
103 # An enumeration on the frequency at which the server should send errors | 104 # An enumeration on the frequency at which the server should send errors |
104 # to the client. This would be specified by the url that triggers the error. | 105 # to the client. This would be specified by the url that triggers the error. |
105 # Note: This enum should be kept in the same order as the enum in sync_test.h. | 106 # Note: This enum should be kept in the same order as the enum in sync_test.h. |
106 SYNC_ERROR_FREQUENCY = ( | 107 SYNC_ERROR_FREQUENCY = ( |
107 ERROR_FREQUENCY_NONE, | 108 ERROR_FREQUENCY_NONE, |
108 ERROR_FREQUENCY_ALWAYS, | 109 ERROR_FREQUENCY_ALWAYS, |
109 ERROR_FREQUENCY_TWO_THIRDS) = range(3) | 110 ERROR_FREQUENCY_TWO_THIRDS) = range(3) |
110 | 111 |
111 # Well-known server tag of the top level 'Google Chrome' folder. | 112 # Well-known server tag of the top level 'Google Chrome' folder. |
(...skipping 25 matching lines...) Expand all Loading... |
137 MANAGED_USER_SHARED_SETTING: | 138 MANAGED_USER_SHARED_SETTING: |
138 SYNC_TYPE_FIELDS['managed_user_shared_setting'], | 139 SYNC_TYPE_FIELDS['managed_user_shared_setting'], |
139 MANAGED_USER_SETTING: SYNC_TYPE_FIELDS['managed_user_setting'], | 140 MANAGED_USER_SETTING: SYNC_TYPE_FIELDS['managed_user_setting'], |
140 MANAGED_USER_WHITELIST: SYNC_TYPE_FIELDS['managed_user_whitelist'], | 141 MANAGED_USER_WHITELIST: SYNC_TYPE_FIELDS['managed_user_whitelist'], |
141 MANAGED_USER: SYNC_TYPE_FIELDS['managed_user'], | 142 MANAGED_USER: SYNC_TYPE_FIELDS['managed_user'], |
142 NIGORI: SYNC_TYPE_FIELDS['nigori'], | 143 NIGORI: SYNC_TYPE_FIELDS['nigori'], |
143 PASSWORD: SYNC_TYPE_FIELDS['password'], | 144 PASSWORD: SYNC_TYPE_FIELDS['password'], |
144 PREFERENCE: SYNC_TYPE_FIELDS['preference'], | 145 PREFERENCE: SYNC_TYPE_FIELDS['preference'], |
145 PRINTERS: SYNC_TYPE_FIELDS['printer'], | 146 PRINTERS: SYNC_TYPE_FIELDS['printer'], |
146 PRIORITY_PREFERENCE: SYNC_TYPE_FIELDS['priority_preference'], | 147 PRIORITY_PREFERENCE: SYNC_TYPE_FIELDS['priority_preference'], |
| 148 READING_LIST: SYNC_TYPE_FIELDS['reading_list'], |
147 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], | 149 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], |
148 SESSION: SYNC_TYPE_FIELDS['session'], | 150 SESSION: SYNC_TYPE_FIELDS['session'], |
149 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], | 151 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], |
150 SYNCED_NOTIFICATION_APP_INFO: | 152 SYNCED_NOTIFICATION_APP_INFO: |
151 SYNC_TYPE_FIELDS["synced_notification_app_info"], | 153 SYNC_TYPE_FIELDS["synced_notification_app_info"], |
152 THEME: SYNC_TYPE_FIELDS['theme'], | 154 THEME: SYNC_TYPE_FIELDS['theme'], |
153 TYPED_URL: SYNC_TYPE_FIELDS['typed_url'], | 155 TYPED_URL: SYNC_TYPE_FIELDS['typed_url'], |
154 WIFI_CREDENTIAL: SYNC_TYPE_FIELDS["wifi_credential"], | 156 WIFI_CREDENTIAL: SYNC_TYPE_FIELDS["wifi_credential"], |
155 } | 157 } |
156 | 158 |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 PermanentItem('google_chrome_passwords', name='Passwords', | 569 PermanentItem('google_chrome_passwords', name='Passwords', |
568 parent_tag=ROOT_ID, sync_type=PASSWORD), | 570 parent_tag=ROOT_ID, sync_type=PASSWORD), |
569 PermanentItem('google_chrome_preferences', name='Preferences', | 571 PermanentItem('google_chrome_preferences', name='Preferences', |
570 parent_tag=ROOT_ID, sync_type=PREFERENCE), | 572 parent_tag=ROOT_ID, sync_type=PREFERENCE), |
571 PermanentItem('google_chrome_printer', name='Printers', | 573 PermanentItem('google_chrome_printer', name='Printers', |
572 parent_tag=ROOT_ID, sync_type=PRINTERS, | 574 parent_tag=ROOT_ID, sync_type=PRINTERS, |
573 create_by_default=False), | 575 create_by_default=False), |
574 PermanentItem('google_chrome_priority_preferences', | 576 PermanentItem('google_chrome_priority_preferences', |
575 name='Priority Preferences', | 577 name='Priority Preferences', |
576 parent_tag=ROOT_ID, sync_type=PRIORITY_PREFERENCE), | 578 parent_tag=ROOT_ID, sync_type=PRIORITY_PREFERENCE), |
| 579 PermanentItem('google_chrome_reading_list', name='Reading List', |
| 580 parent_tag=ROOT_ID, sync_type=READING_LIST), |
577 PermanentItem('google_chrome_synced_notifications', | 581 PermanentItem('google_chrome_synced_notifications', |
578 name='Synced Notifications', | 582 name='Synced Notifications', |
579 parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION), | 583 parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION), |
580 PermanentItem('google_chrome_synced_notification_app_info', | 584 PermanentItem('google_chrome_synced_notification_app_info', |
581 name='Synced Notification App Info', | 585 name='Synced Notification App Info', |
582 parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION_APP_INFO), | 586 parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION_APP_INFO), |
583 PermanentItem('google_chrome_search_engines', name='Search Engines', | 587 PermanentItem('google_chrome_search_engines', name='Search Engines', |
584 parent_tag=ROOT_ID, sync_type=SEARCH_ENGINE), | 588 parent_tag=ROOT_ID, sync_type=SEARCH_ENGINE), |
585 PermanentItem('google_chrome_sessions', name='Sessions', | 589 PermanentItem('google_chrome_sessions', name='Sessions', |
586 parent_tag=ROOT_ID, sync_type=SESSION), | 590 parent_tag=ROOT_ID, sync_type=SESSION), |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 | 1642 |
1639 Args: | 1643 Args: |
1640 sessions_commit_delay_seconds: The desired sync delay time for sessions. | 1644 sessions_commit_delay_seconds: The desired sync delay time for sessions. |
1641 """ | 1645 """ |
1642 if not self._client_command: | 1646 if not self._client_command: |
1643 self._client_command = client_commands_pb2.ClientCommand() | 1647 self._client_command = client_commands_pb2.ClientCommand() |
1644 | 1648 |
1645 self._client_command.sessions_commit_delay_seconds = \ | 1649 self._client_command.sessions_commit_delay_seconds = \ |
1646 sessions_commit_delay_seconds | 1650 sessions_commit_delay_seconds |
1647 return self._client_command | 1651 return self._client_command |
OLD | NEW |