OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #if defined(BROWSER_SYNC) | |
6 | |
7 #ifndef CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ |
8 #define CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ |
9 | 7 |
10 #include "base/string16.h" | 8 #include "base/string16.h" |
11 | 9 |
12 class ProfileSyncService; | 10 class ProfileSyncService; |
13 | 11 |
14 // Utility to gather current sync status information from the sync service and | 12 // Utility to gather current sync status information from the sync service and |
15 // constructs messages suitable for showing in UI. | 13 // constructs messages suitable for showing in UI. |
16 class SyncStatusUIHelper { | 14 class SyncStatusUIHelper { |
17 public: | 15 public: |
18 enum MessageType { | 16 enum MessageType { |
19 PRE_SYNCED, // User has not set up sync. | 17 PRE_SYNCED, // User has not set up sync. |
20 SYNCED, // We are synced and authenticated to a gmail account. | 18 SYNCED, // We are synced and authenticated to a gmail account. |
21 SYNC_ERROR, // A sync error (such as invalid credentials) has occurred. | 19 SYNC_ERROR, // A sync error (such as invalid credentials) has occurred. |
22 }; | 20 }; |
23 | 21 |
24 // Create status and link labels for the current status labels and link text | 22 // Create status and link labels for the current status labels and link text |
25 // by querying |service|. | 23 // by querying |service|. |
26 static MessageType GetLabels(ProfileSyncService* service, | 24 static MessageType GetLabels(ProfileSyncService* service, |
27 string16* status_label, | 25 string16* status_label, |
28 string16* link_label); | 26 string16* link_label); |
29 private: | 27 private: |
30 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncStatusUIHelper); | 28 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncStatusUIHelper); |
31 }; | 29 }; |
32 | 30 |
33 #endif // CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ | 31 #endif // CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ |
34 #endif // defined(BROWSER_SYNC) | |
OLD | NEW |