| 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) | 1388 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) |
| 1389 #elif defined(OS_MACOSX) | 1389 #elif defined(OS_MACOSX) |
| 1390 IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedText, | 1390 IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedText, |
| 1391 OnGetRenderedText) | 1391 OnGetRenderedText) |
| 1392 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, | 1392 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, |
| 1393 OnPluginImeCompositionCompleted) | 1393 OnPluginImeCompositionCompleted) |
| 1394 IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose) | 1394 IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose) |
| 1395 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) | 1395 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
| 1396 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) | 1396 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) |
| 1397 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) | 1397 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) |
| 1398 IPC_MESSAGE_HANDLER(InputMsg_SelectWordIfAnyAt, OnSelectWordIfAnyAt) |
| 1398 #endif | 1399 #endif |
| 1399 // Adding a new message? Add platform independent ones first, then put the | 1400 // Adding a new message? Add platform independent ones first, then put the |
| 1400 // platform specific ones at the end. | 1401 // platform specific ones at the end. |
| 1401 | 1402 |
| 1402 // Have the super handle all other messages. | 1403 // Have the super handle all other messages. |
| 1403 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) | 1404 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) |
| 1404 IPC_END_MESSAGE_MAP() | 1405 IPC_END_MESSAGE_MAP() |
| 1405 | 1406 |
| 1406 return handled; | 1407 return handled; |
| 1407 } | 1408 } |
| (...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3003 #if defined(ENABLE_PLUGINS) | 3004 #if defined(ENABLE_PLUGINS) |
| 3004 // Inform plugins that their window's frame has changed. | 3005 // Inform plugins that their window's frame has changed. |
| 3005 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 3006 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 3006 for (plugin_it = plugin_delegates_.begin(); | 3007 for (plugin_it = plugin_delegates_.begin(); |
| 3007 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 3008 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 3008 (*plugin_it)->WindowFrameChanged(window_frame, view_frame); | 3009 (*plugin_it)->WindowFrameChanged(window_frame, view_frame); |
| 3009 } | 3010 } |
| 3010 #endif | 3011 #endif |
| 3011 } | 3012 } |
| 3012 | 3013 |
| 3014 void RenderViewImpl::OnSelectWordIfAnyAt(const WebPoint& position) { |
| 3015 input_handler_.set_handling_input_event(true); |
| 3016 if (!webview()) |
| 3017 return; |
| 3018 |
| 3019 // Send a response if a word has been selected. |
| 3020 if (webview()->selectWordIfAnyAt(position)) |
| 3021 Send(new InputHostMsg_DidSelectWordAt(routing_id())); |
| 3022 input_handler_.set_handling_input_event(false); |
| 3023 } |
| 3024 |
| 3025 |
| 3013 void RenderViewImpl::OnPluginImeCompositionCompleted(const base::string16& text, | 3026 void RenderViewImpl::OnPluginImeCompositionCompleted(const base::string16& text, |
| 3014 int plugin_id) { | 3027 int plugin_id) { |
| 3015 // WebPluginDelegateProxy is responsible for figuring out if this event | 3028 // WebPluginDelegateProxy is responsible for figuring out if this event |
| 3016 // applies to it or not, so inform all the delegates. | 3029 // applies to it or not, so inform all the delegates. |
| 3017 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 3030 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 3018 for (plugin_it = plugin_delegates_.begin(); | 3031 for (plugin_it = plugin_delegates_.begin(); |
| 3019 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 3032 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 3020 (*plugin_it)->ImeCompositionCompleted(text, plugin_id); | 3033 (*plugin_it)->ImeCompositionCompleted(text, plugin_id); |
| 3021 } | 3034 } |
| 3022 } | 3035 } |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3724 if (IsUseZoomForDSFEnabled()) { | 3737 if (IsUseZoomForDSFEnabled()) { |
| 3725 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3738 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 3726 } else { | 3739 } else { |
| 3727 webview()->setDeviceScaleFactor(device_scale_factor_); | 3740 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3728 } | 3741 } |
| 3729 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3742 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 3730 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3743 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| 3731 } | 3744 } |
| 3732 | 3745 |
| 3733 } // namespace content | 3746 } // namespace content |
| OLD | NEW |