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 22 matching lines...) Expand all Loading... |
33 import client_commands_pb2 | 33 import client_commands_pb2 |
34 import dictionary_specifics_pb2 | 34 import dictionary_specifics_pb2 |
35 import get_updates_caller_info_pb2 | 35 import get_updates_caller_info_pb2 |
36 import extension_setting_specifics_pb2 | 36 import extension_setting_specifics_pb2 |
37 import extension_specifics_pb2 | 37 import extension_specifics_pb2 |
38 import favicon_image_specifics_pb2 | 38 import favicon_image_specifics_pb2 |
39 import favicon_tracking_specifics_pb2 | 39 import favicon_tracking_specifics_pb2 |
40 import history_delete_directive_specifics_pb2 | 40 import history_delete_directive_specifics_pb2 |
41 import managed_user_setting_specifics_pb2 | 41 import managed_user_setting_specifics_pb2 |
42 import managed_user_specifics_pb2 | 42 import managed_user_specifics_pb2 |
| 43 import managed_user_shared_setting_specifics_pb2 |
43 import nigori_specifics_pb2 | 44 import nigori_specifics_pb2 |
44 import password_specifics_pb2 | 45 import password_specifics_pb2 |
45 import preference_specifics_pb2 | 46 import preference_specifics_pb2 |
46 import priority_preference_specifics_pb2 | 47 import priority_preference_specifics_pb2 |
47 import search_engine_specifics_pb2 | 48 import search_engine_specifics_pb2 |
48 import session_specifics_pb2 | 49 import session_specifics_pb2 |
49 import sync_pb2 | 50 import sync_pb2 |
50 import sync_enums_pb2 | 51 import sync_enums_pb2 |
51 import synced_notification_data_pb2 | 52 import synced_notification_data_pb2 |
52 import synced_notification_render_pb2 | 53 import synced_notification_render_pb2 |
(...skipping 14 matching lines...) Expand all Loading... |
67 ARTICLE, | 68 ARTICLE, |
68 AUTOFILL, | 69 AUTOFILL, |
69 AUTOFILL_PROFILE, | 70 AUTOFILL_PROFILE, |
70 BOOKMARK, | 71 BOOKMARK, |
71 DEVICE_INFO, | 72 DEVICE_INFO, |
72 DICTIONARY, | 73 DICTIONARY, |
73 EXPERIMENTS, | 74 EXPERIMENTS, |
74 EXTENSIONS, | 75 EXTENSIONS, |
75 HISTORY_DELETE_DIRECTIVE, | 76 HISTORY_DELETE_DIRECTIVE, |
76 MANAGED_USER_SETTING, | 77 MANAGED_USER_SETTING, |
| 78 MANAGED_USER_SHARED_SETTING, |
77 MANAGED_USER, | 79 MANAGED_USER, |
78 NIGORI, | 80 NIGORI, |
79 PASSWORD, | 81 PASSWORD, |
80 PREFERENCE, | 82 PREFERENCE, |
81 PRIORITY_PREFERENCE, | 83 PRIORITY_PREFERENCE, |
82 SEARCH_ENGINE, | 84 SEARCH_ENGINE, |
83 SESSION, | 85 SESSION, |
84 SYNCED_NOTIFICATION, | 86 SYNCED_NOTIFICATION, |
85 THEME, | 87 THEME, |
86 TYPED_URL, | 88 TYPED_URL, |
87 EXTENSION_SETTINGS, | 89 EXTENSION_SETTINGS, |
88 FAVICON_IMAGES, | 90 FAVICON_IMAGES, |
89 FAVICON_TRACKING) = range(28) | 91 FAVICON_TRACKING) = range(29) |
90 | 92 |
91 # An enumeration on the frequency at which the server should send errors | 93 # An enumeration on the frequency at which the server should send errors |
92 # to the client. This would be specified by the url that triggers the error. | 94 # to the client. This would be specified by the url that triggers the error. |
93 # Note: This enum should be kept in the same order as the enum in sync_test.h. | 95 # Note: This enum should be kept in the same order as the enum in sync_test.h. |
94 SYNC_ERROR_FREQUENCY = ( | 96 SYNC_ERROR_FREQUENCY = ( |
95 ERROR_FREQUENCY_NONE, | 97 ERROR_FREQUENCY_NONE, |
96 ERROR_FREQUENCY_ALWAYS, | 98 ERROR_FREQUENCY_ALWAYS, |
97 ERROR_FREQUENCY_TWO_THIRDS) = range(3) | 99 ERROR_FREQUENCY_TWO_THIRDS) = range(3) |
98 | 100 |
99 # Well-known server tag of the top level 'Google Chrome' folder. | 101 # Well-known server tag of the top level 'Google Chrome' folder. |
(...skipping 12 matching lines...) Expand all Loading... |
112 AUTOFILL_PROFILE: SYNC_TYPE_FIELDS['autofill_profile'], | 114 AUTOFILL_PROFILE: SYNC_TYPE_FIELDS['autofill_profile'], |
113 BOOKMARK: SYNC_TYPE_FIELDS['bookmark'], | 115 BOOKMARK: SYNC_TYPE_FIELDS['bookmark'], |
114 DEVICE_INFO: SYNC_TYPE_FIELDS['device_info'], | 116 DEVICE_INFO: SYNC_TYPE_FIELDS['device_info'], |
115 DICTIONARY: SYNC_TYPE_FIELDS['dictionary'], | 117 DICTIONARY: SYNC_TYPE_FIELDS['dictionary'], |
116 EXPERIMENTS: SYNC_TYPE_FIELDS['experiments'], | 118 EXPERIMENTS: SYNC_TYPE_FIELDS['experiments'], |
117 EXTENSION_SETTINGS: SYNC_TYPE_FIELDS['extension_setting'], | 119 EXTENSION_SETTINGS: SYNC_TYPE_FIELDS['extension_setting'], |
118 EXTENSIONS: SYNC_TYPE_FIELDS['extension'], | 120 EXTENSIONS: SYNC_TYPE_FIELDS['extension'], |
119 FAVICON_IMAGES: SYNC_TYPE_FIELDS['favicon_image'], | 121 FAVICON_IMAGES: SYNC_TYPE_FIELDS['favicon_image'], |
120 FAVICON_TRACKING: SYNC_TYPE_FIELDS['favicon_tracking'], | 122 FAVICON_TRACKING: SYNC_TYPE_FIELDS['favicon_tracking'], |
121 HISTORY_DELETE_DIRECTIVE: SYNC_TYPE_FIELDS['history_delete_directive'], | 123 HISTORY_DELETE_DIRECTIVE: SYNC_TYPE_FIELDS['history_delete_directive'], |
| 124 MANAGED_USER_SHARED_SETTING: |
| 125 SYNC_TYPE_FIELDS['managed_user_shared_setting'], |
122 MANAGED_USER_SETTING: SYNC_TYPE_FIELDS['managed_user_setting'], | 126 MANAGED_USER_SETTING: SYNC_TYPE_FIELDS['managed_user_setting'], |
123 MANAGED_USER: SYNC_TYPE_FIELDS['managed_user'], | 127 MANAGED_USER: SYNC_TYPE_FIELDS['managed_user'], |
124 NIGORI: SYNC_TYPE_FIELDS['nigori'], | 128 NIGORI: SYNC_TYPE_FIELDS['nigori'], |
125 PASSWORD: SYNC_TYPE_FIELDS['password'], | 129 PASSWORD: SYNC_TYPE_FIELDS['password'], |
126 PREFERENCE: SYNC_TYPE_FIELDS['preference'], | 130 PREFERENCE: SYNC_TYPE_FIELDS['preference'], |
127 PRIORITY_PREFERENCE: SYNC_TYPE_FIELDS['priority_preference'], | 131 PRIORITY_PREFERENCE: SYNC_TYPE_FIELDS['priority_preference'], |
128 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], | 132 SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], |
129 SESSION: SYNC_TYPE_FIELDS['session'], | 133 SESSION: SYNC_TYPE_FIELDS['session'], |
130 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], | 134 SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], |
131 THEME: SYNC_TYPE_FIELDS['theme'], | 135 THEME: SYNC_TYPE_FIELDS['theme'], |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 PermanentItem('google_chrome_favicon_tracking', | 523 PermanentItem('google_chrome_favicon_tracking', |
520 name='Favicon Tracking', | 524 name='Favicon Tracking', |
521 parent_tag=ROOT_ID, | 525 parent_tag=ROOT_ID, |
522 sync_type=FAVICON_TRACKING), | 526 sync_type=FAVICON_TRACKING), |
523 PermanentItem('google_chrome_managed_user_settings', | 527 PermanentItem('google_chrome_managed_user_settings', |
524 name='Managed User Settings', | 528 name='Managed User Settings', |
525 parent_tag=ROOT_ID, sync_type=MANAGED_USER_SETTING), | 529 parent_tag=ROOT_ID, sync_type=MANAGED_USER_SETTING), |
526 PermanentItem('google_chrome_managed_users', | 530 PermanentItem('google_chrome_managed_users', |
527 name='Managed Users', | 531 name='Managed Users', |
528 parent_tag=ROOT_ID, sync_type=MANAGED_USER), | 532 parent_tag=ROOT_ID, sync_type=MANAGED_USER), |
| 533 PermanentItem('google_chrome_managed_user_shared_settings', |
| 534 name='Managed User Shared Settings', |
| 535 parent_tag=ROOT_ID, sync_type=MANAGED_USER_SHARED_SETTING), |
529 PermanentItem('google_chrome_nigori', name='Nigori', | 536 PermanentItem('google_chrome_nigori', name='Nigori', |
530 parent_tag=ROOT_ID, sync_type=NIGORI), | 537 parent_tag=ROOT_ID, sync_type=NIGORI), |
531 PermanentItem('google_chrome_passwords', name='Passwords', | 538 PermanentItem('google_chrome_passwords', name='Passwords', |
532 parent_tag=ROOT_ID, sync_type=PASSWORD), | 539 parent_tag=ROOT_ID, sync_type=PASSWORD), |
533 PermanentItem('google_chrome_preferences', name='Preferences', | 540 PermanentItem('google_chrome_preferences', name='Preferences', |
534 parent_tag=ROOT_ID, sync_type=PREFERENCE), | 541 parent_tag=ROOT_ID, sync_type=PREFERENCE), |
535 PermanentItem('google_chrome_priority_preferences', | 542 PermanentItem('google_chrome_priority_preferences', |
536 name='Priority Preferences', | 543 name='Priority Preferences', |
537 parent_tag=ROOT_ID, sync_type=PRIORITY_PREFERENCE), | 544 parent_tag=ROOT_ID, sync_type=PRIORITY_PREFERENCE), |
538 PermanentItem('google_chrome_synced_notifications', | 545 PermanentItem('google_chrome_synced_notifications', |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 | 1641 |
1635 Args: | 1642 Args: |
1636 sessions_commit_delay_seconds: The desired sync delay time for sessions. | 1643 sessions_commit_delay_seconds: The desired sync delay time for sessions. |
1637 """ | 1644 """ |
1638 if not self._client_command: | 1645 if not self._client_command: |
1639 self._client_command = client_commands_pb2.ClientCommand() | 1646 self._client_command = client_commands_pb2.ClientCommand() |
1640 | 1647 |
1641 self._client_command.sessions_commit_delay_seconds = \ | 1648 self._client_command.sessions_commit_delay_seconds = \ |
1642 sessions_commit_delay_seconds | 1649 sessions_commit_delay_seconds |
1643 return self._client_command | 1650 return self._client_command |
OLD | NEW |