Bug 1335895 - part 28: Remove unused resources, prefs, and layout used by deleted ZoomedView.java r=jchen,kats
MozReview-Commit-ID: IaShJNM6qw9
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -122,23 +122,21 @@ GetPrefsFor(EventClassID aEventClassID)
"ui.mouse.radius.inputSource.touchOnly", true);
} else {
prefs->mTouchOnly = false;
}
nsPrintfCString repositionPref("ui.%s.radius.reposition", prefBranch);
Preferences::AddBoolVarCache(&prefs->mRepositionEventCoords, repositionPref.get(), false);
- Preferences::AddBoolVarCache(&prefs->mTouchClusterDetectionEnabled, "ui.zoomedview.enabled", false);
-
- Preferences::AddBoolVarCache(&prefs->mSimplifiedClusterDetection, "ui.zoomedview.simplified", false);
-
- Preferences::AddUintVarCache(&prefs->mLimitReadableSize, "ui.zoomedview.limitReadableSize", 8);
-
- Preferences::AddUintVarCache(&prefs->mKeepLimitSizeForCluster, "ui.zoomedview.keepLimitSize", 16);
+ // These values were formerly set by ui.zoomedview preferences.
+ prefs->mTouchClusterDetectionEnabled = false;
+ prefs->mSimplifiedClusterDetection = false;
+ prefs->mLimitReadableSize = 8;
+ prefs->mKeepLimitSizeForCluster = 16;
}
return prefs;
}
static bool
HasMouseListener(nsIContent* aContent)
{
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -413,26 +413,20 @@ pref("devtools.remote.wifi.enabled", fal
pref("font.size.inflation.minTwips", 0);
// When true, zooming will be enabled on all sites, even ones that declare user-scalable=no.
pref("browser.ui.zoom.force-user-scalable", false);
// When removing this Nightly flag, also remember to remove the flags surrounding this feature
// in GeckoPreferences and BrowserApp (see bug 1245930).
#ifdef NIGHTLY_BUILD
-pref("ui.zoomedview.enabled", true);
pref("ui.bookmark.mobilefolder.enabled", true);
#else
-pref("ui.zoomedview.enabled", false);
pref("ui.bookmark.mobilefolder.enabled", false);
#endif
-pref("ui.zoomedview.keepLimitSize", 16); // value in layer pixels, used to not keep the large elements in the cluster list (Bug 1191041)
-pref("ui.zoomedview.limitReadableSize", 8); // value in layer pixels
-pref("ui.zoomedview.defaultZoomFactor", 2);
-pref("ui.zoomedview.simplified", true); // Do not display all the zoomed view controls, do not use size heurisistic
pref("ui.touch.radius.enabled", false);
pref("ui.touch.radius.leftmm", 3);
pref("ui.touch.radius.topmm", 5);
pref("ui.touch.radius.rightmm", 3);
pref("ui.touch.radius.bottommm", 2);
pref("ui.touch.radius.visitedWeight", 120);
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -143,17 +143,16 @@ public class GeckoPreferences
private static final String PREFS_GEO_REPORTING = NON_PREF_PREFIX + "app.geo.reportdata";
private static final String PREFS_GEO_LEARN_MORE = NON_PREF_PREFIX + "geo.learn_more";
private static final String PREFS_HEALTHREPORT_LINK = NON_PREF_PREFIX + "healthreport.link";
private static final String PREFS_DEVTOOLS_REMOTE_USB_ENABLED = "devtools.remote.usb.enabled";
private static final String PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED = "devtools.remote.wifi.enabled";
private static final String PREFS_DEVTOOLS_REMOTE_LINK = NON_PREF_PREFIX + "remote_debugging.link";
private static final String PREFS_TRACKING_PROTECTION = "privacy.trackingprotection.state";
private static final String PREFS_TRACKING_PROTECTION_PB = "privacy.trackingprotection.pbmode.enabled";
- private static final String PREFS_ZOOMED_VIEW_ENABLED = "ui.zoomedview.enabled";
public static final String PREFS_VOICE_INPUT_ENABLED = NON_PREF_PREFIX + "voice_input_enabled";
public static final String PREFS_QRCODE_ENABLED = NON_PREF_PREFIX + "qrcode_enabled";
private static final String PREFS_TRACKING_PROTECTION_PRIVATE_BROWSING = "privacy.trackingprotection.pbmode.enabled";
private static final String PREFS_TRACKING_PROTECTION_LEARN_MORE = NON_PREF_PREFIX + "trackingprotection.learn_more";
private static final String PREFS_CLEAR_PRIVATE_DATA = NON_PREF_PREFIX + "privacy.clear";
private static final String PREFS_CLEAR_PRIVATE_DATA_EXIT = NON_PREF_PREFIX + "history.clear_on_exit";
private static final String PREFS_SCREEN_ADVANCED = NON_PREF_PREFIX + "advanced_screen";
public static final String PREFS_HOMEPAGE = NON_PREF_PREFIX + "homepage";
@@ -835,22 +834,16 @@ public class GeckoPreferences
} else if (PREFS_TAB_QUEUE.equals(key)) {
tabQueuePreference = (SwitchPreference) pref;
// Only show tab queue pref on nightly builds with the tab queue build flag.
if (!TabQueueHelper.TAB_QUEUE_ENABLED) {
preferences.removePreference(pref);
i--;
continue;
}
- } else if (PREFS_ZOOMED_VIEW_ENABLED.equals(key)) {
- if (!AppConstants.NIGHTLY_BUILD) {
- preferences.removePreference(pref);
- i--;
- continue;
- }
} else if (PREFS_VOICE_INPUT_ENABLED.equals(key)) {
if (!InputOptionsUtils.supportsVoiceRecognizer(getApplicationContext(), getResources().getString(R.string.voicesearch_prompt))) {
// Remove UI for voice input on non nightly builds.
preferences.removePreference(pref);
i--;
continue;
}
} else if (PREFS_QRCODE_ENABLED.equals(key)) {
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -518,21 +518,16 @@
<!ENTITY doorhanger_login_edit_username_hint "Username">
<!ENTITY doorhanger_login_edit_password_hint "Password">
<!ENTITY doorhanger_login_edit_toggle "Show password">
<!ENTITY doorhanger_login_select_message "Copy password from &formatS;?">
<!ENTITY doorhanger_login_select_toast_copy "Password copied to clipboard">
<!ENTITY doorhanger_login_select_action_text "Select another login">
<!ENTITY doorhanger_login_select_title "Copy password from">
-<!-- Localization note (pref_prevent_magnifying_glass): Label for setting that controls
- whether or not the magnifying glass is disabled. -->
-<!ENTITY pref_magnifying_glass_enabled "Magnify small areas">
-<!ENTITY pref_magnifying_glass_enabled_summary2 "Enlarge links and form fields when touching near them">
-
<!-- Localization note (pref_scroll_title_bar2): Label for setting that controls
whether or not the dynamic toolbar is enabled. -->
<!ENTITY pref_scroll_title_bar2 "Full-screen browsing">
<!ENTITY pref_scroll_title_bar_summary2 "Hide the &brandShortName; toolbar when scrolling down a page">
<!ENTITY pref_tab_queue_title3 "Tab queue">
<!ENTITY pref_tab_queue_summary4 "Save links until the next time you open &brandShortName;">
@@ -732,24 +727,16 @@ just addresses the organization to follo
<!-- Miscellaneous -->
<!-- LOCALIZATION NOTE (ellipsis): This text is appended to a piece of text that does not fit in the
designated space. Use the unicode ellipsis char, \u2026, or use "..." if \u2026 doesn't suit
traditions in your locale. -->
<!ENTITY ellipsis "…">
<!ENTITY colon ":">
-<!-- LOCALIZATION NOTE (percent): The percent sign is appended after a number to
- display a percentage value. formatS is the number, #37 is the code to display a percent sign.
- This format string is typically used by getString method, in such method the percent sign
- is a reserved caracter. In order to display one percent sign in the result of getString,
- double percent signs must be inserted in the format string.
- This entity is used in the zoomed view to display the zoom factor-->
-<!ENTITY percent "&formatS;%%">
-
<!-- These are only used for accessibility for the done and overflow-menu buttons in the actionbar.
They are never shown to users -->
<!ENTITY actionbar_menu "Menu">
<!ENTITY actionbar_done "Done">
<!-- Voice search in the awesome bar -->
<!ENTITY voicesearch_prompt "Speak now">
deleted file mode 100644
--- a/mobile/android/base/resources/drawable/toolbar_grey_round.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="@color/toolbar_grey"/>
- <corners android:radius="@dimen/standard_corner_radius"/>
-</shape>
-
--- a/mobile/android/base/resources/layout/gecko_app.xml
+++ b/mobile/android/base/resources/layout/gecko_app.xml
@@ -42,22 +42,16 @@
android:layout_height="match_parent"
android:visibility="gone"/>
<view class="org.mozilla.gecko.media.VideoPlayer" android:id="@+id/video_player"
android:layout_height="match_parent"
android:layout_width="match_parent">
</view>
- <ViewStub android:id="@+id/zoomed_view_stub"
- android:inflatedId="@+id/zoomed_view"
- android:layout="@layout/zoomed_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-
<FrameLayout android:id="@+id/home_screen_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ViewStub android:id="@+id/home_pager_stub"
android:layout="@layout/home_pager"
android:layout_width="match_parent"
deleted file mode 100644
--- a/mobile/android/base/resources/layout/zoomed_view.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/.
--->
-
-<org.mozilla.gecko.ZoomedView xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:gecko="http://schemas.android.com/apk/res-auto"
- android:id="@+id/zoomed_view_container"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/dropshadow"
- android:padding="@dimen/drawable_dropshadow_size"
- android:visibility="gone">
-
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:background="@drawable/toolbar_grey_round">
- <!--
- Zoom factor button is invisible by default. Set ui.zoomedview.simplified to false
- in order to display the button in the zoomed view tool bar
- -->
- <TextView
- android:id="@+id/change_zoom_factor"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/zoomed_view_toolbar_height"
- android:background="@android:color/transparent"
- android:padding="12dip"
- android:layout_alignLeft="@+id/zoomed_image_view"
- android:textSize="16sp"
- android:textColor="@color/text_and_tabs_tray_grey"
- android:visibility="invisible"/>
- <ImageView
- android:id="@+id/dialog_close"
- android:scaleType="center"
- android:layout_width="@dimen/zoomed_view_toolbar_height"
- android:layout_height="@dimen/zoomed_view_toolbar_height"
- android:layout_alignRight="@id/zoomed_image_view"
- android:src="@drawable/close_edit_mode_selector"/>
- <ImageView
- android:id="@id/zoomed_image_view"
- android:layout_below="@id/change_zoom_factor"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
- </RelativeLayout>
-
-</org.mozilla.gecko.ZoomedView>
\ No newline at end of file
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -196,28 +196,23 @@
<dimen name="tab_history_combo_margin_start">15dp</dimen>
<dimen name="tab_history_combo_margin_end">15dp</dimen>
<dimen name="tab_history_title_fading_width">50dp</dimen>
<dimen name="tab_history_title_margin_end">15dp</dimen>
<dimen name="tab_history_title_text_size">14sp</dimen>
<dimen name="tab_history_bg_width">2dp</dimen>
<dimen name="tab_history_border_padding">2dp</dimen>
- <!-- ZoomedView dimensions. -->
- <dimen name="zoomed_view_toolbar_height">44dp</dimen>
- <dimen name="drawable_dropshadow_size">3dp</dimen>
-
<!-- Find-In-Page dialog dimensions. -->
<dimen name="find_in_page_text_margin_start">5dip</dimen>
<dimen name="find_in_page_text_margin_end">12dip</dimen>
<dimen name="find_in_page_text_padding_start">10dip</dimen>
<dimen name="find_in_page_text_padding_end">10dip</dimen>
<dimen name="find_in_page_status_margin_end">10dip</dimen>
<dimen name="find_in_page_control_margin_top">2dip</dimen>
- <dimen name="progress_bar_scroll_offset">1.5dp</dimen>
<!-- Matches the built-in divider height. fwiw, in the framework
I suspect this is a drawable rather than a dimen. -->
<dimen name="action_bar_divider_height">2dp</dimen>
<!-- http://blog.danlew.net/2015/01/06/handling-android-resources-with-non-standard-formats/ -->
<item name="match_parent" type="dimen">-1</item>
<item name="wrap_content" type="dimen">-2</item>
--- a/mobile/android/base/resources/xml/preferences_accessibility.xml
+++ b/mobile/android/base/resources/xml/preferences_accessibility.xml
@@ -10,20 +10,16 @@
<SwitchPreference android:key="android.not_a_preference.font.size.use_system_font_size"
android:title="@string/pref_use_system_font_size"
android:summary="@string/pref_use_system_font_size_summary" />
<SwitchPreference android:key="browser.ui.zoom.force-user-scalable"
android:title="@string/pref_zoom_force_enabled"
android:summary="@string/pref_zoom_force_enabled_summary" />
- <SwitchPreference android:key="ui.zoomedview.enabled"
- android:title="@string/pref_magnifying_glass_enabled"
- android:summary="@string/pref_magnifying_glass_enabled_summary" />
-
<SwitchPreference android:key="android.not_a_preference.voice_input_enabled"
android:title="@string/pref_voice_input"
android:summary="@string/pref_voice_input_summary"
android:defaultValue="true"/>
<SwitchPreference android:key="android.not_a_preference.qrcode_enabled"
android:title="@string/pref_qrcode_enabled"
android:summary="@string/pref_qrcode_enabled_summary"
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -416,19 +416,16 @@
<string name="doorhanger_login_edit_username_hint">&doorhanger_login_edit_username_hint;</string>
<string name="doorhanger_login_edit_password_hint">&doorhanger_login_edit_password_hint;</string>
<string name="doorhanger_login_edit_toggle">&doorhanger_login_edit_toggle;</string>
<string name="doorhanger_login_select_message">&doorhanger_login_select_message;</string>
<string name="doorhanger_login_select_toast_copy">&doorhanger_login_select_toast_copy;</string>
<string name="doorhanger_login_select_action_text">&doorhanger_login_select_action_text;</string>
<string name="doorhanger_login_select_title">&doorhanger_login_select_title;</string>
- <string name="pref_magnifying_glass_enabled">&pref_magnifying_glass_enabled;</string>
- <string name="pref_magnifying_glass_enabled_summary">&pref_magnifying_glass_enabled_summary2;</string>
-
<string name="pref_scroll_title_bar2">&pref_scroll_title_bar2;</string>
<string name="pref_scroll_title_bar_summary">&pref_scroll_title_bar_summary2;</string>
<string name="pref_compact_tabs">&pref_compact_tabs;</string>
<string name="pref_compact_tabs_summary">&pref_compact_tabs_summary2;</string>
<string name="page_removed">&page_removed;</string>
@@ -596,18 +593,16 @@
<string name="restrictable_feature_block_list">&restrictable_feature_block_list;</string>
<string name="restrictable_feature_block_list_description">&restrictable_feature_block_list_description;</string>
<!-- Miscellaneous -->
<string name="ellipsis">&ellipsis;</string>
<string name="colon">:</string>
- <string name="percent">&percent;</string>
-
<string name="remote_tabs_last_synced">&remote_tabs_last_synced;</string>
<string name="intent_uri_private_browsing_prompt">&intent_uri_private_browsing_prompt;</string>
<string name="intent_uri_private_browsing_multiple_match_title">&intent_uri_private_browsing_multiple_match_title;</string>
<string name="devtools_auth_scan_header">&devtools_auth_scan_header;</string>
<string name="unsupported_sdk_version">&unsupported_sdk_version;</string>
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -554,17 +554,16 @@ var BrowserApp = {
if (!AppConstants.RELEASE_OR_BETA) {
InitLater(() => WebcompatReporter.init());
}
// Collect telemetry data.
// We do this at startup because we want to move away from "gather-telemetry" (bug 1127907)
InitLater(() => {
Telemetry.addData("FENNEC_TRACKING_PROTECTION_STATE", parseInt(BrowserApp.getTrackingProtectionState()));
- Telemetry.addData("ZOOMED_VIEW_ENABLED", Services.prefs.getBoolPref("ui.zoomedview.enabled"));
});
InitLater(() => LightWeightThemeWebInstaller.init());
InitLater(() => CastingApps.init(), window, "CastingApps");
InitLater(() => Services.search.init(), Services, "search");
InitLater(() => DownloadNotifications.init(), window, "DownloadNotifications");
// Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
@@ -4506,18 +4505,16 @@ Tab.prototype = {
sameDocument: sameDocument,
canGoBack: webNav.canGoBack,
canGoForward: webNav.canGoForward,
};
GlobalEventDispatcher.sendRequest(message);
- BrowserEventHandler.closeZoomedView();
-
notifyManifestStatus(this.browser);
if (!sameDocument) {
// XXX This code assumes that this is the earliest hook we have at which
// browser.contentDocument is changed to the new document we're loading
this.contentDocumentIsDisplayed = false;
this.hasTouchListener = false;
Services.obs.notifyObservers(this.browser, "Session:NotifyLocationChange");
@@ -4727,20 +4724,16 @@ Tab.prototype = {
Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsIBrowserTab
])
};
var BrowserEventHandler = {
init: function init() {
- this._clickInZoomedView = false;
- Services.obs.addObserver(this, "Gesture:SingleTap");
- Services.obs.addObserver(this, "Gesture:ClickInZoomedView");
-
BrowserApp.deck.addEventListener("touchend", this, true);
BrowserApp.deck.addEventListener("DOMUpdatePageReport", PopupBlockerObserver.onUpdatePageReport);
BrowserApp.deck.addEventListener("MozMouseHittest", this, true);
BrowserApp.deck.addEventListener("OpenMediaWithExternalApp", this, true);
InitLater(() => BrowserApp.deck.addEventListener("click", InputWidgetHelper, true));
InitLater(() => BrowserApp.deck.addEventListener("click", SelectHelper, true));
@@ -4808,83 +4801,16 @@ var BrowserEventHandler = {
(aElement instanceof Ci.nsIDOMHTMLAreaElement && aElement.href))) {
try {
return Services.io.newURI(aElement.href);
} catch (e) {}
}
return null;
},
- observe: function(aSubject, aTopic, aData) {
- // the remaining events are all dependent on the browser content document being the
- // same as the browser displayed document. if they are not the same, we should ignore
- // the event.
- if (BrowserApp.isBrowserContentDocumentDisplayed()) {
- this.handleUserEvent(aTopic, aData);
- }
- },
-
- handleUserEvent: function(aTopic, aData) {
- switch (aTopic) {
-
- case "Gesture:ClickInZoomedView":
- this._clickInZoomedView = true;
- break;
-
- case "Gesture:SingleTap": {
- let focusedElement = BrowserApp.getFocusedInput(BrowserApp.selectedBrowser);
- let data = JSON.parse(aData);
- let {x, y} = data;
-
- if (this._inCluster && this._clickInZoomedView != true) {
- // If there is a focused element, the display of the zoomed view won't remove the focus.
- // In this case, the form assistant linked to the focused element will never be closed.
- // To avoid this situation, the focus is moved and the form assistant is closed.
- if (focusedElement) {
- try {
- Services.focus.moveFocus(BrowserApp.selectedBrowser.contentWindow, null, Services.focus.MOVEFOCUS_ROOT, 0);
- } catch(e) {
- Cu.reportError(e);
- }
- WindowEventDispatcher.sendRequest({ type: "FormAssist:Hide" });
- }
- this._clusterClicked(x, y);
- } else {
- if (this._clickInZoomedView != true) {
- this.closeZoomedView(/* animate */ true);
- }
- }
- this._clickInZoomedView = false;
- this._cancelTapHighlight();
- break;
- }
-
- default:
- dump('BrowserEventHandler.handleUserEvent: unexpected topic "' + aTopic + '"');
- break;
- }
- },
-
- closeZoomedView: function(aAnimate) {
- WindowEventDispatcher.sendRequest({
- type: "Gesture:CloseZoomedView",
- animate: !!aAnimate,
- });
- },
-
- _clusterClicked: function(aX, aY) {
- WindowEventDispatcher.sendRequest({
- type: "Gesture:ClusteredLinksClicked",
- clickPosition: {
- x: aX,
- y: aY
- }
- });
- },
-
_highlightElement: null,
_doTapHighlight: function _doTapHighlight(aElement) {
this._highlightElement = aElement;
},
_cancelTapHighlight: function _cancelTapHighlight() {
if (!this._highlightElement)