| 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/renderer/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 599 |
| 600 void Dispatcher::RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) { | 600 void Dispatcher::RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) { |
| 601 ExtensionFrameHelper* frame_helper = ExtensionFrameHelper::Get(render_frame); | 601 ExtensionFrameHelper* frame_helper = ExtensionFrameHelper::Get(render_frame); |
| 602 if (!frame_helper) | 602 if (!frame_helper) |
| 603 return; // The frame is invisible to extensions. | 603 return; // The frame is invisible to extensions. |
| 604 | 604 |
| 605 frame_helper->RunScriptsAtDocumentEnd(); | 605 frame_helper->RunScriptsAtDocumentEnd(); |
| 606 // |frame_helper| and |render_frame| might be dead by now. | 606 // |frame_helper| and |render_frame| might be dead by now. |
| 607 } | 607 } |
| 608 | 608 |
| 609 void Dispatcher::RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) { |
| 610 ExtensionFrameHelper* frame_helper = ExtensionFrameHelper::Get(render_frame); |
| 611 if (!frame_helper) |
| 612 return; // The frame is invisible to extensions. |
| 613 |
| 614 frame_helper->RunScriptsAtDocumentIdle(); |
| 615 // |frame_helper| and |render_frame| might be dead by now. |
| 616 } |
| 617 |
| 609 void Dispatcher::OnExtensionResponse(int request_id, | 618 void Dispatcher::OnExtensionResponse(int request_id, |
| 610 bool success, | 619 bool success, |
| 611 const base::ListValue& response, | 620 const base::ListValue& response, |
| 612 const std::string& error) { | 621 const std::string& error) { |
| 613 bindings_system_->HandleResponse(request_id, success, response, error); | 622 bindings_system_->HandleResponse(request_id, success, response, error); |
| 614 } | 623 } |
| 615 | 624 |
| 616 void Dispatcher::DispatchEvent( | 625 void Dispatcher::DispatchEvent( |
| 617 const std::string& extension_id, | 626 const std::string& extension_id, |
| 618 const std::string& event_name, | 627 const std::string& event_name, |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 // The "guestViewDeny" module must always be loaded last. It registers | 1417 // The "guestViewDeny" module must always be loaded last. It registers |
| 1409 // error-providing custom elements for the GuestView types that are not | 1418 // error-providing custom elements for the GuestView types that are not |
| 1410 // available, and thus all of those types must have been checked and loaded | 1419 // available, and thus all of those types must have been checked and loaded |
| 1411 // (or not loaded) beforehand. | 1420 // (or not loaded) beforehand. |
| 1412 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1421 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
| 1413 module_system->Require("guestViewDeny"); | 1422 module_system->Require("guestViewDeny"); |
| 1414 } | 1423 } |
| 1415 } | 1424 } |
| 1416 | 1425 |
| 1417 } // namespace extensions | 1426 } // namespace extensions |
| OLD | NEW |