OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "web_layer_tree_view_impl.h" | 5 #include "web_layer_tree_view_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "cc/font_atlas.h" | 9 #include "cc/font_atlas.h" |
10 #include "cc/input_handler.h" | 10 #include "cc/input_handler.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 settings.useCheapnessEstimator = CommandLine::ForCurrentProcess()->HasSwitch (switches::kUseCheapnessEstimator); | 57 settings.useCheapnessEstimator = CommandLine::ForCurrentProcess()->HasSwitch (switches::kUseCheapnessEstimator); |
58 | 58 |
59 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha sSwitch(switches::kEnableTopControlsPositionCalculation); | 59 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha sSwitch(switches::kEnableTopControlsPositionCalculation); |
60 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight )) { | 60 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight )) { |
61 std::string controls_height_str = | 61 std::string controls_height_str = |
62 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop ControlsHeight); | 62 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop ControlsHeight); |
63 double controls_height; | 63 double controls_height; |
64 if (base::StringToDouble(controls_height_str, &controls_height) && contr ols_height > 0) | 64 if (base::StringToDouble(controls_height_str, &controls_height) && contr ols_height > 0) |
65 settings.topControlsHeight = controls_height; | 65 settings.topControlsHeight = controls_height; |
66 } | 66 } |
67 | |
68 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsShowTh reshold)) { | |
jamesr
2013/02/20 08:08:35
this code won't do what you want (it isn't actuall
David Trainor- moved to gerrit
2013/02/21 02:07:36
Ah yeah rebased and saw this. Moved the implement
| |
69 std::string top_threshold_str( | |
70 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop ControlsShowThreshold)); | |
71 double show_threshold; | |
72 if (base::StringToDouble(top_threshold_str, &show_threshold) && show_thr eshold >= 0.f && show_threshold <= 1.f) | |
73 settings.topControlsShowThreshold = show_threshold; | |
74 } | |
75 | |
76 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHideTh reshold)) { | |
77 std::string top_threshold_str( | |
78 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop ControlsHideThreshold)); | |
79 double hide_threshold; | |
80 if (base::StringToDouble(top_threshold_str, &hide_threshold) && hide_thr eshold >= 0.f && hide_threshold <= 1.f) | |
81 settings.topControlsHideThreshold = hide_threshold; | |
82 } | |
83 | |
67 if (settings.calculateTopControlsPosition && (settings.topControlsHeight <= 0 || !settings.compositorFrameMessage)) { | 84 if (settings.calculateTopControlsPosition && (settings.topControlsHeight <= 0 || !settings.compositorFrameMessage)) { |
68 DCHECK(false) << "Top controls repositioning enabled without valid heigh t or compositorFrameMessage set."; | 85 DCHECK(false) << "Top controls repositioning enabled without valid heigh t or compositorFrameMessage set."; |
69 settings.calculateTopControlsPosition = false; | 86 settings.calculateTopControlsPosition = false; |
70 } | 87 } |
71 | 88 |
72 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); | 89 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); |
73 if (!m_layerTreeHost.get()) | 90 if (!m_layerTreeHost.get()) |
74 return false; | 91 return false; |
75 return true; | 92 return true; |
76 } | 93 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 { | 327 { |
311 m_client->didCompleteSwapBuffers(); | 328 m_client->didCompleteSwapBuffers(); |
312 } | 329 } |
313 | 330 |
314 void WebLayerTreeViewImpl::scheduleComposite() | 331 void WebLayerTreeViewImpl::scheduleComposite() |
315 { | 332 { |
316 m_client->scheduleComposite(); | 333 m_client->scheduleComposite(); |
317 } | 334 } |
318 | 335 |
319 } // namespace WebKit | 336 } // namespace WebKit |
OLD | NEW |