blob: 53f0036c87bb241ee59ba3336550cfc4933cf59d [file] [log] [blame]
[email protected]40f047972009-11-25 03:54:401// 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
11class Profile;
12
13// Utility functions to gather current sync status information from the sync
14// service and constructs messages suitable for showing in UI.
15namespace sync_ui_util {
16
17enum 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|.
25MessageType GetStatusLabels(ProfileSyncService* service,
26 string16* status_label,
27 string16* link_label);
28
[email protected]5c086d72009-12-14 20:49:0429MessageType GetStatus(ProfileSyncService* service);
30
[email protected]40f047972009-11-25 03:54:4031// Open the appropriate sync dialog for the given profile (which can be
32// incognito). |code| should be one of the START_FROM_* codes.
33void OpenSyncMyBookmarksDialog(
34 Profile* profile, ProfileSyncService::SyncEventCodes code);
35} // namespace sync_ui_util
36
37#endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_
38