1// Copyright 2013 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_PROFILE_RESETTER_BRANDCODED_DEFAULT_SETTINGS_H_
6#define CHROME_BROWSER_PROFILE_RESETTER_BRANDCODED_DEFAULT_SETTINGS_H_
7
8#include <string>
9#include <vector>
10
11#include "base/basictypes.h"
12#include "base/memory/scoped_ptr.h"
13#include "base/values.h"
14
15// BrandcodedDefaultSettings provides a set of default settings
16// for ProfileResetter. They are specific to Chrome distribution channels.
17class BrandcodedDefaultSettings {
18 public:
19  BrandcodedDefaultSettings();
20  // Constructs BrandcodedDefaultSettings directly from preferences.
21  explicit BrandcodedDefaultSettings(const std::string& prefs);
22  ~BrandcodedDefaultSettings();
23
24  // The following methods return non-zero value if the default value was
25  // provided for given setting.
26  // After the call return_value contains a list of default engines.
27  // |return_value[0]| is default one.
28  scoped_ptr<base::ListValue> GetSearchProviderOverrides() const;
29
30  bool GetHomepage(std::string* homepage) const;
31  bool GetHomepageIsNewTab(bool* homepage_is_ntp) const;
32  bool GetShowHomeButton(bool* show_home_button) const;
33
34  // |extension_ids| is a list of extension ids.
35  bool GetExtensions(std::vector<std::string>* extension_ids) const;
36
37  bool GetRestoreOnStartup(int* restore_on_startup) const;
38  scoped_ptr<base::ListValue> GetUrlsToRestoreOnStartup() const;
39
40 private:
41  scoped_ptr<base::ListValue> ExtractList(const char* pref_name) const;
42
43  scoped_ptr<base::DictionaryValue> master_dictionary_;
44
45  DISALLOW_COPY_AND_ASSIGN(BrandcodedDefaultSettings);
46};
47
48#endif  // CHROME_BROWSER_PROFILE_RESETTER_BRANDCODED_DEFAULT_SETTINGS_H_
49