[email protected] | 40f04797 | 2009-11-25 03:54:40 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
| 6 | #define CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
| 7 | |
| 8 | #include "base/string16.h" |
| 9 | #include "chrome/browser/sync/profile_sync_service.h" |
| 10 | |
| 11 | class Profile; |
| 12 | |
| 13 | // Utility functions to gather current sync status information from the sync |
| 14 | // service and constructs messages suitable for showing in UI. |
| 15 | namespace sync_ui_util { |
| 16 | |
| 17 | enum MessageType { |
| 18 | PRE_SYNCED, // User has not set up sync. |
| 19 | SYNCED, // We are synced and authenticated to a gmail account. |
| 20 | SYNC_ERROR, // A sync error (such as invalid credentials) has occurred. |
| 21 | }; |
| 22 | |
| 23 | // Create status and link labels for the current status labels and link text |
| 24 | // by querying |service|. |
| 25 | MessageType GetStatusLabels(ProfileSyncService* service, |
| 26 | string16* status_label, |
| 27 | string16* link_label); |
| 28 | |
[email protected] | 5c086d7 | 2009-12-14 20:49:04 | [diff] [blame^] | 29 | MessageType GetStatus(ProfileSyncService* service); |
| 30 | |
[email protected] | 40f04797 | 2009-11-25 03:54:40 | [diff] [blame] | 31 | // Open the appropriate sync dialog for the given profile (which can be |
| 32 | // incognito). |code| should be one of the START_FROM_* codes. |
| 33 | void OpenSyncMyBookmarksDialog( |
| 34 | Profile* profile, ProfileSyncService::SyncEventCodes code); |
| 35 | } // namespace sync_ui_util |
| 36 | |
| 37 | #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
| 38 | |