OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) | 1063 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) |
1064 IPC_MESSAGE_HANDLER(ViewMsg_UpdateBrowserWindowId, | 1064 IPC_MESSAGE_HANDLER(ViewMsg_UpdateBrowserWindowId, |
1065 OnUpdateBrowserWindowId) | 1065 OnUpdateBrowserWindowId) |
1066 IPC_MESSAGE_HANDLER(ViewMsg_NotifyRenderViewType, | 1066 IPC_MESSAGE_HANDLER(ViewMsg_NotifyRenderViewType, |
1067 OnNotifyRendererViewType) | 1067 OnNotifyRendererViewType) |
1068 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) | 1068 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) |
1069 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) | 1069 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) |
1070 #if defined(OS_MACOSX) | 1070 #if defined(OS_MACOSX) |
1071 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) | 1071 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) |
1072 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) | 1072 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) |
1073 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionConfirmed, | 1073 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, |
1074 OnPluginImeCompositionConfirmed) | 1074 OnPluginImeCompositionCompleted) |
1075 #endif | 1075 #endif |
1076 IPC_MESSAGE_HANDLER(ViewMsg_SetEditCommandsForNextKeyEvent, | 1076 IPC_MESSAGE_HANDLER(ViewMsg_SetEditCommandsForNextKeyEvent, |
1077 OnSetEditCommandsForNextKeyEvent) | 1077 OnSetEditCommandsForNextKeyEvent) |
1078 IPC_MESSAGE_HANDLER(ViewMsg_ExecuteCode, | 1078 IPC_MESSAGE_HANDLER(ViewMsg_ExecuteCode, |
1079 OnExecuteCode) | 1079 OnExecuteCode) |
1080 IPC_MESSAGE_HANDLER(ViewMsg_CustomContextMenuAction, | 1080 IPC_MESSAGE_HANDLER(ViewMsg_CustomContextMenuAction, |
1081 OnCustomContextMenuAction) | 1081 OnCustomContextMenuAction) |
1082 IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage) | 1082 IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage) |
1083 IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation) | 1083 IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation) |
1084 IPC_MESSAGE_HANDLER(ViewMsg_EnableAccessibility, OnEnableAccessibility) | 1084 IPC_MESSAGE_HANDLER(ViewMsg_EnableAccessibility, OnEnableAccessibility) |
(...skipping 4144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5229 void RenderView::OnWindowFrameChanged(const gfx::Rect& window_frame, | 5229 void RenderView::OnWindowFrameChanged(const gfx::Rect& window_frame, |
5230 const gfx::Rect& view_frame) { | 5230 const gfx::Rect& view_frame) { |
5231 // Inform plugins that their window's frame has changed. | 5231 // Inform plugins that their window's frame has changed. |
5232 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 5232 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
5233 for (plugin_it = plugin_delegates_.begin(); | 5233 for (plugin_it = plugin_delegates_.begin(); |
5234 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 5234 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
5235 (*plugin_it)->WindowFrameChanged(window_frame, view_frame); | 5235 (*plugin_it)->WindowFrameChanged(window_frame, view_frame); |
5236 } | 5236 } |
5237 } | 5237 } |
5238 | 5238 |
5239 void RenderView::OnPluginImeCompositionConfirmed(const string16& text, | 5239 void RenderView::OnPluginImeCompositionCompleted(const string16& text, |
5240 int plugin_id) { | 5240 int plugin_id) { |
5241 // WebPluginDelegateProxy is responsible for figuring out if this text | 5241 // WebPluginDelegateProxy is responsible for figuring out if this event |
5242 // applies to it or not, so inform all the delegates. | 5242 // applies to it or not, so inform all the delegates. |
5243 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 5243 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
5244 for (plugin_it = plugin_delegates_.begin(); | 5244 for (plugin_it = plugin_delegates_.begin(); |
5245 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 5245 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
5246 (*plugin_it)->ImeCompositionConfirmed(text, plugin_id); | 5246 (*plugin_it)->ImeCompositionCompleted(text, plugin_id); |
5247 } | 5247 } |
5248 } | 5248 } |
5249 #endif // OS_MACOSX | 5249 #endif // OS_MACOSX |
5250 | 5250 |
5251 void RenderView::SendExtensionRequest( | 5251 void RenderView::SendExtensionRequest( |
5252 const ViewHostMsg_DomMessage_Params& params) { | 5252 const ViewHostMsg_DomMessage_Params& params) { |
5253 Send(new ViewHostMsg_ExtensionRequest(routing_id_, params)); | 5253 Send(new ViewHostMsg_ExtensionRequest(routing_id_, params)); |
5254 } | 5254 } |
5255 | 5255 |
5256 void RenderView::OnExtensionResponse(int request_id, | 5256 void RenderView::OnExtensionResponse(int request_id, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5495 #if defined(OS_MACOSX) | 5495 #if defined(OS_MACOSX) |
5496 if (!has_document_tag_) { | 5496 if (!has_document_tag_) { |
5497 // Make the call to get the tag. | 5497 // Make the call to get the tag. |
5498 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_)); | 5498 Send(new ViewHostMsg_GetDocumentTag(routing_id_, &document_tag_)); |
5499 has_document_tag_ = true; | 5499 has_document_tag_ = true; |
5500 } | 5500 } |
5501 #endif | 5501 #endif |
5502 } | 5502 } |
5503 | 5503 |
5504 #if defined(OS_MACOSX) | 5504 #if defined(OS_MACOSX) |
5505 void RenderView::SetPluginImeEnabled(bool enabled, int plugin_id) { | 5505 void RenderView::PluginFocusChanged(bool focused, int plugin_id) { |
5506 IPC::Message* msg = new ViewHostMsg_SetPluginImeEnabled(routing_id(), | 5506 IPC::Message* msg = new ViewHostMsg_PluginFocusChanged(routing_id(), |
5507 enabled, plugin_id); | 5507 focused, plugin_id); |
| 5508 Send(msg); |
| 5509 } |
| 5510 |
| 5511 void RenderView::StartPluginIme() { |
| 5512 IPC::Message* msg = new ViewHostMsg_StartPluginIme(routing_id()); |
5508 // This message can be sent during event-handling, and needs to be delivered | 5513 // This message can be sent during event-handling, and needs to be delivered |
5509 // within that context. | 5514 // within that context. |
5510 msg->set_unblock(true); | 5515 msg->set_unblock(true); |
5511 Send(msg); | 5516 Send(msg); |
5512 } | 5517 } |
5513 | 5518 |
5514 gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle( | 5519 gfx::PluginWindowHandle RenderView::AllocateFakePluginWindowHandle( |
5515 bool opaque, bool root) { | 5520 bool opaque, bool root) { |
5516 gfx::PluginWindowHandle window = NULL; | 5521 gfx::PluginWindowHandle window = NULL; |
5517 Send(new ViewHostMsg_AllocateFakePluginWindowHandle( | 5522 Send(new ViewHostMsg_AllocateFakePluginWindowHandle( |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5741 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5746 if (cmd == kJavaScriptStressTestSetStressRunType) { |
5742 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5747 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
5743 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5748 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
5744 v8::Testing::PrepareStressRun(param); | 5749 v8::Testing::PrepareStressRun(param); |
5745 } | 5750 } |
5746 } | 5751 } |
5747 | 5752 |
5748 void RenderView::OnContextMenuClosed() { | 5753 void RenderView::OnContextMenuClosed() { |
5749 context_menu_node_.reset(); | 5754 context_menu_node_.reset(); |
5750 } | 5755 } |
OLD | NEW |