OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/content_settings_pattern.h" | 5 #include "chrome/common/content_settings_pattern.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 ContentSettingsPattern(parts, true)) { | 169 ContentSettingsPattern(parts, true)) { |
170 return ContentSettingsPattern(); | 170 return ContentSettingsPattern(); |
171 } | 171 } |
172 | 172 |
173 return ContentSettingsPattern(parts_, is_valid_); | 173 return ContentSettingsPattern(parts_, is_valid_); |
174 } | 174 } |
175 | 175 |
176 // static | 176 // static |
177 bool ContentSettingsPattern::Builder::Canonicalize(PatternParts* parts) { | 177 bool ContentSettingsPattern::Builder::Canonicalize(PatternParts* parts) { |
178 // Canonicalize the scheme part. | 178 // Canonicalize the scheme part. |
179 const std::string scheme(StringToLowerASCII(parts->scheme)); | 179 const std::string scheme(base::StringToLowerASCII(parts->scheme)); |
180 parts->scheme = scheme; | 180 parts->scheme = scheme; |
181 | 181 |
182 if (parts->scheme == std::string(url::kFileScheme) && | 182 if (parts->scheme == std::string(url::kFileScheme) && |
183 !parts->is_path_wildcard) { | 183 !parts->is_path_wildcard) { |
184 GURL url(std::string(url::kFileScheme) + | 184 GURL url(std::string(url::kFileScheme) + |
185 std::string(url::kStandardSchemeSeparator) + parts->path); | 185 std::string(url::kStandardSchemeSeparator) + parts->path); |
186 parts->path = url.path(); | 186 parts->path = url.path(); |
187 } | 187 } |
188 | 188 |
189 // Canonicalize the host part. | 189 // Canonicalize the host part. |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 if (!parts.is_port_wildcard && other_parts.is_port_wildcard) | 674 if (!parts.is_port_wildcard && other_parts.is_port_wildcard) |
675 return ContentSettingsPattern::PREDECESSOR; | 675 return ContentSettingsPattern::PREDECESSOR; |
676 | 676 |
677 int result = parts.port.compare(other_parts.port); | 677 int result = parts.port.compare(other_parts.port); |
678 if (result == 0) | 678 if (result == 0) |
679 return ContentSettingsPattern::IDENTITY; | 679 return ContentSettingsPattern::IDENTITY; |
680 if (result > 0) | 680 if (result > 0) |
681 return ContentSettingsPattern::DISJOINT_ORDER_PRE; | 681 return ContentSettingsPattern::DISJOINT_ORDER_PRE; |
682 return ContentSettingsPattern::DISJOINT_ORDER_POST; | 682 return ContentSettingsPattern::DISJOINT_ORDER_POST; |
683 } | 683 } |
OLD | NEW |