| 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/browser/ui/webui/options/pepper_flash_content_settings_utils.h" | 5 #include "chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 namespace options { | 10 namespace options { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 return CONTENT_SETTING_DEFAULT; | 51 return CONTENT_SETTING_DEFAULT; |
| 52 } | 52 } |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 void PepperFlashContentSettingsUtils::FlashSiteSettingsToMediaExceptions( | 55 void PepperFlashContentSettingsUtils::FlashSiteSettingsToMediaExceptions( |
| 56 const ppapi::FlashSiteSettings& site_settings, | 56 const ppapi::FlashSiteSettings& site_settings, |
| 57 MediaExceptions* media_exceptions) { | 57 MediaExceptions* media_exceptions) { |
| 58 media_exceptions->clear(); | 58 media_exceptions->clear(); |
| 59 | 59 |
| 60 std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( | 60 auto builder = ContentSettingsPattern::CreateBuilder(); |
| 61 ContentSettingsPattern::CreateBuilder(false)); | |
| 62 builder->WithSchemeWildcard()->WithPortWildcard(); | 61 builder->WithSchemeWildcard()->WithPortWildcard(); |
| 63 for (ppapi::FlashSiteSettings::const_iterator iter = site_settings.begin(); | 62 for (ppapi::FlashSiteSettings::const_iterator iter = site_settings.begin(); |
| 64 iter != site_settings.end(); ++iter) { | 63 iter != site_settings.end(); ++iter) { |
| 65 builder->WithHost(iter->site); | 64 builder->WithHost(iter->site); |
| 66 | 65 |
| 67 ContentSettingsPattern pattern = builder->Build(); | 66 ContentSettingsPattern pattern = builder->Build(); |
| 68 if (!pattern.IsValid()) | 67 if (!pattern.IsValid()) |
| 69 continue; | 68 continue; |
| 70 | 69 |
| 71 ContentSetting setting = FlashPermissionToContentSetting(iter->permission); | 70 ContentSetting setting = FlashPermissionToContentSetting(iter->permission); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 120 } |
| 122 while (iter_2 != exceptions_2.end()) { | 121 while (iter_2 != exceptions_2.end()) { |
| 123 if (iter_2->setting != default_exception_1.setting) | 122 if (iter_2->setting != default_exception_1.setting) |
| 124 return false; | 123 return false; |
| 125 ++iter_2; | 124 ++iter_2; |
| 126 } | 125 } |
| 127 return true; | 126 return true; |
| 128 } | 127 } |
| 129 | 128 |
| 130 } // namespace options | 129 } // namespace options |
| OLD | NEW |