OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/extensions/schema_generated_bindings.h" | 5 #include "chrome/renderer/extensions/schema_generated_bindings.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 params.arguments.Swap(value_args); | 233 params.arguments.Swap(value_args); |
234 params.extension_id = current_context->extension_id(); | 234 params.extension_id = current_context->extension_id(); |
235 params.source_url = source_url; | 235 params.source_url = source_url; |
236 params.source_origin = source_origin.toString(); | 236 params.source_origin = source_origin.toString(); |
237 params.request_id = request_id; | 237 params.request_id = request_id; |
238 params.has_callback = has_callback; | 238 params.has_callback = has_callback; |
239 params.user_gesture = | 239 params.user_gesture = |
240 webframe ? webframe->isProcessingUserGesture() : false; | 240 webframe ? webframe->isProcessingUserGesture() : false; |
241 if (for_io_thread) { | 241 if (for_io_thread) { |
242 renderview->Send(new ExtensionHostMsg_RequestForIOThread( | 242 renderview->Send(new ExtensionHostMsg_RequestForIOThread( |
243 renderview->GetRoutingId(), params)); | 243 renderview->GetRoutingID(), params)); |
244 } else { | 244 } else { |
245 renderview->Send(new ExtensionHostMsg_Request( | 245 renderview->Send(new ExtensionHostMsg_Request( |
246 renderview->GetRoutingId(), params)); | 246 renderview->GetRoutingID(), params)); |
247 } | 247 } |
248 | 248 |
249 return v8::Undefined(); | 249 return v8::Undefined(); |
250 } | 250 } |
251 | 251 |
252 // Starts an API request to the browser, with an optional callback. The | 252 // Starts an API request to the browser, with an optional callback. The |
253 // callback will be dispatched to EventBindings::HandleResponse. | 253 // callback will be dispatched to EventBindings::HandleResponse. |
254 static v8::Handle<v8::Value> StartRequest(const v8::Arguments& args) { | 254 static v8::Handle<v8::Value> StartRequest(const v8::Arguments& args) { |
255 std::string str_args = *v8::String::Utf8Value(args[1]); | 255 std::string str_args = *v8::String::Utf8Value(args[1]); |
256 base::JSONReader reader; | 256 base::JSONReader reader; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 const std::string& extension_id) { | 411 const std::string& extension_id) { |
412 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin(); | 412 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin(); |
413 it != g_pending_requests.Get().end(); ++it) { | 413 it != g_pending_requests.Get().end(); ++it) { |
414 if (it->second->extension_id == extension_id) | 414 if (it->second->extension_id == extension_id) |
415 return true; | 415 return true; |
416 } | 416 } |
417 return false; | 417 return false; |
418 } | 418 } |
419 | 419 |
420 } // namespace | 420 } // namespace |
OLD | NEW |