| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 CHECK_NE(UserScript::UNDEFINED, run_at); | 121 CHECK_NE(UserScript::UNDEFINED, run_at); |
| 122 | 122 |
| 123 executor->ExecuteScript( | 123 executor->ExecuteScript( |
| 124 extension->id(), | 124 extension->id(), |
| 125 script_type, | 125 script_type, |
| 126 code_string, | 126 code_string, |
| 127 frame_scope, | 127 frame_scope, |
| 128 run_at, | 128 run_at, |
| 129 ScriptExecutor::ISOLATED_WORLD, | 129 ScriptExecutor::ISOLATED_WORLD, |
| 130 IsWebView(), | 130 IsWebView() ? ScriptExecutor::WEB_VIEW_PROCESS |
| 131 : ScriptExecutor::DEFAULT_PROCESS, |
| 132 has_callback() ? ScriptExecutor::JSON_SERIALIZED_RESULT |
| 133 : ScriptExecutor::NO_RESULT, |
| 131 base::Bind(&ExecuteCodeFunction::OnExecuteCodeFinished, this)); | 134 base::Bind(&ExecuteCodeFunction::OnExecuteCodeFinished, this)); |
| 132 return true; | 135 return true; |
| 133 } | 136 } |
| 134 | 137 |
| 135 bool ExecuteCodeFunction::HasPermission() { | 138 bool ExecuteCodeFunction::HasPermission() { |
| 136 return true; | 139 return true; |
| 137 } | 140 } |
| 138 | 141 |
| 139 bool ExecuteCodeFunction::RunImpl() { | 142 bool ExecuteCodeFunction::RunImpl() { |
| 140 EXTENSION_FUNCTION_VALIDATE(Init()); | 143 EXTENSION_FUNCTION_VALIDATE(Init()); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 int32 on_page_id, | 186 int32 on_page_id, |
| 184 const GURL& on_url, | 187 const GURL& on_url, |
| 185 const base::ListValue& result) { | 188 const base::ListValue& result) { |
| 186 if (!error.empty()) | 189 if (!error.empty()) |
| 187 SetError(error); | 190 SetError(error); |
| 188 | 191 |
| 189 SendResponse(error.empty()); | 192 SendResponse(error.empty()); |
| 190 } | 193 } |
| 191 | 194 |
| 192 } // namespace extensions | 195 } // namespace extensions |
| OLD | NEW |