diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-02-16 11:22:21 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-02-16 14:35:29 -0800 |
commit | 930ea2259874ce44b6d1916061a641340123c4e8 (patch) | |
tree | 169ba6e02c23777cd0492871a82de869a3f5c0c0 | |
parent | 1390d79f846f8a5982542a7dee545d215d22dbeb (diff) | |
download | packages_apps_Browser-930ea2259874ce44b6d1916061a641340123c4e8.zip packages_apps_Browser-930ea2259874ce44b6d1916061a641340123c4e8.tar.gz packages_apps_Browser-930ea2259874ce44b6d1916061a641340123c4e8.tar.bz2 |
Adding a debug setting to enable visual indicator for GL
[This is the Browser part]
The idea is to turn on the visual indicator without building the code.
The implementation included:
1. Setup the UI on browser side to check whether or not this is enabled.
2. Transfer the info from browser setting to web setting.
3. Send this info down from WebView to webkit.
4. In the webkit, we save this info in TilesManager.
5. At texture generation time, we query this info to decide whether we
add the visual indicator on the texture.
One design decision we made is we don't want to restart the browser for
debugging purpose. This is better preserving the browser current activity,
the only pitfall is that the visual indicator is NOT updated on different
textures simultaneously.
The webView change this needs is #change,97055
bug:3458721
Change-Id: Ie64be0c1ee372661fd395ce1c3729dd90d622c97
-rw-r--r-- | res/values/strings.xml | 2 | ||||
-rw-r--r-- | res/xml/hidden_debug_preferences.xml | 5 | ||||
-rw-r--r-- | src/com/android/browser/BrowserSettings.java | 11 |
3 files changed, 17 insertions, 1 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 80cb2c8..b61385a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -573,6 +573,8 @@ <!-- Do not tranlsate. Development option --> <string name="pref_development_hardware_accel" translatable="false">Enable OpenGL Rendering</string> <!-- Do not tranlsate. Development option --> + <string name="pref_development_visual_indicator" translatable="false">Enable Visual Indicator</string> + <!-- Do not tranlsate. Development option --> <string name="js_engine_flags" translatable="false">Set JS flags</string> <!-- Do not tranlsate. Development option --> <string name="pref_development_uastring" translatable="false">UAString</string> diff --git a/res/xml/hidden_debug_preferences.xml b/res/xml/hidden_debug_preferences.xml index 6d66eaa..661d9de 100644 --- a/res/xml/hidden_debug_preferences.xml +++ b/res/xml/hidden_debug_preferences.xml @@ -20,6 +20,11 @@ <!-- The javascript console is enabled by default when the user has also enabled debug mode by navigating to about:debug. --> <CheckBoxPreference + android:key="enable_visual_indicator" + android:defaultValue="false" + android:title="@string/pref_development_visual_indicator" /> + + <CheckBoxPreference android:key="javascript_console" android:defaultValue="true" android:title="@string/pref_development_error_console" /> diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java index faf0042..f3bc48a 100644 --- a/src/com/android/browser/BrowserSettings.java +++ b/src/com/android/browser/BrowserSettings.java @@ -109,7 +109,7 @@ public class BrowserSettings extends Observable implements OnSharedPreferenceCha private boolean lightTouch = false; private boolean navDump = false; private boolean hardwareAccelerated = true; - + private boolean showVisualIndicator = false; // Lab settings private boolean quickControls = false; private boolean useMostVisitedHomepage = false; @@ -162,6 +162,7 @@ public class BrowserSettings extends Observable implements OnSharedPreferenceCha public final static String PREF_AUTOFILL_PROFILE = "autofill_profile"; public final static String PREF_AUTOFILL_ACTIVE_PROFILE_ID = "autofill_active_profile_id"; public final static String PREF_HARDWARE_ACCEL = "enable_hardware_accel"; + public final static String PREF_VISUAL_INDICATOR = "enable_visual_indicator"; public final static String PREF_USER_AGENT = "user_agent"; public final static String PREF_QUICK_CONTROLS = "enable_quick_controls"; @@ -251,6 +252,7 @@ public class BrowserSettings extends Observable implements OnSharedPreferenceCha s.setUseWideViewPort(b.useWideViewPort); s.setLoadsImagesAutomatically(b.loadsImagesAutomatically); s.setJavaScriptEnabled(b.javaScriptEnabled); + s.setShowVisualIndicator(b.showVisualIndicator); s.setPluginState(b.pluginState); s.setJavaScriptCanOpenWindowsAutomatically( b.javaScriptCanOpenWindowsAutomatically); @@ -493,6 +495,7 @@ public class BrowserSettings extends Observable implements OnSharedPreferenceCha tracing = p.getBoolean("enable_tracing", tracing); lightTouch = p.getBoolean("enable_light_touch", lightTouch); navDump = p.getBoolean("enable_nav_dump", navDump); + showVisualIndicator = p.getBoolean(PREF_VISUAL_INDICATOR, showVisualIndicator); } quickControls = p.getBoolean(PREF_QUICK_CONTROLS, quickControls); @@ -589,6 +592,10 @@ public class BrowserSettings extends Observable implements OnSharedPreferenceCha return hardwareAccelerated; } + public boolean showVisualIndicator() { + return showVisualIndicator; + } + public boolean useQuickControls() { return quickControls; } @@ -886,6 +893,8 @@ public class BrowserSettings extends Observable implements OnSharedPreferenceCha SharedPreferences p, String key) { if (PREF_HARDWARE_ACCEL.equals(key)) { hardwareAccelerated = p.getBoolean(PREF_HARDWARE_ACCEL, hardwareAccelerated); + } else if (PREF_VISUAL_INDICATOR.equals(key)) { + showVisualIndicator = p.getBoolean(PREF_VISUAL_INDICATOR, showVisualIndicator); } else if (PREF_USER_AGENT.equals(key)) { userAgent = Integer.parseInt(p.getString(PREF_USER_AGENT, "0")); update(); |