| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/user_script_set.h" | 5 #include "extensions/renderer/user_script_set.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 RendererExtensionRegistry::Get()->GetByID(script->extension_id()); | 149 RendererExtensionRegistry::Get()->GetByID(script->extension_id()); |
| 150 if (whitelisted_only && | 150 if (whitelisted_only && |
| 151 (!extension || | 151 (!extension || |
| 152 !PermissionsData::CanExecuteScriptEverywhere(extension))) { | 152 !PermissionsData::CanExecuteScriptEverywhere(extension))) { |
| 153 continue; | 153 continue; |
| 154 } | 154 } |
| 155 | 155 |
| 156 scripts_.push_back(std::move(script)); | 156 scripts_.push_back(std::move(script)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 FOR_EACH_OBSERVER(Observer, observers_, | 159 for (auto& observer : observers_) |
| 160 OnUserScriptsUpdated(changed_hosts, scripts_)); | 160 observer.OnUserScriptsUpdated(changed_hosts, scripts_); |
| 161 return true; | 161 return true; |
| 162 } | 162 } |
| 163 | 163 |
| 164 std::unique_ptr<ScriptInjection> UserScriptSet::GetDeclarativeScriptInjection( | 164 std::unique_ptr<ScriptInjection> UserScriptSet::GetDeclarativeScriptInjection( |
| 165 int script_id, | 165 int script_id, |
| 166 content::RenderFrame* render_frame, | 166 content::RenderFrame* render_frame, |
| 167 int tab_id, | 167 int tab_id, |
| 168 UserScript::RunLocation run_location, | 168 UserScript::RunLocation run_location, |
| 169 const GURL& document_url, | 169 const GURL& document_url, |
| 170 bool log_activity) { | 170 bool log_activity) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 base::StringPiece script_content = file.GetContent(); | 269 base::StringPiece script_content = file.GetContent(); |
| 270 return script_sources_ | 270 return script_sources_ |
| 271 .insert(std::make_pair( | 271 .insert(std::make_pair( |
| 272 url, blink::WebString::fromUTF8(script_content.data(), | 272 url, blink::WebString::fromUTF8(script_content.data(), |
| 273 script_content.length()))) | 273 script_content.length()))) |
| 274 .first->second; | 274 .first->second; |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace extensions | 277 } // namespace extensions |
| OLD | NEW |