summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sync_status_ui_helper.h
blob: fac77ea1e78d3ce8b8d7adf1a70f8d4931c33623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_
#define CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_

#include "base/string16.h"
#include "chrome/browser/sync/profile_sync_service.h"

class Profile;

// Utility to gather current sync status information from the sync service and
// constructs messages suitable for showing in UI.
class SyncStatusUIHelper {
 public:
  enum MessageType {
    PRE_SYNCED,  // User has not set up sync.
    SYNCED,      // We are synced and authenticated to a gmail account.
    SYNC_ERROR,  // A sync error (such as invalid credentials) has occurred.
  };

  // Create status and link labels for the current status labels and link text
  // by querying |service|.
  static MessageType GetLabels(ProfileSyncService* service,
                               string16* status_label,
                               string16* link_label);

  // Open the appropriate sync dialog for the given profile (which can be
  // incognito).  |code| should be one of the START_FROM_* codes.
  static void OpenSyncMyBookmarksDialog(
      Profile* profile, ProfileSyncService::SyncEventCodes code);

 private:
  DISALLOW_IMPLICIT_CONSTRUCTORS(SyncStatusUIHelper);
};

#endif  // CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_