| 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 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 } | 2325 } |
| 2326 | 2326 |
| 2327 void RenderViewImpl::SetFocus(bool enable) { | 2327 void RenderViewImpl::SetFocus(bool enable) { |
| 2328 RenderWidget::OnSetFocus(enable); | 2328 RenderWidget::OnSetFocus(enable); |
| 2329 | 2329 |
| 2330 // Notify all BrowserPlugins of the RenderView's focus state. | 2330 // Notify all BrowserPlugins of the RenderView's focus state. |
| 2331 if (BrowserPluginManager::Get()) | 2331 if (BrowserPluginManager::Get()) |
| 2332 BrowserPluginManager::Get()->UpdateFocusState(); | 2332 BrowserPluginManager::Get()->UpdateFocusState(); |
| 2333 } | 2333 } |
| 2334 | 2334 |
| 2335 void RenderViewImpl::RenderWidgetDidSetColorProfile( | |
| 2336 const gfx::ICCProfile& profile) { | |
| 2337 if (webview()) | |
| 2338 webview()->setDeviceColorProfile(profile); | |
| 2339 } | |
| 2340 | |
| 2341 void RenderViewImpl::DidCompletePageScaleAnimation() { | 2335 void RenderViewImpl::DidCompletePageScaleAnimation() { |
| 2342 GetWidget()->FocusChangeComplete(); | 2336 GetWidget()->FocusChangeComplete(); |
| 2343 } | 2337 } |
| 2344 | 2338 |
| 2345 void RenderViewImpl::OnDeviceScaleFactorChanged() { | 2339 void RenderViewImpl::OnDeviceScaleFactorChanged() { |
| 2346 RenderWidget::OnDeviceScaleFactorChanged(); | 2340 RenderWidget::OnDeviceScaleFactorChanged(); |
| 2347 UpdateWebViewWithDeviceScaleFactor(); | 2341 UpdateWebViewWithDeviceScaleFactor(); |
| 2348 if (auto_resize_mode_) | 2342 if (auto_resize_mode_) |
| 2349 AutoResizeCompositor(); | 2343 AutoResizeCompositor(); |
| 2350 } | 2344 } |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2603 params.new_size = size(); | 2597 params.new_size = size(); |
| 2604 params.visible_viewport_size = visible_viewport_size_; | 2598 params.visible_viewport_size = visible_viewport_size_; |
| 2605 params.physical_backing_size = gfx::ScaleToCeiledSize(size(), factor); | 2599 params.physical_backing_size = gfx::ScaleToCeiledSize(size(), factor); |
| 2606 params.browser_controls_shrink_blink_size = false; | 2600 params.browser_controls_shrink_blink_size = false; |
| 2607 params.top_controls_height = 0.f; | 2601 params.top_controls_height = 0.f; |
| 2608 params.is_fullscreen_granted = is_fullscreen_granted(); | 2602 params.is_fullscreen_granted = is_fullscreen_granted(); |
| 2609 params.display_mode = display_mode_; | 2603 params.display_mode = display_mode_; |
| 2610 OnResize(params); | 2604 OnResize(params); |
| 2611 } | 2605 } |
| 2612 | 2606 |
| 2607 void RenderViewImpl::SetDeviceColorProfileForTesting( |
| 2608 const gfx::ICCProfile& icc_profile) { |
| 2609 if (webview()) |
| 2610 webview()->setDeviceColorProfile(icc_profile); |
| 2611 |
| 2612 ResizeParams params; |
| 2613 params.screen_info = screen_info_; |
| 2614 params.screen_info.icc_profile = icc_profile; |
| 2615 params.new_size = size(); |
| 2616 params.visible_viewport_size = visible_viewport_size_; |
| 2617 params.physical_backing_size = physical_backing_size_; |
| 2618 params.browser_controls_shrink_blink_size = false; |
| 2619 params.top_controls_height = 0.f; |
| 2620 params.is_fullscreen_granted = is_fullscreen_granted(); |
| 2621 params.display_mode = display_mode_; |
| 2622 OnResize(params); |
| 2623 } |
| 2624 |
| 2613 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { | 2625 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { |
| 2614 gfx::Rect new_window_rect(rootWindowRect().x, | 2626 gfx::Rect new_window_rect(rootWindowRect().x, |
| 2615 rootWindowRect().y, | 2627 rootWindowRect().y, |
| 2616 new_size.width(), | 2628 new_size.width(), |
| 2617 new_size.height()); | 2629 new_size.height()); |
| 2618 SetWindowRectSynchronously(new_window_rect); | 2630 SetWindowRectSynchronously(new_window_rect); |
| 2619 } | 2631 } |
| 2620 | 2632 |
| 2621 void RenderViewImpl::UseSynchronousResizeModeForTesting(bool enable) { | 2633 void RenderViewImpl::UseSynchronousResizeModeForTesting(bool enable) { |
| 2622 resizing_mode_selector_->set_is_synchronous_mode(enable); | 2634 resizing_mode_selector_->set_is_synchronous_mode(enable); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2713 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2702 } | 2714 } |
| 2703 | 2715 |
| 2704 std::unique_ptr<InputEventAck> ack( | 2716 std::unique_ptr<InputEventAck> ack( |
| 2705 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), | 2717 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), |
| 2706 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2718 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 2707 OnInputEventAck(std::move(ack)); | 2719 OnInputEventAck(std::move(ack)); |
| 2708 } | 2720 } |
| 2709 | 2721 |
| 2710 } // namespace content | 2722 } // namespace content |
| OLD | NEW |