Added command line switches
- Added top control switches for browser.
Change-Id: I5d0c00292e7fd94b1733c940b30df9d902d81a2c
diff --git a/src/com/android/browser/BrowserConfigBase.java b/src/com/android/browser/BrowserConfigBase.java
index c81e593..9dd0bc0 100644
--- a/src/com/android/browser/BrowserConfigBase.java
+++ b/src/com/android/browser/BrowserConfigBase.java
@@ -50,9 +50,8 @@
}
public void overrideUserAgent() {
- BrowserCommandLine bcl = BrowserCommandLine.getInstance();
// Check if the UA is already present using command line file
- if (bcl.hasSwitch(OVERRIDE_USER_AGENT)) {
+ if (BrowserCommandLine.hasSwitch(OVERRIDE_USER_AGENT)) {
return;
}
@@ -64,10 +63,21 @@
ua = constructUserAgent(ua);
if (!TextUtils.isEmpty(ua)){
- bcl.appendSwitchWithValue(OVERRIDE_USER_AGENT, ua);
+ BrowserCommandLine.appendSwitchWithValue(OVERRIDE_USER_AGENT, ua);
}
}
+ public void initCommandLineSwitches() {
+ //SWE-hide-title-bar - enable following flags
+ BrowserCommandLine.appendSwitch("enable-top-controls-position-calculation");
+ BrowserCommandLine.appendSwitchWithValue("top-controls-height", "52");
+ BrowserCommandLine.appendSwitchWithValue("top-controls-show-threshold", "0.5");
+ BrowserCommandLine.appendSwitchWithValue("top-controls-hide-threshold", "0.5");
+
+ // Allow to override UserAgent
+ overrideUserAgent();
+ }
+
private String constructUserAgent(String userAgent) {
try {
userAgent = userAgent.replaceAll("<%build_model>", Build.MODEL);