| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/android/banners/app_banner_settings_helper.h" | 5 #include "chrome/browser/android/banners/app_banner_settings_helper.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/content_settings/host_content_settings_map.h" | |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 12 #include "components/content_settings/core/common/content_settings_pattern.h" | 12 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 std::string SanitizePackageName(std::string package_name) { | 17 std::string SanitizePackageName(std::string package_name) { |
| 18 // DictionaryValue doesn't allow '.' in the keys. Replace them with ' ' | 18 // DictionaryValue doesn't allow '.' in the keys. Replace them with ' ' |
| 19 // because you can't have a package name with a ' ' in it. | 19 // because you can't have a package name with a ' ' in it. |
| 20 std::replace(package_name.begin(), package_name.end(), '.', ' '); | 20 std::replace(package_name.begin(), package_name.end(), '.', ' '); |
| 21 return package_name; | 21 return package_name; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Update the setting and save it back. | 105 // Update the setting and save it back. |
| 106 banner_dict->SetBoolean(sanitized_package_name, false); | 106 banner_dict->SetBoolean(sanitized_package_name, false); |
| 107 settings->SetWebsiteSetting(pattern, | 107 settings->SetWebsiteSetting(pattern, |
| 108 ContentSettingsPattern::Wildcard(), | 108 ContentSettingsPattern::Wildcard(), |
| 109 CONTENT_SETTINGS_TYPE_APP_BANNER, | 109 CONTENT_SETTINGS_TYPE_APP_BANNER, |
| 110 std::string(), | 110 std::string(), |
| 111 banner_dict); | 111 banner_dict); |
| 112 } | 112 } |
| OLD | NEW |