summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile_resetter/brandcoded_default_settings.h
blob: 2de40412b483203a50ceb32ec6b017da46df1d8c (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
39
40
41
42
43
44
45
46
47
48
// Copyright 2013 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_PROFILE_RESETTER_BRANDCODED_DEFAULT_SETTINGS_H_
#define CHROME_BROWSER_PROFILE_RESETTER_BRANDCODED_DEFAULT_SETTINGS_H_

#include <string>
#include <vector>

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"

// BrandcodedDefaultSettings provides a set of default settings
// for ProfileResetter. They are specific to Chrome distribution channels.
class BrandcodedDefaultSettings {
 public:
  BrandcodedDefaultSettings();
  // Constructs BrandcodedDefaultSettings directly from preferences.
  explicit BrandcodedDefaultSettings(const std::string& prefs);
  ~BrandcodedDefaultSettings();

  // The following methods return non-zero value if the default value was
  // provided for given setting.
  // After the call return_value contains a list of default engines.
  // |return_value[0]| is default one.
  scoped_ptr<base::ListValue> GetSearchProviderOverrides() const;

  bool GetHomepage(std::string* homepage) const;
  bool GetHomepageIsNewTab(bool* homepage_is_ntp) const;
  bool GetShowHomeButton(bool* show_home_button) const;

  // |extension_ids| is a list of extension ids.
  bool GetExtensions(std::vector<std::string>* extension_ids) const;

  bool GetRestoreOnStartup(int* restore_on_startup) const;
  scoped_ptr<base::ListValue> GetUrlsToRestoreOnStartup() const;

 private:
  scoped_ptr<base::ListValue> ExtractList(const char* pref_name) const;

  scoped_ptr<base::DictionaryValue> master_dictionary_;

  DISALLOW_COPY_AND_ASSIGN(BrandcodedDefaultSettings);
};

#endif  // CHROME_BROWSER_PROFILE_RESETTER_BRANDCODED_DEFAULT_SETTINGS_H_