OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.res.Resources; | 8 import android.content.res.Resources; |
9 import android.util.TypedValue; | 9 import android.util.TypedValue; |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 * @param resources Resources to use while calculating initialization consta
nts. | 28 * @param resources Resources to use while calculating initialization consta
nts. |
29 * @param resControlContainerHeight The resource id for the height of the to
p controls. | 29 * @param resControlContainerHeight The resource id for the height of the to
p controls. |
30 */ | 30 */ |
31 public static void enableFullscreenFlags( | 31 public static void enableFullscreenFlags( |
32 Resources resources, Context context, int resControlContainerHeight)
{ | 32 Resources resources, Context context, int resControlContainerHeight)
{ |
33 ContentApplication.initCommandLine(context); | 33 ContentApplication.initCommandLine(context); |
34 | 34 |
35 CommandLine commandLine = CommandLine.getInstance(); | 35 CommandLine commandLine = CommandLine.getInstance(); |
36 if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return; | 36 if (commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN)) return; |
37 | 37 |
38 commandLine.appendSwitch(ContentSwitches.ENABLE_TOP_CONTROLS_POSITION_CA
LCULATION); | |
39 | |
40 TypedValue threshold = new TypedValue(); | 38 TypedValue threshold = new TypedValue(); |
41 resources.getValue(R.floats.top_controls_show_threshold, threshold, true
); | 39 resources.getValue(R.floats.top_controls_show_threshold, threshold, true
); |
42 commandLine.appendSwitchWithValue( | 40 commandLine.appendSwitchWithValue( |
43 ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToS
tring().toString()); | 41 ContentSwitches.TOP_CONTROLS_SHOW_THRESHOLD, threshold.coerceToS
tring().toString()); |
44 resources.getValue(R.floats.top_controls_hide_threshold, threshold, true
); | 42 resources.getValue(R.floats.top_controls_hide_threshold, threshold, true
); |
45 commandLine.appendSwitchWithValue( | 43 commandLine.appendSwitchWithValue( |
46 ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToS
tring().toString()); | 44 ContentSwitches.TOP_CONTROLS_HIDE_THRESHOLD, threshold.coerceToS
tring().toString()); |
47 } | 45 } |
48 } | 46 } |
OLD | NEW |