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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 // TODO(viettrungluu): Move to a separate message filter. | 1123 // TODO(viettrungluu): Move to a separate message filter. |
1124 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 1124 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
1125 OnSetHistoryLengthAndPrune) | 1125 OnSetHistoryLengthAndPrune) |
1126 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1126 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
1127 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) | 1127 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) |
1128 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) | 1128 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) |
1129 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, | 1129 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, |
1130 OnReleaseDisambiguationPopupBitmap) | 1130 OnReleaseDisambiguationPopupBitmap) |
1131 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, | 1131 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, |
1132 OnWindowSnapshotCompleted) | 1132 OnWindowSnapshotCompleted) |
| 1133 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) |
1133 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) | 1134 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) |
1134 #if defined(OS_ANDROID) | 1135 #if defined(OS_ANDROID) |
1135 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, | 1136 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
1136 OnActivateNearestFindResult) | 1137 OnActivateNearestFindResult) |
1137 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) | 1138 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) |
1138 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1139 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
1139 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, | 1140 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, |
1140 OnUpdateTopControlsState) | 1141 OnUpdateTopControlsState) |
1141 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) | 1142 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) |
1142 #elif defined(OS_MACOSX) | 1143 #elif defined(OS_MACOSX) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); | 1344 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); |
1344 | 1345 |
1345 message->EnableMessagePumping(); // Runs a nested message loop. | 1346 message->EnableMessagePumping(); // Runs a nested message loop. |
1346 return Send(message); | 1347 return Send(message); |
1347 } | 1348 } |
1348 | 1349 |
1349 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { | 1350 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { |
1350 int id = next_snapshot_id_++; | 1351 int id = next_snapshot_id_++; |
1351 pending_snapshots_.insert(std::make_pair(id, callback)); | 1352 pending_snapshots_.insert(std::make_pair(id, callback)); |
1352 ui::LatencyInfo latency_info; | 1353 ui::LatencyInfo latency_info; |
| 1354 latency_info.AddLatencyNumber(ui::WINDOW_OLD_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| 1355 0, |
| 1356 id); |
| 1357 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
| 1358 if (RenderWidgetCompositor* rwc = compositor()) { |
| 1359 latency_info_swap_promise_monitor = |
| 1360 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); |
| 1361 } |
| 1362 ScheduleCompositeWithForcedRedraw(); |
| 1363 } |
| 1364 |
| 1365 void RenderViewImpl::OnForceRedraw(int id) { |
| 1366 ui::LatencyInfo latency_info; |
1353 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, | 1367 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
1354 0, | 1368 0, |
1355 id); | 1369 id); |
1356 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; | 1370 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
1357 if (RenderWidgetCompositor* rwc = compositor()) { | 1371 if (RenderWidgetCompositor* rwc = compositor()) { |
1358 latency_info_swap_promise_monitor = | 1372 latency_info_swap_promise_monitor = |
1359 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); | 1373 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); |
1360 } | 1374 } |
1361 ScheduleCompositeWithForcedRedraw(); | 1375 ScheduleCompositeWithForcedRedraw(); |
1362 } | 1376 } |
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4060 std::vector<gfx::Size> sizes; | 4074 std::vector<gfx::Size> sizes; |
4061 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4075 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4062 if (!url.isEmpty()) | 4076 if (!url.isEmpty()) |
4063 urls.push_back( | 4077 urls.push_back( |
4064 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4078 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4065 } | 4079 } |
4066 SendUpdateFaviconURL(urls); | 4080 SendUpdateFaviconURL(urls); |
4067 } | 4081 } |
4068 | 4082 |
4069 } // namespace content | 4083 } // namespace content |
OLD | NEW |