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

Side by Side Diff: chrome/browser/media/chromeos_login_media_access_handler.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 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/media/chromeos_login_media_access_handler.h" 5 #include "chrome/browser/media/chromeos_login_media_access_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const base::Value* const raw_list_value = 56 const base::Value* const raw_list_value =
57 settings->GetPref(chromeos::kLoginVideoCaptureAllowedUrls); 57 settings->GetPref(chromeos::kLoginVideoCaptureAllowedUrls);
58 if (!raw_list_value) 58 if (!raw_list_value)
59 return false; 59 return false;
60 60
61 const base::ListValue* list_value; 61 const base::ListValue* list_value;
62 const bool is_list = raw_list_value->GetAsList(&list_value); 62 const bool is_list = raw_list_value->GetAsList(&list_value);
63 DCHECK(is_list); 63 DCHECK(is_list);
64 for (const auto& base_value : *list_value) { 64 for (const auto& base_value : *list_value) {
65 std::string value; 65 std::string value;
66 if (base_value.GetAsString(&value)) { 66 if (base_value->GetAsString(&value)) {
67 const ContentSettingsPattern pattern = 67 const ContentSettingsPattern pattern =
68 ContentSettingsPattern::FromString(value); 68 ContentSettingsPattern::FromString(value);
69 // Force administrators to specify more-specific patterns by ignoring the 69 // Force administrators to specify more-specific patterns by ignoring the
70 // global wildcard pattern. 70 // global wildcard pattern.
71 if (pattern == ContentSettingsPattern::Wildcard()) { 71 if (pattern == ContentSettingsPattern::Wildcard()) {
72 VLOG(1) << "Ignoring wildcard URL pattern: " << value; 72 VLOG(1) << "Ignoring wildcard URL pattern: " << value;
73 continue; 73 continue;
74 } 74 }
75 if (pattern.IsValid() && pattern.Matches(security_origin)) 75 if (pattern.IsValid() && pattern.Matches(security_origin))
76 return true; 76 return true;
(...skipping 10 matching lines...) Expand all
87 bool audio_allowed = false; 87 bool audio_allowed = false;
88 bool video_allowed = 88 bool video_allowed =
89 request.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE && 89 request.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE &&
90 CheckMediaAccessPermission(web_contents, request.security_origin, 90 CheckMediaAccessPermission(web_contents, request.security_origin,
91 content::MEDIA_DEVICE_VIDEO_CAPTURE, 91 content::MEDIA_DEVICE_VIDEO_CAPTURE,
92 extension); 92 extension);
93 93
94 CheckDevicesAndRunCallback(web_contents, request, callback, audio_allowed, 94 CheckDevicesAndRunCallback(web_contents, request, callback, audio_allowed,
95 video_allowed); 95 video_allowed);
96 } 96 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698