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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 // TODO(viettrungluu): Move to a separate message filter. | 1126 // TODO(viettrungluu): Move to a separate message filter. |
1127 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 1127 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
1128 OnSetHistoryLengthAndPrune) | 1128 OnSetHistoryLengthAndPrune) |
1129 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1129 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
1130 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) | 1130 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) |
1131 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) | 1131 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) |
1132 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, | 1132 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, |
1133 OnReleaseDisambiguationPopupBitmap) | 1133 OnReleaseDisambiguationPopupBitmap) |
1134 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, | 1134 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, |
1135 OnWindowSnapshotCompleted) | 1135 OnWindowSnapshotCompleted) |
| 1136 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) |
1136 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) | 1137 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) |
1137 #if defined(OS_ANDROID) | 1138 #if defined(OS_ANDROID) |
1138 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, | 1139 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
1139 OnActivateNearestFindResult) | 1140 OnActivateNearestFindResult) |
1140 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) | 1141 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) |
1141 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1142 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
1142 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, | 1143 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, |
1143 OnUpdateTopControlsState) | 1144 OnUpdateTopControlsState) |
1144 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) | 1145 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) |
1145 #elif defined(OS_MACOSX) | 1146 #elif defined(OS_MACOSX) |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); | 1343 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); |
1343 | 1344 |
1344 message->EnableMessagePumping(); // Runs a nested message loop. | 1345 message->EnableMessagePumping(); // Runs a nested message loop. |
1345 return Send(message); | 1346 return Send(message); |
1346 } | 1347 } |
1347 | 1348 |
1348 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { | 1349 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { |
1349 int id = next_snapshot_id_++; | 1350 int id = next_snapshot_id_++; |
1350 pending_snapshots_.insert(std::make_pair(id, callback)); | 1351 pending_snapshots_.insert(std::make_pair(id, callback)); |
1351 ui::LatencyInfo latency_info; | 1352 ui::LatencyInfo latency_info; |
| 1353 latency_info.AddLatencyNumber(ui::WINDOW_OLD_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| 1354 0, |
| 1355 id); |
| 1356 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
| 1357 if (RenderWidgetCompositor* rwc = compositor()) { |
| 1358 latency_info_swap_promise_monitor = |
| 1359 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); |
| 1360 } |
| 1361 ScheduleCompositeWithForcedRedraw(); |
| 1362 } |
| 1363 |
| 1364 void RenderViewImpl::OnForceRedraw(int id) { |
| 1365 ui::LatencyInfo latency_info; |
1352 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, | 1366 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
1353 0, | 1367 0, |
1354 id); | 1368 id); |
1355 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; | 1369 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
1356 if (RenderWidgetCompositor* rwc = compositor()) { | 1370 if (RenderWidgetCompositor* rwc = compositor()) { |
1357 latency_info_swap_promise_monitor = | 1371 latency_info_swap_promise_monitor = |
1358 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); | 1372 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); |
1359 } | 1373 } |
1360 ScheduleCompositeWithForcedRedraw(); | 1374 ScheduleCompositeWithForcedRedraw(); |
1361 } | 1375 } |
(...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4015 std::vector<gfx::Size> sizes; | 4029 std::vector<gfx::Size> sizes; |
4016 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4030 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4017 if (!url.isEmpty()) | 4031 if (!url.isEmpty()) |
4018 urls.push_back( | 4032 urls.push_back( |
4019 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4033 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4020 } | 4034 } |
4021 SendUpdateFaviconURL(urls); | 4035 SendUpdateFaviconURL(urls); |
4022 } | 4036 } |
4023 | 4037 |
4024 } // namespace content | 4038 } // namespace content |
OLD | NEW |