| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/permissions/chooser_context_base.h" | 5 #include "chrome/browser/permissions/chooser_context_base.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (!setting->GetList(kObjectListKey, &object_list)) | 84 if (!setting->GetList(kObjectListKey, &object_list)) |
| 85 continue; | 85 continue; |
| 86 | 86 |
| 87 for (const auto& object : *object_list) { | 87 for (const auto& object : *object_list) { |
| 88 base::DictionaryValue* object_dict; | 88 base::DictionaryValue* object_dict; |
| 89 if (!object->GetAsDictionary(&object_dict) || | 89 if (!object->GetAsDictionary(&object_dict) || |
| 90 !IsValidObject(*object_dict)) { | 90 !IsValidObject(*object_dict)) { |
| 91 continue; | 91 continue; |
| 92 } | 92 } |
| 93 | 93 |
| 94 results.push_back(base::WrapUnique( | 94 results.push_back(base::MakeUnique<Object>( |
| 95 new Object(requesting_origin, embedding_origin, object_dict, | 95 requesting_origin, embedding_origin, object_dict, |
| 96 content_setting.source, content_setting.incognito))); | 96 content_setting.source, content_setting.incognito)); |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 return results; | 100 return results; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void ChooserContextBase::GrantObjectPermission( | 103 void ChooserContextBase::GrantObjectPermission( |
| 104 const GURL& requesting_origin, | 104 const GURL& requesting_origin, |
| 105 const GURL& embedding_origin, | 105 const GURL& embedding_origin, |
| 106 std::unique_ptr<base::DictionaryValue> object) { | 106 std::unique_ptr<base::DictionaryValue> object) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return value; | 148 return value; |
| 149 } | 149 } |
| 150 | 150 |
| 151 void ChooserContextBase::SetWebsiteSetting(const GURL& requesting_origin, | 151 void ChooserContextBase::SetWebsiteSetting(const GURL& requesting_origin, |
| 152 const GURL& embedding_origin, | 152 const GURL& embedding_origin, |
| 153 std::unique_ptr<base::Value> value) { | 153 std::unique_ptr<base::Value> value) { |
| 154 host_content_settings_map_->SetWebsiteSettingDefaultScope( | 154 host_content_settings_map_->SetWebsiteSettingDefaultScope( |
| 155 requesting_origin, embedding_origin, data_content_settings_type_, | 155 requesting_origin, embedding_origin, data_content_settings_type_, |
| 156 std::string(), std::move(value)); | 156 std::string(), std::move(value)); |
| 157 } | 157 } |
| OLD | NEW |