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/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 function_name == kEventDispatchFunction) { | 535 function_name == kEventDispatchFunction) { |
536 RenderView* background_view = | 536 RenderView* background_view = |
537 ExtensionHelper::GetBackgroundPage(extension_id); | 537 ExtensionHelper::GetBackgroundPage(extension_id); |
538 if (background_view) { | 538 if (background_view) { |
539 background_view->Send(new ExtensionHostMsg_EventAck( | 539 background_view->Send(new ExtensionHostMsg_EventAck( |
540 background_view->GetRoutingID())); | 540 background_view->GetRoutingID())); |
541 } | 541 } |
542 } | 542 } |
543 } | 543 } |
544 | 544 |
545 void Dispatcher::OnDispatchOnConnect(int target_port_id, | 545 void Dispatcher::OnDispatchOnConnect( |
546 const std::string& channel_name, | 546 int target_port_id, |
547 const std::string& tab_json, | 547 const std::string& channel_name, |
548 const std::string& source_extension_id, | 548 const base::DictionaryValue& source_tab, |
549 const std::string& target_extension_id) { | 549 const ExtensionMsg_ExternalConnectionInfo& info) { |
550 MiscellaneousBindings::DispatchOnConnect( | 550 MiscellaneousBindings::DispatchOnConnect( |
551 v8_context_set_.GetAll(), | 551 v8_context_set_.GetAll(), |
552 target_port_id, channel_name, tab_json, | 552 target_port_id, channel_name, source_tab, |
553 source_extension_id, target_extension_id, | 553 info.source_id, info.target_id, info.source_url, |
554 NULL); // All render views. | 554 NULL); // All render views. |
555 } | 555 } |
556 | 556 |
557 void Dispatcher::OnDeliverMessage(int target_port_id, | 557 void Dispatcher::OnDeliverMessage(int target_port_id, |
558 const std::string& message) { | 558 const std::string& message) { |
559 MiscellaneousBindings::DeliverMessage( | 559 MiscellaneousBindings::DeliverMessage( |
560 v8_context_set_.GetAll(), | 560 v8_context_set_.GetAll(), |
561 target_port_id, | 561 target_port_id, |
562 message, | 562 message, |
563 NULL); // All render views. | 563 NULL); // All render views. |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1381 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
1382 v8::ThrowException( | 1382 v8::ThrowException( |
1383 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1383 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
1384 return false; | 1384 return false; |
1385 } | 1385 } |
1386 | 1386 |
1387 return true; | 1387 return true; |
1388 } | 1388 } |
1389 | 1389 |
1390 } // namespace extensions | 1390 } // namespace extensions |
OLD | NEW |