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

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

Issue 2925473002: color: Disable Javascript setColorSpace with color correct rendering (Closed)
Patch Set: Clean up Created 3 years, 6 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 | « no previous file | content/shell/app/shell_main_delegate.cc » ('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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 #include "third_party/WebKit/public/web/WebWindowFeatures.h" 167 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
168 #include "third_party/icu/source/common/unicode/uchar.h" 168 #include "third_party/icu/source/common/unicode/uchar.h"
169 #include "third_party/icu/source/common/unicode/uscript.h" 169 #include "third_party/icu/source/common/unicode/uscript.h"
170 #include "third_party/skia/include/core/SkColor.h" 170 #include "third_party/skia/include/core/SkColor.h"
171 #include "ui/base/ui_base_switches_util.h" 171 #include "ui/base/ui_base_switches_util.h"
172 #include "ui/gfx/geometry/point.h" 172 #include "ui/gfx/geometry/point.h"
173 #include "ui/gfx/geometry/rect.h" 173 #include "ui/gfx/geometry/rect.h"
174 #include "ui/gfx/geometry/rect_conversions.h" 174 #include "ui/gfx/geometry/rect_conversions.h"
175 #include "ui/gfx/geometry/size_conversions.h" 175 #include "ui/gfx/geometry/size_conversions.h"
176 #include "ui/gfx/native_widget_types.h" 176 #include "ui/gfx/native_widget_types.h"
177 #include "ui/gfx/switches.h"
177 #include "ui/latency/latency_info.h" 178 #include "ui/latency/latency_info.h"
178 #include "url/origin.h" 179 #include "url/origin.h"
179 #include "url/url_constants.h" 180 #include "url/url_constants.h"
180 #include "v8/include/v8.h" 181 #include "v8/include/v8.h"
181 182
182 #if defined(OS_ANDROID) 183 #if defined(OS_ANDROID)
183 #include <cpu-features.h> 184 #include <cpu-features.h>
184 185
185 #include "base/android/build_info.h" 186 #include "base/android/build_info.h"
186 #include "content/renderer/android/disambiguation_popup_helper.h" 187 #include "content/renderer/android/disambiguation_popup_helper.h"
(...skipping 2329 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 params.physical_backing_size = gfx::ScaleToCeiledSize(size(), factor); 2517 params.physical_backing_size = gfx::ScaleToCeiledSize(size(), factor);
2517 params.browser_controls_shrink_blink_size = false; 2518 params.browser_controls_shrink_blink_size = false;
2518 params.top_controls_height = 0.f; 2519 params.top_controls_height = 0.f;
2519 params.is_fullscreen_granted = is_fullscreen_granted(); 2520 params.is_fullscreen_granted = is_fullscreen_granted();
2520 params.display_mode = display_mode_; 2521 params.display_mode = display_mode_;
2521 OnResize(params); 2522 OnResize(params);
2522 } 2523 }
2523 2524
2524 void RenderViewImpl::SetDeviceColorProfileForTesting( 2525 void RenderViewImpl::SetDeviceColorProfileForTesting(
2525 const gfx::ICCProfile& icc_profile) { 2526 const gfx::ICCProfile& icc_profile) {
2527 // TODO(ccameron): Remove this call when color correct rendering is the
2528 // default.
2529 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
2530 switches::kEnableColorCorrectRendering)) {
2531 return;
2532 }
2533
2526 if (webview()) 2534 if (webview())
2527 webview()->SetDeviceColorProfile(icc_profile); 2535 webview()->SetDeviceColorProfile(icc_profile);
2528 2536
2529 ResizeParams params; 2537 ResizeParams params;
2530 params.screen_info = screen_info_; 2538 params.screen_info = screen_info_;
2531 params.screen_info.icc_profile = icc_profile; 2539 params.screen_info.icc_profile = icc_profile;
2532 params.new_size = size(); 2540 params.new_size = size();
2533 params.visible_viewport_size = visible_viewport_size_; 2541 params.visible_viewport_size = visible_viewport_size_;
2534 params.physical_backing_size = physical_backing_size_; 2542 params.physical_backing_size = physical_backing_size_;
2535 params.browser_controls_shrink_blink_size = false; 2543 params.browser_controls_shrink_blink_size = false;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 input_event.GetCoalescedEventsPointers(), latency_info, 2652 input_event.GetCoalescedEventsPointers(), latency_info,
2645 dispatch_type); 2653 dispatch_type);
2646 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; 2654 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
2647 } 2655 }
2648 idle_user_detector_->ActivityDetected(); 2656 idle_user_detector_->ActivityDetected();
2649 return RenderWidget::HandleInputEvent(input_event, latency_info, 2657 return RenderWidget::HandleInputEvent(input_event, latency_info,
2650 dispatch_type); 2658 dispatch_type);
2651 } 2659 }
2652 2660
2653 } // namespace content 2661 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/shell/app/shell_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698