| 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 #ifndef EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ |
| 6 #define EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ | 6 #define EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ |
| 7 | 7 |
| 8 #include "extensions/browser/api/execute_code_function.h" | 8 #include "extensions/browser/api/execute_code_function.h" |
| 9 | 9 |
| 10 #include "extensions/browser/component_extension_resource_manager.h" | 10 #include "extensions/browser/component_extension_resource_manager.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 run_at = UserScript::DOCUMENT_END; | 144 run_at = UserScript::DOCUMENT_END; |
| 145 break; | 145 break; |
| 146 } | 146 } |
| 147 CHECK_NE(UserScript::UNDEFINED, run_at); | 147 CHECK_NE(UserScript::UNDEFINED, run_at); |
| 148 | 148 |
| 149 executor->ExecuteScript( | 149 executor->ExecuteScript( |
| 150 host_id_, script_type, code_string, frame_scope, frame_id, | 150 host_id_, script_type, code_string, frame_scope, frame_id, |
| 151 match_about_blank, run_at, ScriptExecutor::ISOLATED_WORLD, | 151 match_about_blank, run_at, ScriptExecutor::ISOLATED_WORLD, |
| 152 IsWebView() ? ScriptExecutor::WEB_VIEW_PROCESS | 152 IsWebView() ? ScriptExecutor::WEB_VIEW_PROCESS |
| 153 : ScriptExecutor::DEFAULT_PROCESS, | 153 : ScriptExecutor::DEFAULT_PROCESS, |
| 154 GetWebViewSrc(), file_url_, user_gesture_, | 154 GetWebViewSrc(), file_url_, user_gesture(), |
| 155 has_callback() ? ScriptExecutor::JSON_SERIALIZED_RESULT | 155 has_callback() ? ScriptExecutor::JSON_SERIALIZED_RESULT |
| 156 : ScriptExecutor::NO_RESULT, | 156 : ScriptExecutor::NO_RESULT, |
| 157 base::Bind(&ExecuteCodeFunction::OnExecuteCodeFinished, this)); | 157 base::Bind(&ExecuteCodeFunction::OnExecuteCodeFinished, this)); |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool ExecuteCodeFunction::HasPermission() { | 161 bool ExecuteCodeFunction::HasPermission() { |
| 162 return true; | 162 return true; |
| 163 } | 163 } |
| 164 | 164 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 const base::ListValue& result) { | 245 const base::ListValue& result) { |
| 246 if (!error.empty()) | 246 if (!error.empty()) |
| 247 SetError(error); | 247 SetError(error); |
| 248 | 248 |
| 249 SendResponse(error.empty()); | 249 SendResponse(error.empty()); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace extensions | 252 } // namespace extensions |
| 253 | 253 |
| 254 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ | 254 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ |
| OLD | NEW |