| 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)) |
| 336 switches::kEnableColorCorrectRendering)) { | |
| 337 force_srgb_image_decode_color_space = true; | 336 force_srgb_image_decode_color_space = true; |
| 338 } | |
| 339 if (force_srgb_image_decode_color_space) { | 337 if (force_srgb_image_decode_color_space) { |
| 340 gfx::ColorSpace::CreateSRGB().GetICCProfile( | 338 gfx::ColorSpace::CreateSRGB().GetICCProfile( |
| 341 ¶ms->image_decode_color_space); | 339 ¶ms->image_decode_color_space); |
| 342 } else { | 340 } else { |
| 343 params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor(); | 341 params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor(); |
| 344 } | 342 } |
| 345 | 343 |
| 346 GetWidget()->GetResizeParams(¶ms->initial_size); | 344 GetWidget()->GetResizeParams(¶ms->initial_size); |
| 347 GetWidget()->SetInitialRenderSizeParams(params->initial_size); | 345 GetWidget()->SetInitialRenderSizeParams(params->initial_size); |
| 348 | 346 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 505 |
| 508 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); | 506 prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport); |
| 509 | 507 |
| 510 if (delegate_ && delegate_->IsOverridingUserAgent()) | 508 if (delegate_ && delegate_->IsOverridingUserAgent()) |
| 511 prefs.viewport_meta_enabled = false; | 509 prefs.viewport_meta_enabled = false; |
| 512 | 510 |
| 513 prefs.main_frame_resizes_are_orientation_changes = | 511 prefs.main_frame_resizes_are_orientation_changes = |
| 514 command_line.HasSwitch(switches::kMainFrameResizesAreOrientationChanges); | 512 command_line.HasSwitch(switches::kMainFrameResizesAreOrientationChanges); |
| 515 | 513 |
| 516 prefs.color_correct_rendering_enabled = | 514 prefs.color_correct_rendering_enabled = |
| 517 command_line.HasSwitch(switches::kEnableColorCorrectRendering); | 515 base::FeatureList::IsEnabled(features::kColorCorrectRendering); |
| 518 | 516 |
| 519 prefs.spatial_navigation_enabled = command_line.HasSwitch( | 517 prefs.spatial_navigation_enabled = command_line.HasSwitch( |
| 520 switches::kEnableSpatialNavigation); | 518 switches::kEnableSpatialNavigation); |
| 521 | 519 |
| 522 prefs.disable_reading_from_canvas = command_line.HasSwitch( | 520 prefs.disable_reading_from_canvas = command_line.HasSwitch( |
| 523 switches::kDisableReadingFromCanvas); | 521 switches::kDisableReadingFromCanvas); |
| 524 | 522 |
| 525 prefs.strict_mixed_content_checking = command_line.HasSwitch( | 523 prefs.strict_mixed_content_checking = command_line.HasSwitch( |
| 526 switches::kEnableStrictMixedContentChecking); | 524 switches::kEnableStrictMixedContentChecking); |
| 527 | 525 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 } | 940 } |
| 943 | 941 |
| 944 void RenderViewHostImpl::ClosePageTimeout() { | 942 void RenderViewHostImpl::ClosePageTimeout() { |
| 945 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) | 943 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) |
| 946 return; | 944 return; |
| 947 | 945 |
| 948 ClosePageIgnoringUnloadEvents(); | 946 ClosePageIgnoringUnloadEvents(); |
| 949 } | 947 } |
| 950 | 948 |
| 951 } // namespace content | 949 } // namespace content |
| OLD | NEW |