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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 ? ScriptExecutor::ALL_FRAMES | 142 ? ScriptExecutor::ALL_FRAMES |
143 : ScriptExecutor::TOP_FRAME; | 143 : ScriptExecutor::TOP_FRAME; |
144 | 144 |
145 ScriptExecutor::MatchAboutBlank match_about_blank = | 145 ScriptExecutor::MatchAboutBlank match_about_blank = |
146 details_->match_about_blank.get() && *details_->match_about_blank | 146 details_->match_about_blank.get() && *details_->match_about_blank |
147 ? ScriptExecutor::MATCH_ABOUT_BLANK | 147 ? ScriptExecutor::MATCH_ABOUT_BLANK |
148 : ScriptExecutor::DONT_MATCH_ABOUT_BLANK; | 148 : ScriptExecutor::DONT_MATCH_ABOUT_BLANK; |
149 | 149 |
150 UserScript::RunLocation run_at = UserScript::UNDEFINED; | 150 UserScript::RunLocation run_at = UserScript::UNDEFINED; |
151 switch (details_->run_at) { | 151 switch (details_->run_at) { |
152 case InjectDetails::RUN_AT_NONE: | 152 case core_api::extension_types::INJECT_DETAILS_RUN_AT_NONE: |
153 case InjectDetails::RUN_AT_DOCUMENT_IDLE: | 153 case core_api::extension_types::INJECT_DETAILS_RUN_AT_DOCUMENT_IDLE: |
154 run_at = UserScript::DOCUMENT_IDLE; | 154 run_at = UserScript::DOCUMENT_IDLE; |
155 break; | 155 break; |
156 case InjectDetails::RUN_AT_DOCUMENT_START: | 156 case core_api::extension_types::INJECT_DETAILS_RUN_AT_DOCUMENT_START: |
157 run_at = UserScript::DOCUMENT_START; | 157 run_at = UserScript::DOCUMENT_START; |
158 break; | 158 break; |
159 case InjectDetails::RUN_AT_DOCUMENT_END: | 159 case core_api::extension_types::INJECT_DETAILS_RUN_AT_DOCUMENT_END: |
160 run_at = UserScript::DOCUMENT_END; | 160 run_at = UserScript::DOCUMENT_END; |
161 break; | 161 break; |
162 } | 162 } |
163 CHECK_NE(UserScript::UNDEFINED, run_at); | 163 CHECK_NE(UserScript::UNDEFINED, run_at); |
164 | 164 |
165 executor->ExecuteScript( | 165 executor->ExecuteScript( |
166 host_id_, | 166 host_id_, |
167 script_type, | 167 script_type, |
168 code_string, | 168 code_string, |
169 frame_scope, | 169 frame_scope, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 const base::ListValue& result) { | 243 const base::ListValue& result) { |
244 if (!error.empty()) | 244 if (!error.empty()) |
245 SetError(error); | 245 SetError(error); |
246 | 246 |
247 SendResponse(error.empty()); | 247 SendResponse(error.empty()); |
248 } | 248 } |
249 | 249 |
250 } // namespace extensions | 250 } // namespace extensions |
251 | 251 |
252 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ | 252 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_IMPL_H_ |
OLD | NEW |