From af63dbadb04a963f3513bff2f6ec5f34d31c24d6 Mon Sep 17 00:00:00 2001 From: Michael Kolb Date: Wed, 16 May 2012 12:58:05 -0700 Subject: Toggle QC request desktop icon Bug: 6493939 Change-Id: I7787ab37b57fce8ea2332fefd1ace420357000ec --- src/com/android/browser/Controller.java | 3 ++- src/com/android/browser/PieControl.java | 9 +++++++++ src/com/android/browser/UiController.java | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 2fb465c..493583d 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -429,7 +429,8 @@ public class Controller mUi = ui; } - BrowserSettings getSettings() { + @Override + public BrowserSettings getSettings() { return mSettings; } diff --git a/src/com/android/browser/PieControl.java b/src/com/android/browser/PieControl.java index 7c4291c..a33f8c6 100644 --- a/src/com/android/browser/PieControl.java +++ b/src/com/android/browser/PieControl.java @@ -118,6 +118,15 @@ public class PieControl implements PieMenu.PieController, OnClickListener { if (tab != null) { mForward.setEnabled(tab.canGoForward()); } + WebView view = mUiController.getCurrentWebView(); + if (view != null) { + ImageView icon = (ImageView) mRDS.getView(); + if (mUiController.getSettings().hasDesktopUseragent(view)) { + icon.setImageResource(R.drawable.ic_mobile); + } else { + icon.setImageResource(R.drawable.ic_desktop_holo_dark); + } + } return true; } diff --git a/src/com/android/browser/UiController.java b/src/com/android/browser/UiController.java index 5be2343..b3d4631 100644 --- a/src/com/android/browser/UiController.java +++ b/src/com/android/browser/UiController.java @@ -105,4 +105,6 @@ public interface UiController { void toggleUserAgent(); + BrowserSettings getSettings(); + } -- cgit v1.1