Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 2641973002: Use gfx::ICCProfile type consistently (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 "rvinit_main_frame_id", base::IntToString(params.main_frame_routing_id)); 608 "rvinit_main_frame_id", base::IntToString(params.main_frame_routing_id));
609 609
610 webview()->setDisplayMode(display_mode_); 610 webview()->setDisplayMode(display_mode_);
611 webview()->settings()->setPreferCompositingToLCDTextEnabled( 611 webview()->settings()->setPreferCompositingToLCDTextEnabled(
612 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 612 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
613 webview()->settings()->setThreadedScrollingEnabled( 613 webview()->settings()->setThreadedScrollingEnabled(
614 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); 614 !command_line.HasSwitch(switches::kDisableThreadedScrolling));
615 webview()->setShowFPSCounter( 615 webview()->setShowFPSCounter(
616 command_line.HasSwitch(cc::switches::kShowFPSCounter)); 616 command_line.HasSwitch(cc::switches::kShowFPSCounter));
617 617
618 if (auto overridden_color_profile = 618 if (std::unique_ptr<gfx::ICCProfile> overridden_color_profile =
619 GetContentClient()->renderer()->GetImageDecodeColorProfile()) { 619 GetContentClient()->renderer()->GetImageDecodeColorProfile()) {
620 webview()->setDeviceColorProfile(overridden_color_profile->GetData()); 620 webview()->setDeviceColorProfile(*overridden_color_profile);
621 } else { 621 } else {
622 webview()->setDeviceColorProfile(params.image_decode_color_space.GetData()); 622 webview()->setDeviceColorProfile(params.image_decode_color_space);
623 } 623 }
624 624
625 ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_); 625 ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_);
626 626
627 if (switches::IsTouchDragDropEnabled()) 627 if (switches::IsTouchDragDropEnabled())
628 webview()->settings()->setTouchDragDropEnabled(true); 628 webview()->settings()->setTouchDragDropEnabled(true);
629 629
630 webview()->settings()->setBrowserSideNavigationEnabled( 630 webview()->settings()->setBrowserSideNavigationEnabled(
631 IsBrowserSideNavigationEnabled()); 631 IsBrowserSideNavigationEnabled());
632 632
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 2357
2358 void RenderViewImpl::SetFocus(bool enable) { 2358 void RenderViewImpl::SetFocus(bool enable) {
2359 RenderWidget::OnSetFocus(enable); 2359 RenderWidget::OnSetFocus(enable);
2360 2360
2361 // Notify all BrowserPlugins of the RenderView's focus state. 2361 // Notify all BrowserPlugins of the RenderView's focus state.
2362 if (BrowserPluginManager::Get()) 2362 if (BrowserPluginManager::Get())
2363 BrowserPluginManager::Get()->UpdateFocusState(); 2363 BrowserPluginManager::Get()->UpdateFocusState();
2364 } 2364 }
2365 2365
2366 void RenderViewImpl::RenderWidgetDidSetColorProfile( 2366 void RenderViewImpl::RenderWidgetDidSetColorProfile(
2367 const std::vector<char>& profile) { 2367 const gfx::ICCProfile& profile) {
2368 if (webview()) { 2368 if (webview())
2369 WebVector<char> colorProfile = profile; 2369 webview()->setDeviceColorProfile(profile);
2370 webview()->setDeviceColorProfile(colorProfile);
2371 }
2372 } 2370 }
2373 2371
2374 void RenderViewImpl::DidCompletePageScaleAnimation() { 2372 void RenderViewImpl::DidCompletePageScaleAnimation() {
2375 GetWidget()->FocusChangeComplete(); 2373 GetWidget()->FocusChangeComplete();
2376 } 2374 }
2377 2375
2378 void RenderViewImpl::OnDeviceScaleFactorChanged() { 2376 void RenderViewImpl::OnDeviceScaleFactorChanged() {
2379 RenderWidget::OnDeviceScaleFactorChanged(); 2377 RenderWidget::OnDeviceScaleFactorChanged();
2380 UpdateWebViewWithDeviceScaleFactor(); 2378 UpdateWebViewWithDeviceScaleFactor();
2381 if (auto_resize_mode_) 2379 if (auto_resize_mode_)
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2733 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2731 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2734 } 2732 }
2735 2733
2736 std::unique_ptr<InputEventAck> ack( 2734 std::unique_ptr<InputEventAck> ack(
2737 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), 2735 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(),
2738 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2736 INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
2739 OnInputEventAck(std::move(ack)); 2737 OnInputEventAck(std::move(ack));
2740 } 2738 }
2741 2739
2742 } // namespace content 2740 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698