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