| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extensions/api/execute_code_function.h" | 5 #include "chrome/browser/extensions/api/execute_code_function.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 7 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| 8 #include "chrome/browser/extensions/image_loader.h" | 8 #include "chrome/browser/extensions/image_loader.h" |
| 9 #include "chrome/browser/extensions/script_executor.h" | 9 #include "chrome/browser/extensions/script_executor.h" |
| 10 #include "chrome/common/extensions/api/i18n/default_locale_handler.h" | 10 #include "chrome/common/extensions/api/i18n/default_locale_handler.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 executor->ExecuteScript( | 143 executor->ExecuteScript( |
| 144 extension->id(), | 144 extension->id(), |
| 145 script_type, | 145 script_type, |
| 146 code_string, | 146 code_string, |
| 147 frame_scope, | 147 frame_scope, |
| 148 run_at, | 148 run_at, |
| 149 ScriptExecutor::ISOLATED_WORLD, | 149 ScriptExecutor::ISOLATED_WORLD, |
| 150 IsWebView() ? ScriptExecutor::WEB_VIEW_PROCESS | 150 IsWebView() ? ScriptExecutor::WEB_VIEW_PROCESS |
| 151 : ScriptExecutor::DEFAULT_PROCESS, | 151 : ScriptExecutor::DEFAULT_PROCESS, |
| 152 GetWebViewSrc(), |
| 152 file_url_, | 153 file_url_, |
| 153 user_gesture_, | 154 user_gesture_, |
| 154 has_callback() ? ScriptExecutor::JSON_SERIALIZED_RESULT | 155 has_callback() ? ScriptExecutor::JSON_SERIALIZED_RESULT |
| 155 : ScriptExecutor::NO_RESULT, | 156 : ScriptExecutor::NO_RESULT, |
| 156 base::Bind(&ExecuteCodeFunction::OnExecuteCodeFinished, this)); | 157 base::Bind(&ExecuteCodeFunction::OnExecuteCodeFinished, this)); |
| 157 return true; | 158 return true; |
| 158 } | 159 } |
| 159 | 160 |
| 160 bool ExecuteCodeFunction::HasPermission() { | 161 bool ExecuteCodeFunction::HasPermission() { |
| 161 return true; | 162 return true; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 int32 on_page_id, | 209 int32 on_page_id, |
| 209 const GURL& on_url, | 210 const GURL& on_url, |
| 210 const base::ListValue& result) { | 211 const base::ListValue& result) { |
| 211 if (!error.empty()) | 212 if (!error.empty()) |
| 212 SetError(error); | 213 SetError(error); |
| 213 | 214 |
| 214 SendResponse(error.empty()); | 215 SendResponse(error.empty()); |
| 215 } | 216 } |
| 216 | 217 |
| 217 } // namespace extensions | 218 } // namespace extensions |
| OLD | NEW |