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

Side by Side Diff: content/common/layer_tree_settings_factory.cc

Issue 2443613002: Rename classes related to top controls (Closed)
Patch Set: fix test Created 4 years, 1 month 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/common/layer_tree_settings_factory.h ('k') | content/common/resize_params.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 2016 The Chromium Authors. All rights reserved. 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 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/common/layer_tree_settings_factory.h" 5 #include "content/common/layer_tree_settings_factory.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "cc/base/switches.h" 8 #include "cc/base/switches.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 // static 12 // static
13 void LayerTreeSettingsFactory::SetTopControlsSettings( 13 void LayerTreeSettingsFactory::SetBrowserControlsSettings(
14 cc::LayerTreeSettings& settings, 14 cc::LayerTreeSettings& settings,
15 const base::CommandLine& cmd) { 15 const base::CommandLine& cmd) {
16 if (cmd.HasSwitch(cc::switches::kTopControlsShowThreshold)) { 16 if (cmd.HasSwitch(cc::switches::kBrowserControlsShowThreshold)) {
17 std::string top_threshold_str = 17 std::string top_threshold_str =
18 cmd.GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); 18 cmd.GetSwitchValueASCII(cc::switches::kBrowserControlsShowThreshold);
19 double show_threshold; 19 double show_threshold;
20 if (base::StringToDouble(top_threshold_str, &show_threshold) && 20 if (base::StringToDouble(top_threshold_str, &show_threshold) &&
21 show_threshold >= 0.f && show_threshold <= 1.f) 21 show_threshold >= 0.f && show_threshold <= 1.f)
22 settings.top_controls_show_threshold = show_threshold; 22 settings.top_controls_show_threshold = show_threshold;
23 } 23 }
24 24
25 if (cmd.HasSwitch(cc::switches::kTopControlsHideThreshold)) { 25 if (cmd.HasSwitch(cc::switches::kBrowserControlsHideThreshold)) {
26 std::string top_threshold_str = 26 std::string top_threshold_str =
27 cmd.GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); 27 cmd.GetSwitchValueASCII(cc::switches::kBrowserControlsHideThreshold);
28 double hide_threshold; 28 double hide_threshold;
29 if (base::StringToDouble(top_threshold_str, &hide_threshold) && 29 if (base::StringToDouble(top_threshold_str, &hide_threshold) &&
30 hide_threshold >= 0.f && hide_threshold <= 1.f) 30 hide_threshold >= 0.f && hide_threshold <= 1.f)
31 settings.top_controls_hide_threshold = hide_threshold; 31 settings.top_controls_hide_threshold = hide_threshold;
32 } 32 }
33 } 33 }
34 34
35 } // namespace content 35 } // namespace content
OLDNEW
« no previous file with comments | « content/common/layer_tree_settings_factory.h ('k') | content/common/resize_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698