| 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 #include "extensions/browser/extension_function_dispatcher.h" | 5 #include "extensions/browser/extension_function_dispatcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } | 632 } |
| 633 | 633 |
| 634 function->SetArgs(¶ms.arguments); | 634 function->SetArgs(¶ms.arguments); |
| 635 function->set_source_url(params.source_url); | 635 function->set_source_url(params.source_url); |
| 636 function->set_request_id(params.request_id); | 636 function->set_request_id(params.request_id); |
| 637 function->set_has_callback(params.has_callback); | 637 function->set_has_callback(params.has_callback); |
| 638 function->set_user_gesture(params.user_gesture); | 638 function->set_user_gesture(params.user_gesture); |
| 639 function->set_extension(extension); | 639 function->set_extension(extension); |
| 640 function->set_profile_id(profile_id); | 640 function->set_profile_id(profile_id); |
| 641 function->set_response_callback(callback); | 641 function->set_response_callback(callback); |
| 642 function->set_source_tab_id(params.source_tab_id); | |
| 643 function->set_source_context_type( | 642 function->set_source_context_type( |
| 644 process_map.GetMostLikelyContextType(extension, requesting_process_id)); | 643 process_map.GetMostLikelyContextType(extension, requesting_process_id)); |
| 645 function->set_source_process_id(requesting_process_id); | 644 function->set_source_process_id(requesting_process_id); |
| 646 | 645 |
| 647 return function; | 646 return function; |
| 648 } | 647 } |
| 649 | 648 |
| 650 // static | 649 // static |
| 651 void ExtensionFunctionDispatcher::SendAccessDenied( | 650 void ExtensionFunctionDispatcher::SendAccessDenied( |
| 652 const ExtensionFunction::ResponseCallback& callback, | 651 const ExtensionFunction::ResponseCallback& callback, |
| 653 functions::HistogramValue histogram_value) { | 652 functions::HistogramValue histogram_value) { |
| 654 base::ListValue empty_list; | 653 base::ListValue empty_list; |
| 655 callback.Run(ExtensionFunction::FAILED, empty_list, | 654 callback.Run(ExtensionFunction::FAILED, empty_list, |
| 656 "Access to extension API denied.", histogram_value); | 655 "Access to extension API denied.", histogram_value); |
| 657 } | 656 } |
| 658 | 657 |
| 659 } // namespace extensions | 658 } // namespace extensions |
| OLD | NEW |