OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/subresource_filter/subresource_filter_content_settings_
manager.h" | 5 #include "chrome/browser/subresource_filter/subresource_filter_content_settings_
manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 ContentSetting GetContentSettingMatchingUrlWithEmptyPath(const GURL& url) { | 72 ContentSetting GetContentSettingMatchingUrlWithEmptyPath(const GURL& url) { |
73 ContentSettingsForOneType host_settings; | 73 ContentSettingsForOneType host_settings; |
74 GetSettingsMap()->GetSettingsForOneType( | 74 GetSettingsMap()->GetSettingsForOneType( |
75 ContentSettingsType::CONTENT_SETTINGS_TYPE_ADS, std::string(), | 75 ContentSettingsType::CONTENT_SETTINGS_TYPE_ADS, std::string(), |
76 &host_settings); | 76 &host_settings); |
77 GURL url_with_empty_path = url.GetWithEmptyPath(); | 77 GURL url_with_empty_path = url.GetWithEmptyPath(); |
78 for (const auto& it : host_settings) { | 78 for (const auto& it : host_settings) { |
79 // Need GURL conversion to get rid of unnecessary default ports. | 79 // Need GURL conversion to get rid of unnecessary default ports. |
80 if (GURL(it.primary_pattern.ToString()) == url_with_empty_path) | 80 if (GURL(it.primary_pattern.ToString()) == url_with_empty_path) |
81 return it.setting; | 81 return it.GetContentSetting(); |
82 } | 82 } |
83 return CONTENT_SETTING_DEFAULT; | 83 return CONTENT_SETTING_DEFAULT; |
84 } | 84 } |
85 | 85 |
86 base::SimpleTestClock* test_clock() { return test_clock_; } | 86 base::SimpleTestClock* test_clock() { return test_clock_; } |
87 | 87 |
88 private: | 88 private: |
89 base::ScopedTempDir scoped_dir_; | 89 base::ScopedTempDir scoped_dir_; |
90 | 90 |
91 content::TestBrowserThreadBundle thread_bundle_; | 91 content::TestBrowserThreadBundle thread_bundle_; |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 history_service->ExpireHistoryBetween(std::set<GURL>(), base::Time(), | 382 history_service->ExpireHistoryBetween(std::set<GURL>(), base::Time(), |
383 base::Time(), run_loop.QuitClosure(), | 383 base::Time(), run_loop.QuitClosure(), |
384 &task_tracker); | 384 &task_tracker); |
385 run_loop.Run(); | 385 run_loop.Run(); |
386 | 386 |
387 EXPECT_TRUE(settings_manager()->ShouldShowUIForSite(url1)); | 387 EXPECT_TRUE(settings_manager()->ShouldShowUIForSite(url1)); |
388 EXPECT_TRUE(settings_manager()->ShouldShowUIForSite(url2)); | 388 EXPECT_TRUE(settings_manager()->ShouldShowUIForSite(url2)); |
389 } | 389 } |
390 | 390 |
391 } // namespace | 391 } // namespace |
OLD | NEW |