Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: chrome/browser/ui/webui/site_settings_helper.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs(); 300 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs();
301 const base::ListValue* policy_urls = prefs->GetList( 301 const base::ListValue* policy_urls = prefs->GetList(
302 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC 302 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC
303 ? prefs::kAudioCaptureAllowedUrls 303 ? prefs::kAudioCaptureAllowedUrls
304 : prefs::kVideoCaptureAllowedUrls); 304 : prefs::kVideoCaptureAllowedUrls);
305 305
306 // Convert the URLs to |ContentSettingsPattern|s. Ignore any invalid ones. 306 // Convert the URLs to |ContentSettingsPattern|s. Ignore any invalid ones.
307 std::vector<ContentSettingsPattern> patterns; 307 std::vector<ContentSettingsPattern> patterns;
308 for (const auto& entry : *policy_urls) { 308 for (const auto& entry : *policy_urls) {
309 std::string url; 309 std::string url;
310 bool valid_string = entry.GetAsString(&url); 310 bool valid_string = entry->GetAsString(&url);
311 if (!valid_string) 311 if (!valid_string)
312 continue; 312 continue;
313 313
314 ContentSettingsPattern pattern = ContentSettingsPattern::FromString(url); 314 ContentSettingsPattern pattern = ContentSettingsPattern::FromString(url);
315 if (!pattern.IsValid()) 315 if (!pattern.IsValid())
316 continue; 316 continue;
317 317
318 patterns.push_back(pattern); 318 patterns.push_back(pattern);
319 } 319 }
320 320
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 } 454 }
455 } 455 }
456 456
457 for (auto& one_provider_exceptions : all_provider_exceptions) { 457 for (auto& one_provider_exceptions : all_provider_exceptions) {
458 for (auto& exception : one_provider_exceptions) 458 for (auto& exception : one_provider_exceptions)
459 exceptions->Append(std::move(exception)); 459 exceptions->Append(std::move(exception));
460 } 460 }
461 } 461 }
462 462
463 } // namespace site_settings 463 } // namespace site_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698