summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles/chrome_version_service.h
blob: 425b8b867157c3082eae445ef2bd60e55f5f9d23 (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
// Copyright (c) 2012 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_PROFILES_CHROME_VERSION_SERVICE_H_
#define CHROME_BROWSER_PROFILES_CHROME_VERSION_SERVICE_H_

#include <string>

#include "base/basictypes.h"

class PrefService;

// This service manages a pref which is used to determine the version of
// Chrome by which the profile was created.
class ChromeVersionService {
 public:
  // Register the user pref we use.
  static void RegisterUserPrefs(PrefService* prefs);

  // Sets the version string in the pref for the current profile.
  static void SetVersion(PrefService* prefs, const std::string& version);

  // Returns the version of Chrome which created the profile.
  static std::string GetVersion(PrefService* prefs);

  // Handles setting the profile.created_by_version Pref
  static void OnProfileLoaded(PrefService* prefs, bool is_new_profile);

 private:
  DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeVersionService);
};

#endif  // CHROME_BROWSER_PROFILES_CHROME_VERSION_SERVICE_H_