| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/site_settings_helper.h" | 5 #include "chrome/browser/ui/webui/site_settings_helper.h" |
| 6 | 6 |
| 7 #include <functional> | 7 #include <functional> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs(); | 299 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs(); |
| 300 const base::ListValue* policy_urls = prefs->GetList( | 300 const base::ListValue* policy_urls = prefs->GetList( |
| 301 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC | 301 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC |
| 302 ? prefs::kAudioCaptureAllowedUrls | 302 ? prefs::kAudioCaptureAllowedUrls |
| 303 : prefs::kVideoCaptureAllowedUrls); | 303 : prefs::kVideoCaptureAllowedUrls); |
| 304 | 304 |
| 305 // Convert the URLs to |ContentSettingsPattern|s. Ignore any invalid ones. | 305 // Convert the URLs to |ContentSettingsPattern|s. Ignore any invalid ones. |
| 306 std::vector<ContentSettingsPattern> patterns; | 306 std::vector<ContentSettingsPattern> patterns; |
| 307 for (const auto& entry : *policy_urls) { | 307 for (const auto& entry : *policy_urls) { |
| 308 std::string url; | 308 std::string url; |
| 309 bool valid_string = entry->GetAsString(&url); | 309 bool valid_string = entry.GetAsString(&url); |
| 310 if (!valid_string) | 310 if (!valid_string) |
| 311 continue; | 311 continue; |
| 312 | 312 |
| 313 ContentSettingsPattern pattern = ContentSettingsPattern::FromString(url); | 313 ContentSettingsPattern pattern = ContentSettingsPattern::FromString(url); |
| 314 if (!pattern.IsValid()) | 314 if (!pattern.IsValid()) |
| 315 continue; | 315 continue; |
| 316 | 316 |
| 317 patterns.push_back(pattern); | 317 patterns.push_back(pattern); |
| 318 } | 318 } |
| 319 | 319 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 453 } |
| 454 } | 454 } |
| 455 | 455 |
| 456 for (auto& one_provider_exceptions : all_provider_exceptions) { | 456 for (auto& one_provider_exceptions : all_provider_exceptions) { |
| 457 for (auto& exception : one_provider_exceptions) | 457 for (auto& exception : one_provider_exceptions) |
| 458 exceptions->Append(std::move(exception)); | 458 exceptions->Append(std::move(exception)); |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 | 461 |
| 462 } // namespace site_settings | 462 } // namespace site_settings |
| OLD | NEW |