OLD | NEW |
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 #include "components/content_settings/core/browser/website_settings_info.h" | 5 #include "components/content_settings/core/browser/website_settings_info.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 const char* kPrefPrefix = "profile.content_settings.exceptions."; | 13 const char kPrefPrefix[] = "profile.content_settings.exceptions."; |
14 const char* kDefaultPrefPrefix = "profile.default_content_setting_values."; | 14 const char kDefaultPrefPrefix[] = "profile.default_content_setting_values."; |
15 | 15 |
16 std::string GetPrefName(const std::string& name, const char* prefix) { | 16 std::string GetPrefName(const std::string& name, const char* prefix) { |
17 std::string pref_name = name; | 17 std::string pref_name = name; |
18 base::ReplaceChars(pref_name, "-", "_", &pref_name); | 18 base::ReplaceChars(pref_name, "-", "_", &pref_name); |
19 return std::string(prefix).append(pref_name); | 19 return std::string(prefix).append(pref_name); |
20 } | 20 } |
21 | 21 |
22 } // namespace | 22 } // namespace |
23 | 23 |
24 namespace content_settings { | 24 namespace content_settings { |
(...skipping 10 matching lines...) Expand all Loading... |
35 // For legacy reasons the default value is currently restricted to be an int. | 35 // For legacy reasons the default value is currently restricted to be an int. |
36 // TODO(raymes): We should migrate the underlying pref to be a dictionary | 36 // TODO(raymes): We should migrate the underlying pref to be a dictionary |
37 // rather than an int. | 37 // rather than an int. |
38 DCHECK(!initial_default_value_ || | 38 DCHECK(!initial_default_value_ || |
39 initial_default_value_->IsType(base::Value::TYPE_INTEGER)); | 39 initial_default_value_->IsType(base::Value::TYPE_INTEGER)); |
40 } | 40 } |
41 | 41 |
42 WebsiteSettingsInfo::~WebsiteSettingsInfo() {} | 42 WebsiteSettingsInfo::~WebsiteSettingsInfo() {} |
43 | 43 |
44 } // namespace content_settings | 44 } // namespace content_settings |
OLD | NEW |