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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/content_settings/core/browser/website_settings_info.h
diff --git a/components/content_settings/core/browser/website_settings_info.h b/components/content_settings/core/browser/website_settings_info.h
index 435b9df0666c902a89462d4673b9eef91cae638f..20d42e3543fb637acb20017ce92d53b909129291 100644
--- a/components/content_settings/core/browser/website_settings_info.h
+++ b/components/content_settings/core/browser/website_settings_info.h
@@ -8,24 +8,44 @@
#include <string>
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "components/content_settings/core/common/content_settings_types.h"
+namespace base {
+class Value;
+} // namespace base
+
namespace content_settings {
// This class stores the properties related to a website setting.
// TODO(raymes): Move more properties into this class.
class WebsiteSettingsInfo {
public:
- WebsiteSettingsInfo(ContentSettingsType type, const std::string& name);
+ // Ownership of |initial_default_value| remains with the caller.
+ WebsiteSettingsInfo(ContentSettingsType type,
+ const std::string& name,
+ const base::Value* initial_default_value);
Bernhard Bauer 2015/07/30 08:13:00 You could also pass this in as a scoped_ptr, if yo
raymes 2015/08/03 03:18:17 Let me know if I've done what you were thinking :)
Bernhard Bauer 2015/08/03 07:33:52 Yup, exactly.
~WebsiteSettingsInfo();
ContentSettingsType type() const { return type_; }
const std::string& name() const { return name_; }
+ const std::string& pref_name() const { return pref_name_; }
+ const std::string& default_value_pref_name() const {
+ return default_value_pref_name_;
+ }
+ const base::Value* initial_default_value() const {
+ return initial_default_value_.get();
+ }
+
private:
const ContentSettingsType type_;
const std::string name_;
+ const std::string pref_name_;
+ const std::string default_value_pref_name_;
+ const scoped_ptr<base::Value> initial_default_value_;
+
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsInfo);
};

Powered by Google App Engine
This is Rietveld 408576698