| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/host_content_settings_map.h" | 5 #include "chrome/browser/host_content_settings_map.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // things users think of as "not webpages" don't break. | 94 // things users think of as "not webpages" don't break. |
| 95 static bool ShouldAllowAllContent(const GURL& url) { | 95 static bool ShouldAllowAllContent(const GURL& url) { |
| 96 return url.SchemeIs(chrome::kChromeInternalScheme) || | 96 return url.SchemeIs(chrome::kChromeInternalScheme) || |
| 97 url.SchemeIs(chrome::kChromeUIScheme) || | 97 url.SchemeIs(chrome::kChromeUIScheme) || |
| 98 url.SchemeIs(chrome::kExtensionScheme) || | 98 url.SchemeIs(chrome::kExtensionScheme) || |
| 99 url.SchemeIs(chrome::kGearsScheme) || | 99 url.SchemeIs(chrome::kGearsScheme) || |
| 100 url.SchemeIs(chrome::kUserScriptScheme); | 100 url.SchemeIs(chrome::kUserScriptScheme); |
| 101 } | 101 } |
| 102 } // namespace | 102 } // namespace |
| 103 | 103 |
| 104 |
| 105 struct HostContentSettingsMap::ExtendedContentSettings { |
| 106 ContentSettings content_settings; |
| 107 ResourceContentSettings content_settings_for_resources; |
| 108 }; |
| 109 |
| 104 // static | 110 // static |
| 105 HostContentSettingsMap::Pattern HostContentSettingsMap::Pattern::FromURL( | 111 HostContentSettingsMap::Pattern HostContentSettingsMap::Pattern::FromURL( |
| 106 const GURL& url) { | 112 const GURL& url) { |
| 107 return Pattern(!url.has_host() || url.HostIsIPAddress() ? | 113 return Pattern(!url.has_host() || url.HostIsIPAddress() ? |
| 108 net::GetHostOrSpecFromURL(url) : | 114 net::GetHostOrSpecFromURL(url) : |
| 109 std::string(kDomainWildcard) + url.host()); | 115 std::string(kDomainWildcard) + url.host()); |
| 110 } | 116 } |
| 111 | 117 |
| 112 // static | 118 // static |
| 113 HostContentSettingsMap::Pattern | 119 HostContentSettingsMap::Pattern |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 | 997 |
| 992 for (size_t i = 0; i < move_items.size(); ++i) { | 998 for (size_t i = 0; i < move_items.size(); ++i) { |
| 993 Value* pattern_settings_dictionary = NULL; | 999 Value* pattern_settings_dictionary = NULL; |
| 994 all_settings_dictionary->RemoveWithoutPathExpansion( | 1000 all_settings_dictionary->RemoveWithoutPathExpansion( |
| 995 move_items[i].first, &pattern_settings_dictionary); | 1001 move_items[i].first, &pattern_settings_dictionary); |
| 996 all_settings_dictionary->SetWithoutPathExpansion( | 1002 all_settings_dictionary->SetWithoutPathExpansion( |
| 997 move_items[i].second, pattern_settings_dictionary); | 1003 move_items[i].second, pattern_settings_dictionary); |
| 998 } | 1004 } |
| 999 } | 1005 } |
| 1000 | 1006 |
| OLD | NEW |