OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 3576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3587 if (!main_frame) { | 3587 if (!main_frame) { |
3588 Send(new ViewMsg_ExecuteCodeFinished(routing_id_, request_id, false)); | 3588 Send(new ViewMsg_ExecuteCodeFinished(routing_id_, request_id, false)); |
3589 return; | 3589 return; |
3590 } | 3590 } |
3591 | 3591 |
3592 if (is_js_code) { | 3592 if (is_js_code) { |
3593 std::vector<WebScriptSource> sources; | 3593 std::vector<WebScriptSource> sources; |
3594 sources.push_back( | 3594 sources.push_back( |
3595 WebScriptSource(WebString::fromUTF8(code_string))); | 3595 WebScriptSource(WebString::fromUTF8(code_string))); |
3596 UserScriptSlave::InsertInitExtensionCode(&sources, extension_id); | 3596 UserScriptSlave::InsertInitExtensionCode(&sources, extension_id); |
3597 main_frame->executeScriptInNewWorld(&sources.front(), sources.size(), | 3597 main_frame->executeScriptInIsolatedWorld( |
3598 EXTENSION_GROUP_CONTENT_SCRIPTS); | 3598 UserScriptSlave::GetIsolatedWorldId(extension_id), |
| 3599 &sources.front(), sources.size(), EXTENSION_GROUP_CONTENT_SCRIPTS); |
3599 } else { | 3600 } else { |
3600 main_frame->insertStyleText(WebString::fromUTF8(code_string), WebString()); | 3601 main_frame->insertStyleText(WebString::fromUTF8(code_string), WebString()); |
3601 } | 3602 } |
3602 | 3603 |
3603 Send(new ViewMsg_ExecuteCodeFinished(routing_id_, request_id, true)); | 3604 Send(new ViewMsg_ExecuteCodeFinished(routing_id_, request_id, true)); |
3604 } | 3605 } |
3605 | 3606 |
3606 void RenderView::DidHandleKeyEvent() { | 3607 void RenderView::DidHandleKeyEvent() { |
3607 edit_commands_.clear(); | 3608 edit_commands_.clear(); |
3608 } | 3609 } |
(...skipping 15 matching lines...) Expand all Loading... |
3624 new PluginMsg_SignalModalDialogEvent(host_window_)); | 3625 new PluginMsg_SignalModalDialogEvent(host_window_)); |
3625 | 3626 |
3626 message->EnableMessagePumping(); // Runs a nested message loop. | 3627 message->EnableMessagePumping(); // Runs a nested message loop. |
3627 bool rv = Send(message); | 3628 bool rv = Send(message); |
3628 | 3629 |
3629 PluginChannelHost::Broadcast( | 3630 PluginChannelHost::Broadcast( |
3630 new PluginMsg_ResetModalDialogEvent(host_window_)); | 3631 new PluginMsg_ResetModalDialogEvent(host_window_)); |
3631 | 3632 |
3632 return rv; | 3633 return rv; |
3633 } | 3634 } |
OLD | NEW |