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 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 // TODO(viettrungluu): Move to a separate message filter. | 1110 // TODO(viettrungluu): Move to a separate message filter. |
1111 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 1111 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
1112 OnSetHistoryLengthAndPrune) | 1112 OnSetHistoryLengthAndPrune) |
1113 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1113 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
1114 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) | 1114 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) |
1115 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) | 1115 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) |
1116 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, | 1116 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, |
1117 OnReleaseDisambiguationPopupBitmap) | 1117 OnReleaseDisambiguationPopupBitmap) |
1118 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, | 1118 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, |
1119 OnWindowSnapshotCompleted) | 1119 OnWindowSnapshotCompleted) |
| 1120 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) |
1120 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) | 1121 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) |
1121 #if defined(OS_ANDROID) | 1122 #if defined(OS_ANDROID) |
1122 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, | 1123 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
1123 OnActivateNearestFindResult) | 1124 OnActivateNearestFindResult) |
1124 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) | 1125 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) |
1125 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1126 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
1126 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, | 1127 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, |
1127 OnUpdateTopControlsState) | 1128 OnUpdateTopControlsState) |
1128 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) | 1129 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) |
1129 #elif defined(OS_MACOSX) | 1130 #elif defined(OS_MACOSX) |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); | 1327 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); |
1327 | 1328 |
1328 message->EnableMessagePumping(); // Runs a nested message loop. | 1329 message->EnableMessagePumping(); // Runs a nested message loop. |
1329 return Send(message); | 1330 return Send(message); |
1330 } | 1331 } |
1331 | 1332 |
1332 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { | 1333 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { |
1333 int id = next_snapshot_id_++; | 1334 int id = next_snapshot_id_++; |
1334 pending_snapshots_.insert(std::make_pair(id, callback)); | 1335 pending_snapshots_.insert(std::make_pair(id, callback)); |
1335 ui::LatencyInfo latency_info; | 1336 ui::LatencyInfo latency_info; |
| 1337 latency_info.AddLatencyNumber(ui::WINDOW_OLD_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| 1338 0, |
| 1339 id); |
| 1340 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
| 1341 if (RenderWidgetCompositor* rwc = compositor()) { |
| 1342 latency_info_swap_promise_monitor = |
| 1343 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); |
| 1344 } |
| 1345 ScheduleCompositeWithForcedRedraw(); |
| 1346 } |
| 1347 |
| 1348 void RenderViewImpl::OnForceRedraw(int id) { |
| 1349 ui::LatencyInfo latency_info; |
1336 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, | 1350 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
1337 0, | 1351 0, |
1338 id); | 1352 id); |
1339 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; | 1353 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
1340 if (RenderWidgetCompositor* rwc = compositor()) { | 1354 if (RenderWidgetCompositor* rwc = compositor()) { |
1341 latency_info_swap_promise_monitor = | 1355 latency_info_swap_promise_monitor = |
1342 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); | 1356 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); |
1343 } | 1357 } |
1344 ScheduleCompositeWithForcedRedraw(); | 1358 ScheduleCompositeWithForcedRedraw(); |
1345 } | 1359 } |
(...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3999 std::vector<gfx::Size> sizes; | 4013 std::vector<gfx::Size> sizes; |
4000 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4014 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4001 if (!url.isEmpty()) | 4015 if (!url.isEmpty()) |
4002 urls.push_back( | 4016 urls.push_back( |
4003 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4017 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4004 } | 4018 } |
4005 SendUpdateFaviconURL(urls); | 4019 SendUpdateFaviconURL(urls); |
4006 } | 4020 } |
4007 | 4021 |
4008 } // namespace content | 4022 } // namespace content |
OLD | NEW |