blob: 0b9483e5f006b057b5455a7b796796652c266718 [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
[email protected]06eee70c2010-01-06 22:27:3923// TODO(akalin): audit the use of ProfileSyncService* service below,
24// and use const ProfileSyncService& service where possible.
25
[email protected]40f047972009-11-25 03:54:4026// Create status and link labels for the current status labels and link text
27// by querying |service|.
28MessageType GetStatusLabels(ProfileSyncService* service,
29 string16* status_label,
30 string16* link_label);
31
[email protected]5c086d72009-12-14 20:49:0432MessageType GetStatus(ProfileSyncService* service);
33
[email protected]06eee70c2010-01-06 22:27:3934// Determines whether or not the sync error button should be visible.
35bool ShouldShowSyncErrorButton(ProfileSyncService* service);
36
37// Returns a string with the synchronization status.
38string16 GetSyncMenuLabel(ProfileSyncService* service);
39
[email protected]40f047972009-11-25 03:54:4040// Open the appropriate sync dialog for the given profile (which can be
41// incognito). |code| should be one of the START_FROM_* codes.
42void OpenSyncMyBookmarksDialog(
43 Profile* profile, ProfileSyncService::SyncEventCodes code);
44} // namespace sync_ui_util
45
46#endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_
47