| 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 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) { | 1297 bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) { |
| 1298 WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL; | 1298 WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL; |
| 1299 if (main_frame && main_frame->isWebLocalFrame()) | 1299 if (main_frame && main_frame->isWebLocalFrame()) |
| 1300 GetContentClient()->SetActiveURL(main_frame->document().url()); | 1300 GetContentClient()->SetActiveURL(main_frame->document().url()); |
| 1301 | 1301 |
| 1302 // Input IPC messages must not be processed if the RenderView is in | 1302 // Input IPC messages must not be processed if the RenderView is in |
| 1303 // swapped out state. | 1303 // swapped out state. |
| 1304 if (is_swapped_out_ && IPC_MESSAGE_ID_CLASS(message.type()) == InputMsgStart) | 1304 if (is_swapped_out_ && IPC_MESSAGE_ID_CLASS(message.type()) == InputMsgStart) |
| 1305 return false; | 1305 return false; |
| 1306 | 1306 |
| 1307 base::ObserverListBase<RenderViewObserver>::Iterator it(&observers_); | 1307 for (auto& observer : observers_) { |
| 1308 RenderViewObserver* observer; | 1308 if (observer.OnMessageReceived(message)) |
| 1309 while ((observer = it.GetNext()) != NULL) | |
| 1310 if (observer->OnMessageReceived(message)) | |
| 1311 return true; | 1309 return true; |
| 1310 } |
| 1312 | 1311 |
| 1313 bool handled = true; | 1312 bool handled = true; |
| 1314 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) | 1313 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) |
| 1315 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) | 1314 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) |
| 1316 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) | 1315 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) |
| 1317 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, | 1316 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, |
| 1318 OnScrollFocusedEditableNodeIntoRect) | 1317 OnScrollFocusedEditableNodeIntoRect) |
| 1319 IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale) | 1318 IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale) |
| 1320 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 1319 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
| 1321 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, | 1320 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL, |
| (...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3016 if (IsUseZoomForDSFEnabled()) { | 3015 if (IsUseZoomForDSFEnabled()) { |
| 3017 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3016 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 3018 } else { | 3017 } else { |
| 3019 webview()->setDeviceScaleFactor(device_scale_factor_); | 3018 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3020 } | 3019 } |
| 3021 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3020 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 3022 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3021 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| 3023 } | 3022 } |
| 3024 | 3023 |
| 3025 } // namespace content | 3024 } // namespace content |
| OLD | NEW |