OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
6 #define CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 6 #define CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace sync_ui_util { | 25 namespace sync_ui_util { |
26 | 26 |
27 enum MessageType { | 27 enum MessageType { |
28 PRE_SYNCED, // User has not set up sync. | 28 PRE_SYNCED, // User has not set up sync. |
29 SYNCED, // We are synced and authenticated to a gmail account. | 29 SYNCED, // We are synced and authenticated to a gmail account. |
30 SYNC_ERROR, // A sync error (such as invalid credentials) has occurred. | 30 SYNC_ERROR, // A sync error (such as invalid credentials) has occurred. |
31 SYNC_PROMO, // A situation has occurred which should be brought to the user's | 31 SYNC_PROMO, // A situation has occurred which should be brought to the user's |
32 // attention, but not as an error. | 32 // attention, but not as an error. |
33 }; | 33 }; |
34 | 34 |
35 enum StatusLabelStyle { | |
36 PLAIN_TEXT, // Label will be plain-text only. | |
37 WITH_HTML // Label may contain an HTML-formatted link. | |
38 }; | |
39 | |
40 // TODO(akalin): audit the use of ProfileSyncService* service below, | 35 // TODO(akalin): audit the use of ProfileSyncService* service below, |
41 // and use const ProfileSyncService& service where possible. | 36 // and use const ProfileSyncService& service where possible. |
42 | 37 |
43 // Create status and link labels for the current status labels and link text | 38 // Create status and link labels for the current status labels and link text |
44 // by querying |service|. | 39 // by querying |service|. |
45 // |style| sets the link properties, see |StatusLabelStyle|. | 40 // |status_label| may contain an HTML-formatted link. |
46 MessageType GetStatusLabels(ProfileSyncService* service, | 41 MessageType GetStatusLabels(ProfileSyncService* service, |
47 StatusLabelStyle style, | |
48 string16* status_label, | 42 string16* status_label, |
49 string16* link_label); | 43 string16* link_label); |
50 | 44 |
51 // Same as above but for use specifically on the New Tab Page. | 45 // Same as above but for use specifically on the New Tab Page. |
52 // |status_label| may contain an HTML-formatted link. | 46 // |status_label| may contain an HTML-formatted link. |
53 MessageType GetStatusLabelsForNewTabPage(ProfileSyncService* service, | 47 MessageType GetStatusLabelsForNewTabPage(ProfileSyncService* service, |
54 string16* status_label, | 48 string16* status_label, |
55 string16* link_label); | 49 string16* link_label); |
56 | 50 |
57 // Gets various labels for the sync global error based on the sync error state. | 51 // Gets various labels for the sync global error based on the sync error state. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 85 |
92 // Returns a string describing the chrome version environment. Version format: | 86 // Returns a string describing the chrome version environment. Version format: |
93 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> | 87 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> |
94 // If version information is unavailable, returns "invalid." | 88 // If version information is unavailable, returns "invalid." |
95 // TODO(zea): this approximately matches MakeUserAgentForSyncApi in | 89 // TODO(zea): this approximately matches MakeUserAgentForSyncApi in |
96 // sync_backend_host.cc. Unify the two if possible. | 90 // sync_backend_host.cc. Unify the two if possible. |
97 std::string GetVersionString(); | 91 std::string GetVersionString(); |
98 | 92 |
99 } // namespace sync_ui_util | 93 } // namespace sync_ui_util |
100 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 94 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
OLD | NEW |