OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/common/compositor_util.h" |
| 6 |
| 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "cc/base/switches.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 // static |
| 13 void CompositorUtil::SetTopControlsSettings(cc::LayerTreeSettings& settings, |
| 14 const base::CommandLine& cmd) { |
| 15 if (cmd.HasSwitch(cc::switches::kTopControlsShowThreshold)) { |
| 16 std::string top_threshold_str = |
| 17 cmd.GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); |
| 18 double show_threshold; |
| 19 if (base::StringToDouble(top_threshold_str, &show_threshold) && |
| 20 show_threshold >= 0.f && show_threshold <= 1.f) |
| 21 settings.top_controls_show_threshold = show_threshold; |
| 22 } |
| 23 |
| 24 if (cmd.HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
| 25 std::string top_threshold_str = |
| 26 cmd.GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); |
| 27 double hide_threshold; |
| 28 if (base::StringToDouble(top_threshold_str, &hide_threshold) && |
| 29 hide_threshold >= 0.f && hide_threshold <= 1.f) |
| 30 settings.top_controls_hide_threshold = hide_threshold; |
| 31 } |
| 32 } |
| 33 |
| 34 } // namespace content |
OLD | NEW |