Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: components/content_settings/core/browser/website_settings_info.h

Issue 1252073002: Move pref names and default value into WebsiteSettingsInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@website-settings-registry-simple
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_INFO_H_ 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_INFO_H_
6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_INFO_H_ 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_INFO_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/content_settings/core/common/content_settings_types.h" 11 #include "components/content_settings/core/common/content_settings_types.h"
12 12
13 namespace base {
14 class Value;
15 } // namespace base
16
13 namespace content_settings { 17 namespace content_settings {
14 18
15 // This class stores the properties related to a website setting. 19 // This class stores the properties related to a website setting.
16 // TODO(raymes): Move more properties into this class. 20 // TODO(raymes): Move more properties into this class.
17 class WebsiteSettingsInfo { 21 class WebsiteSettingsInfo {
18 public: 22 public:
19 WebsiteSettingsInfo(ContentSettingsType type, const std::string& name); 23 // Ownership of |default_value| remains with the caller.
Bernhard Bauer 2015/07/29 10:12:38 Should be |initial_default_value| (although, isn't
raymes 2015/07/30 05:25:03 Yeah, the default value can change. This is the in
24 WebsiteSettingsInfo(ContentSettingsType type,
25 const std::string& name,
26 base::Value* initial_default_value);
20 ~WebsiteSettingsInfo(); 27 ~WebsiteSettingsInfo();
21 28
22 ContentSettingsType type() const { return type_; } 29 ContentSettingsType type() const { return type_; }
23 const std::string& name() const { return name_; } 30 const std::string& name() const { return name_; }
24 31
32 const std::string& pref_name() const { return pref_name_; }
33 const std::string& default_value_pref_name() const {
34 return default_value_pref_name_;
35 }
36 int32_t initial_default_value() const { return initial_default_value_; }
37
25 private: 38 private:
26 const ContentSettingsType type_; 39 const ContentSettingsType type_;
27 const std::string name_; 40 const std::string name_;
28 41
42 const std::string pref_name_;
43 const std::string default_value_pref_name_;
44 int32_t initial_default_value_;
msramek 2015/07/29 09:20:07 Just int? This is mapped to Prefs::GetInteger(), r
Bernhard Bauer 2015/07/29 10:12:38 Yes please. The style guide says to use int unless
raymes 2015/07/30 05:25:03 Thanks. Sorry about this - this is something I'm g
45
29 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsInfo); 46 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsInfo);
30 }; 47 };
31 48
32 } // namespace content_settings 49 } // namespace content_settings
33 50
34 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_INFO_H_ 51 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698