Chromium Code Reviews| 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/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 | 325 |
| 326 bool force_srgb_image_decode_color_space = false; | 326 bool force_srgb_image_decode_color_space = false; |
| 327 // Pretend that HDR displays are sRGB so that we do not have inconsistent | 327 // Pretend that HDR displays are sRGB so that we do not have inconsistent |
| 328 // coloring. | 328 // coloring. |
| 329 // TODO(ccameron): Disable this once color correct rasterization is functional | 329 // TODO(ccameron): Disable this once color correct rasterization is functional |
| 330 // https://crbug.com/701942 | 330 // https://crbug.com/701942 |
| 331 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) | 331 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) |
| 332 force_srgb_image_decode_color_space = true; | 332 force_srgb_image_decode_color_space = true; |
| 333 // When color correct rendering is enabled, the image_decode_color_space | 333 // When color correct rendering is enabled, the image_decode_color_space |
| 334 // parameter should not be used (and all users of it should be using sRGB). | 334 // parameter should not be used (and all users of it should be using sRGB). |
| 335 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 335 if (base::FeatureList::IsEnabled(features::kColorCorrectRendering)) { |
|
Alexei Svitkine (slow)
2017/06/16 14:47:24
Nit: No {}'s
ccameron
2017/06/16 22:15:26
Done.
| |
| 336 switches::kEnableColorCorrectRendering)) { | |
| 337 force_srgb_image_decode_color_space = true; | 336 force_srgb_image_decode_color_space = true; |
| 338 } | 337 } |
| 339 if (force_srgb_image_decode_color_space) { | 338 if (force_srgb_image_decode_color_space) { |
| 340 gfx::ColorSpace::CreateSRGB().GetICCProfile( | 339 gfx::ColorSpace::CreateSRGB().GetICCProfile( |
| 341 ¶ms->image_decode_color_space); | 340 ¶ms->image_decode_color_space); |
| 342 } else { | 341 } else { |
| 343 params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor(); | 342 params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor(); |
| 344 } | 343 } |
| 345 | 344 |
| 346 GetWidget()->GetResizeParams(¶ms->initial_size); | 345 GetWidget()->GetResizeParams(¶ms->initial_size); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 | 506 |
| 508 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); | 507 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); |
| 509 | 508 |
| 510 if (delegate_ && delegate_->IsOverridingUserAgent()) | 509 if (delegate_ && delegate_->IsOverridingUserAgent()) |
| 511 prefs.viewport_meta_enabled = false; | 510 prefs.viewport_meta_enabled = false; |
| 512 | 511 |
| 513 prefs.main_frame_resizes_are_orientation_changes = | 512 prefs.main_frame_resizes_are_orientation_changes = |
| 514 command_line.HasSwitch(switches::kMainFrameResizesAreOrientationChanges); | 513 command_line.HasSwitch(switches::kMainFrameResizesAreOrientationChanges); |
| 515 | 514 |
| 516 prefs.color_correct_rendering_enabled = | 515 prefs.color_correct_rendering_enabled = |
| 517 command_line.HasSwitch(switches::kEnableColorCorrectRendering); | 516 base::FeatureList::IsEnabled(features::kColorCorrectRendering); |
| 518 | 517 |
| 519 prefs.spatial_navigation_enabled = command_line.HasSwitch( | 518 prefs.spatial_navigation_enabled = command_line.HasSwitch( |
| 520 switches::kEnableSpatialNavigation); | 519 switches::kEnableSpatialNavigation); |
| 521 | 520 |
| 522 prefs.disable_reading_from_canvas = command_line.HasSwitch( | 521 prefs.disable_reading_from_canvas = command_line.HasSwitch( |
| 523 switches::kDisableReadingFromCanvas); | 522 switches::kDisableReadingFromCanvas); |
| 524 | 523 |
| 525 prefs.strict_mixed_content_checking = command_line.HasSwitch( | 524 prefs.strict_mixed_content_checking = command_line.HasSwitch( |
| 526 switches::kEnableStrictMixedContentChecking); | 525 switches::kEnableStrictMixedContentChecking); |
| 527 | 526 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 942 } | 941 } |
| 943 | 942 |
| 944 void RenderViewHostImpl::ClosePageTimeout() { | 943 void RenderViewHostImpl::ClosePageTimeout() { |
| 945 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) | 944 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) |
| 946 return; | 945 return; |
| 947 | 946 |
| 948 ClosePageIgnoringUnloadEvents(); | 947 ClosePageIgnoringUnloadEvents(); |
| 949 } | 948 } |
| 950 | 949 |
| 951 } // namespace content | 950 } // namespace content |
| OLD | NEW |