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

Side by Side Diff: chrome/browser/android/banners/app_banner_settings_helper.cc

Issue 518803009: Move content_settings_pattern and content_settings_pattern_parser to the content_settings component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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 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" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/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;
22 } 22 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | chrome/browser/chromeos/attestation/platform_verification_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698