From 31109e50dffa70ddc0ce66e57b4f08a02a287f10 Mon Sep 17 00:00:00 2001 From: daron-walters Date: Thu, 21 May 2020 15:58:36 -0400 Subject: [PATCH] Fixes #2859 - Removed code to select all of the edit field when it is the default valeu Fixes #2859 Removed onclick listener whose sole purpose was to highlight default values and set focus --- app/build.gradle | 4 +- app/metrics.yaml | 45 +-- .../mozilla/vrbrowser/VRBrowserActivity.java | 75 +--- .../org/mozilla/vrbrowser/browser/Accounts.kt | 6 +- .../vrbrowser/browser/BookmarksStore.kt | 2 +- .../vrbrowser/browser/PermissionDelegate.java | 12 +- .../org/mozilla/vrbrowser/browser/Places.kt | 2 +- .../vrbrowser/browser/PromptDelegate.java | 15 +- .../org/mozilla/vrbrowser/browser/Services.kt | 28 +- .../vrbrowser/browser/SettingsStore.java | 4 +- .../content/TrackingProtectionStore.java | 178 ++++++--- .../browser/engine/EngineProvider.kt | 2 - .../vrbrowser/browser/engine/Session.java | 65 +--- .../browser/engine/SessionSettings.java | 4 +- .../browser/engine/SessionStore.java | 32 +- .../browser/engine/SessionUtils.java | 52 ++- .../org/mozilla/vrbrowser/db/AppDatabase.java | 18 +- .../mozilla/vrbrowser/db/DataRepository.java | 4 - .../mozilla/vrbrowser/db/SitePermission.java | 6 +- .../vrbrowser/db/SitePermissionDao.java | 3 - .../vrbrowser/downloads/DownloadsManager.java | 80 ++--- .../geolocation/GeolocationWrapper.kt | 5 +- .../GeolocationLocalizationProvider.java | 6 + .../vrbrowser/search/SearchEngineWrapper.java | 33 +- .../suggestions/SearchSuggestionsCLient.kt | 11 - .../search/suggestions/SuggestionParser.java | 102 ++++++ .../search/suggestions/SuggestionsClient.java | 69 ++++ .../suggestions/SuggestionsProvider.java | 35 +- .../telemetry/GleanMetricsService.java | 24 +- .../ui/adapters/DownloadsAdapter.java | 10 +- .../ui/adapters/SitePermissionAdapter.java | 9 +- .../ui/viewmodel/SitePermissionViewModel.java | 4 - .../ui/viewmodel/WindowViewModel.java | 65 +--- .../vrbrowser/ui/views/NavigationURLBar.java | 3 - .../mozilla/vrbrowser/ui/views/TabView.java | 8 +- .../ui/views/library/DownloadsView.java | 104 ++---- .../ui/widgets/MediaControlsWidget.java | 73 ++-- .../ui/widgets/NavigationBarWidget.java | 130 +++---- .../ui/widgets/NotificationManager.java | 5 +- .../vrbrowser/ui/widgets/TabsWidget.java | 9 +- .../vrbrowser/ui/widgets/TrayWidget.java | 66 +--- .../ui/widgets/WebXRInterstitialWidget.java | 20 +- .../ui/widgets/WidgetManagerDelegate.java | 2 - .../vrbrowser/ui/widgets/WindowWidget.java | 65 ++-- .../mozilla/vrbrowser/ui/widgets/Windows.java | 12 +- .../ui/widgets/dialogs/CrashDialogWidget.java | 2 +- .../ui/widgets/dialogs/PermissionWidget.java | 2 +- .../widgets/dialogs/PromptDialogWidget.java | 6 +- .../widgets/dialogs/RestartDialogWidget.java | 2 +- .../widgets/dialogs/SignOutDialogWidget.java | 2 +- .../ui/widgets/dialogs/VoiceSearchWidget.java | 2 +- .../ui/widgets/dialogs/WhatsNewWidget.java | 2 +- .../ui/widgets/menus/ContextMenuWidget.java | 99 +++-- .../library/SortingContextMenuWidget.java | 2 +- .../widgets/settings/PrivacyOptionsView.java | 2 +- .../ui/widgets/settings/SettingsView.java | 1 - .../ui/widgets/settings/SettingsWidget.java | 2 +- .../settings/SitePermissionsOptionsView.java | 14 +- .../TrackingPermissionsOptionsView.java | 37 -- .../mozilla/vrbrowser/utils/DeviceType.java | 12 +- .../org/mozilla/vrbrowser/utils/UrlUtils.java | 31 +- .../assets/searchplugins/google-b-1-m.xml | 17 - .../main/assets/searchplugins/google-b-m.xml | 17 - .../web_extensions/webcompat_youtube/main.css | 12 + .../web_extensions/webcompat_youtube/main.js | 5 +- app/src/main/cpp/BrowserWorld.cpp | 20 +- app/src/main/cpp/Controller.cpp | 15 - app/src/main/cpp/Controller.h | 11 +- app/src/main/cpp/ControllerContainer.cpp | 94 ----- app/src/main/cpp/ControllerContainer.h | 8 - app/src/main/cpp/ControllerDelegate.h | 23 +- app/src/main/cpp/Device.h | 26 -- app/src/main/cpp/ExternalVR.cpp | 92 +---- app/src/main/cpp/ExternalVR.h | 1 - app/src/main/cpp/VRBrowser.cpp | 129 +++---- app/src/main/cpp/VRBrowser.h | 4 +- app/src/main/cpp/moz_external_vr.h | 56 ++- app/src/main/res/drawable/ic_icon_popup.xml | 14 +- .../res/drawable/ic_icon_popup_blocked.xml | 14 +- app/src/main/res/layout/navigation_url.xml | 17 +- app/src/main/res/layout/title_bar.xml | 1 - app/src/main/res/layout/tray.xml | 2 +- .../main/res/layout/webxr_interstitial.xml | 2 +- app/src/main/res/values-de/strings.xml | 284 +-------------- app/src/main/res/values-en-rGB/strings.xml | 274 +------------- app/src/main/res/values-es-rES/strings.xml | 284 +-------------- app/src/main/res/values-fr/strings.xml | 286 +-------------- app/src/main/res/values-it/strings.xml | 284 +-------------- app/src/main/res/values-ja/strings.xml | 37 +- app/src/main/res/values-ko/strings.xml | 294 +-------------- app/src/main/res/values-nb-rNO/strings.xml | 340 +----------------- app/src/main/res/values-nl/strings.xml | 284 +-------------- app/src/main/res/values-nn-rNO/strings.xml | 44 ++- app/src/main/res/values-ru/strings.xml | 286 +-------------- app/src/main/res/values-sv-rSE/strings.xml | 284 +-------------- app/src/main/res/values-zh-rCN/strings.xml | 284 +-------------- app/src/main/res/values-zh-rTW/strings.xml | 284 +-------------- app/src/main/res/values/non_L10n.xml | 19 +- app/src/main/res/values/strings.xml | 19 +- .../oculusvr/cpp/DeviceDelegateOculusVR.cpp | 97 ++--- app/src/oculusvr/cpp/OculusVRLayers.h | 14 +- app/src/picovr/cpp/DeviceDelegatePicoVR.cpp | 86 ++--- app/src/picovr/cpp/VRBrowserPico.cpp | 11 +- app/src/picovr/cpp/VRBrowserPico.h | 30 +- app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp | 76 +--- app/src/wavevr/cpp/DeviceDelegateWaveVR.h | 1 - .../mozilla/vrbrowser/PlatformActivity.java | 1 + .../wavevr/res/drawable/controller_focus.png | Bin 24642 -> 0 bytes ...lus_left.png => controller_focus_left.png} | Bin ...s_right.png => controller_focus_right.png} | Bin .../layout/webxr_interstitial_controller.xml | 46 +-- build.gradle | 4 +- docs/metrics.md | 57 +-- versions.gradle | 8 +- 114 files changed, 1232 insertions(+), 5091 deletions(-) delete mode 100644 app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SearchSuggestionsCLient.kt create mode 100644 app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionParser.java create mode 100644 app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionsClient.java delete mode 100644 app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/TrackingPermissionsOptionsView.java delete mode 100644 app/src/main/assets/searchplugins/google-b-1-m.xml delete mode 100644 app/src/main/assets/searchplugins/google-b-m.xml delete mode 100644 app/src/wavevr/res/drawable/controller_focus.png rename app/src/wavevr/res/drawable/{controller_focus_plus_left.png => controller_focus_left.png} (100%) rename app/src/wavevr/res/drawable/{controller_focus_plus_right.png => controller_focus_right.png} (100%) diff --git a/app/build.gradle b/app/build.gradle index 8f3fed0f9..7718a6d25 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,6 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: "org.mozilla.telemetry.glean-gradle-plugin" -deps.telemetry.glean_unittests = "org.mozilla.telemetry:glean-forUnitTests:$project.ext.glean_version" - def getGitHash = { -> def stdout = new ByteArrayOutputStream() exec { @@ -51,7 +49,7 @@ android { minSdkVersion build_versions.min_sdk targetSdkVersion build_versions.target_sdk versionCode 1 - versionName "11" + versionName "10" buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\"" buildConfigField "Boolean", "DISABLE_CRASH_RESTART", getCrashRestartDisabled() testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/metrics.yaml b/app/metrics.yaml index 32275c72c..2ac059b63 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -21,11 +21,10 @@ distribution: - https://github.com/MozillaReality/FirefoxReality/issues/1420 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - dmu@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" url: domains: @@ -38,11 +37,10 @@ url: - https://github.com/MozillaReality/FirefoxReality/issues/2230 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - dmu@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" visits: type: counter send_in_pings: @@ -53,11 +51,10 @@ url: - https://github.com/MozillaReality/FirefoxReality/issues/2230 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - dmu@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" query_type: type: labeled_counter description: > @@ -70,11 +67,10 @@ url: - https://github.com/MozillaReality/FirefoxReality/issues/2230 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - dmu@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" searches: counts: @@ -85,11 +81,10 @@ searches: - https://github.com/MozillaReality/FirefoxReality/issues/2230 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - dmu@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" tabs: opened: @@ -112,11 +107,10 @@ tabs: - https://github.com/MozillaReality/FirefoxReality/issues/1609 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" activated: type: counter description: > @@ -127,11 +121,10 @@ tabs: - https://github.com/MozillaReality/FirefoxReality/issues/1609 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" firefox_account: sign_in: @@ -142,11 +135,10 @@ firefox_account: - https://github.com/MozillaReality/FirefoxReality/issues/1610 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" sign_in_result: type: event description: > @@ -158,11 +150,10 @@ firefox_account: - https://github.com/MozillaReality/FirefoxReality/issues/1610 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" sign_out: type: event description: > @@ -171,11 +162,10 @@ firefox_account: - https://github.com/MozillaReality/FirefoxReality/issues/1610 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" bookmarks_sync_status: type: boolean lifetime: application @@ -185,11 +175,10 @@ firefox_account: - https://github.com/MozillaReality/FirefoxReality/issues/1610 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" history_sync_status: type: boolean lifetime: application @@ -199,11 +188,10 @@ firefox_account: - https://github.com/MozillaReality/FirefoxReality/issues/1610 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" tab_sent: type: counter description: > @@ -212,11 +200,10 @@ firefox_account: - https://github.com/MozillaReality/FirefoxReality/issues/1610 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" received_tab: type: labeled_counter description: > @@ -232,11 +219,10 @@ firefox_account: - https://github.com/MozillaReality/FirefoxReality/issues/1610 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - manmartin@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" control: open_new_window: @@ -249,8 +235,7 @@ control: - https://github.com/MozillaReality/FirefoxReality/issues/2347 data_reviews: - https://github.com/MozillaReality/FirefoxReality/pull/2348#issuecomment-564736919 - - https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749 notification_emails: - fxr-telemetry@mozilla.com - dmu@mozilla.com - expires: "2020-11-01" + expires: "2020-05-01" diff --git a/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java b/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java index 402478c56..6eca53e98 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java @@ -49,7 +49,6 @@ import org.mozilla.vrbrowser.browser.Accounts; import org.mozilla.vrbrowser.browser.PermissionDelegate; import org.mozilla.vrbrowser.browser.SettingsStore; -import org.mozilla.vrbrowser.browser.engine.EngineProvider; import org.mozilla.vrbrowser.browser.engine.Session; import org.mozilla.vrbrowser.browser.engine.SessionStore; import org.mozilla.vrbrowser.crashreporting.CrashReporterService; @@ -97,8 +96,6 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.function.Consumer; -import static org.mozilla.vrbrowser.ui.widgets.UIWidget.REMOVE_WIDGET; - public class VRBrowserActivity extends PlatformActivity implements WidgetManagerDelegate, ComponentCallbacks2, LifecycleOwner, ViewModelStoreOwner { private BroadcastReceiver mCrashReceiver = new BroadcastReceiver() { @@ -171,7 +168,6 @@ public void run() { NavigationBarWidget mNavigationBar; CrashDialogWidget mCrashDialog; TrayWidget mTray; - WhatsNewWidget mWhatsNewWidget = null; WebXRInterstitialWidget mWebXRInterstitial; PermissionDelegate mPermissionDelegate; LinkedList mWidgetUpdateListeners; @@ -193,7 +189,6 @@ public void run() { private Widget mActiveDialog; private Set mPoorPerformanceWhiteList; private float mCurrentCylinderDensity = 0; - private boolean mHideWebXRIntersitial = false; private boolean callOnAudioManager(Consumer fn) { if (mAudioManager == null) { @@ -257,8 +252,6 @@ protected void onCreate(Bundle savedInstanceState) { SessionStore.get().initializeStores(this); SessionStore.get().setLocales(LocaleUtils.getPreferredLanguageTags(this)); - EngineProvider.INSTANCE.getOrCreateRuntime(this).appendAppNotesToCrashReport("Firefox Reality " + BuildConfig.VERSION_NAME + "-" + BuildConfig.VERSION_CODE + "-" + BuildConfig.FLAVOR + "-" + BuildConfig.BUILD_TYPE + " (" + BuildConfig.GIT_HASH + ")"); - // Create broadcast receiver for getting crash messages from crash process IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(CrashReporterService.CRASH_ACTION); @@ -387,10 +380,10 @@ public void onWindowVideoAvailabilityChanged(@NonNull WindowWidget aWindow) { // Show the what's upp dialog if we haven't showed it yet and this is v6. if (!SettingsStore.getInstance(this).isWhatsNewDisplayed()) { - mWhatsNewWidget = new WhatsNewWidget(this); - mWhatsNewWidget.setLoginOrigin(Accounts.LoginOrigin.NONE); - mWhatsNewWidget.getPlacement().parentHandle = mWindows.getFocusedWindow().getHandle(); - mWhatsNewWidget.show(UIWidget.REQUEST_FOCUS); + final WhatsNewWidget whatsNew = new WhatsNewWidget(this); + whatsNew.setLoginOrigin(Accounts.LoginOrigin.NONE); + whatsNew.getPlacement().parentHandle = mWindows.getFocusedWindow().getHandle(); + whatsNew.show(UIWidget.REQUEST_FOCUS); } } @@ -620,20 +613,6 @@ void loadFromIntent(final Intent intent) { uri = Uri.parse(SettingsStore.getInstance(this).getHomepage()); } } - - if (extras.containsKey("hide_webxr_interstitial")) { - mHideWebXRIntersitial = extras.getBoolean("hide_webxr_interstitial", false); - if (mHideWebXRIntersitial) { - setWebXRIntersitialState(WEBXR_INTERSTITIAL_HIDDEN); - } - } - - if (extras.containsKey("hide_whats_new")) { - boolean hideWhatsNew = extras.getBoolean("hide_whats_new", false); - if (hideWhatsNew && mWhatsNewWidget != null) { - mWhatsNewWidget.hide(REMOVE_WIDGET); - } - } } // If there is a URI we open it @@ -747,7 +726,7 @@ public void onBackPressed() { new String[]{ getString(R.string.exit_confirm_dialog_button_cancel), getString(R.string.exit_confirm_dialog_button_quit), - }, (index, isChecked) -> { + }, index -> { if (index == PromptDialogWidget.POSITIVE) { VRBrowserActivity.super.onBackPressed(); } @@ -1048,7 +1027,7 @@ void onEnterWebXR() { @Keep @SuppressWarnings("unused") - void onExitWebXR(long aCallback) { + void onExitWebXR() { if (Thread.currentThread() == mUiThread) { return; } @@ -1070,9 +1049,6 @@ void onExitWebXR(long aCallback) { if (!mWindows.isPaused()) { Log.d(LOGTAG, "Compositor resume begin"); mWindows.resumeCompositor(); - if (aCallback != 0) { - queueRunnable(() -> runCallbackNative(aCallback)); - } Log.d(LOGTAG, "Compositor resume end"); } }, 20); @@ -1080,19 +1056,12 @@ void onExitWebXR(long aCallback) { @Keep @SuppressWarnings("unused") void onDismissWebXRInterstitial() { - runOnUiThread(() -> { - for (WebXRListener listener: mWebXRListeners) { - listener.onDismissWebXRInterstitial(); - } - }); - } - - @Keep - @SuppressWarnings("unused") - void onWebXRRenderStateChange(boolean aRendering) { - runOnUiThread(() -> { - for (WebXRListener listener: mWebXRListeners) { - listener.onWebXRRenderStateChange(aRendering); + runOnUiThread(new Runnable() { + @Override + public void run() { + for (WebXRListener listener: mWebXRListeners) { + listener.onDismissWebXRInterstitial(); + } } }); } @@ -1165,7 +1134,7 @@ public int getPointerColor() { @Keep @SuppressWarnings("unused") private void setDeviceType(int aType) { - if (DeviceType.isOculusBuild() || DeviceType.isWaveBuild()) { + if (DeviceType.isOculusBuild()) { runOnUiThread(() -> DeviceType.setType(aType)); } } @@ -1178,7 +1147,7 @@ private void haltActivity(final int aReason) { mWindows.getFocusedWindow().showAlert( getString(R.string.not_entitled_title), getString(R.string.not_entitled_message, getString(R.string.app_name)), - (index, isChecked) -> finish()); + index -> finish()); } }); } @@ -1204,10 +1173,7 @@ private void handlePoorPerformance() { } window.getSession().loadHomePage(); final String[] buttons = {getString(R.string.ok_button), getString(R.string.performance_unblock_page)}; - window.showConfirmPrompt(getString(R.string.performance_title), - getString(R.string.performance_message), - buttons, - (index, isChecked) -> { + window.showConfirmPrompt(getString(R.string.performance_title), getString(R.string.performance_message), buttons, index -> { if (index == PromptDialogWidget.NEGATIVE) { mPoorPerformanceWhiteList.add(originalUri); window.getSession().loadUri(originalUri); @@ -1243,12 +1209,6 @@ private void disableLayers() { }); } - @Keep - @SuppressWarnings("unused") - private void appendAppNotesToCrashReport(String aNotes) { - runOnUiThread(() -> EngineProvider.INSTANCE.getOrCreateRuntime(VRBrowserActivity.this).appendAppNotesToCrashReport(aNotes)); - } - private SurfaceTexture createSurfaceTexture() { int[] ids = new int[1]; GLES20.glGenTextures(1, ids, 0); @@ -1485,11 +1445,6 @@ public void setWebXRIntersitialState(@WebXRInterstitialState int aState) { queueRunnable(() -> setWebXRIntersitialStateNative(aState)); } - @Override - public boolean isWebXRIntersitialHidden() { - return mHideWebXRIntersitial; - } - @Override public void addConnectivityListener(Delegate aListener) { if (!mConnectivityListeners.contains(aListener)) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/Accounts.kt b/app/src/common/shared/org/mozilla/vrbrowser/browser/Accounts.kt index 5da8a4894..04d785140 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/Accounts.kt +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/Accounts.kt @@ -296,7 +296,7 @@ class Accounts constructor(val context: Context) { fun pollForEventsAsync(): CompletableFuture? { return CoroutineScope(Dispatchers.Main).future { - services.accountManager.authenticatedAccount()?.deviceConstellation()?.pollForCommandsAsync()?.await() + services.accountManager.authenticatedAccount()?.deviceConstellation()?.pollForEventsAsync()?.await() } } @@ -368,8 +368,8 @@ class Accounts constructor(val context: Context) { } targets?.forEach { it -> - constellation.sendCommandToDeviceAsync( - it.id, DeviceCommandOutgoing.SendTab(title, url) + constellation.sendEventToDeviceAsync( + it.id, DeviceEventOutgoing.SendTab(title, url) ).await().also { if (it) GleanMetricsService.FxA.sentTab() } } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/BookmarksStore.kt b/app/src/common/shared/org/mozilla/vrbrowser/browser/BookmarksStore.kt index 9282f534d..3dbc88dfe 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/BookmarksStore.kt +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/BookmarksStore.kt @@ -83,7 +83,7 @@ class BookmarksStore constructor(val context: Context) { } // Update the folder strings after a language update - fun onConfigurationChanged() { + fun onConfigurationChanged(newConfig: Configuration) { titles = rootTitles(context) } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/PermissionDelegate.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/PermissionDelegate.java index 0d038ebe7..1539230cf 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/PermissionDelegate.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/PermissionDelegate.java @@ -163,12 +163,7 @@ public void onContentPermissionRequest(GeckoSession aSession, String aUri, int a return; } - if (aType == PERMISSION_AUTOPLAY_INAUDIBLE) { - // https://hacks.mozilla.org/2019/02/firefox-66-to-block-automatically-playing-audible-video-and-audio/ - callback.grant(); - return; - - } else if(aType == PERMISSION_AUTOPLAY_AUDIBLE) { + if (aType == PERMISSION_AUTOPLAY_AUDIBLE || aType == PERMISSION_AUTOPLAY_INAUDIBLE) { if (SettingsStore.getInstance(mContext).isAutoplayEnabled()) { callback.grant(); } else { @@ -299,13 +294,14 @@ public void reject() { } } } - public void addPermissionException(@NonNull String uri, @SitePermission.Category int category) { + + public void addPermissionException(String uri, @SitePermission.Category int category) { @Nullable SitePermission site = mSitePermissions.stream() .filter((item) -> item.category == category && item.url.equals(uri)) .findFirst().orElse(null); if (site == null) { - site = new SitePermission(uri, "", category); + site = new SitePermission(uri, uri, category); mSitePermissions.add(site); } mSitePermissionModel.insertSite(site); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/Places.kt b/app/src/common/shared/org/mozilla/vrbrowser/browser/Places.kt index d622f3138..7b00a9779 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/Places.kt +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/Places.kt @@ -23,7 +23,7 @@ class Places(var context: Context) { var history = PlacesHistoryStorage(context) fun clear() { - val files = context.filesDir.listFiles { _, name -> + val files = context.filesDir.listFiles { dir, name -> name.matches("places\\.sqlite.*".toRegex()) } for (file in files) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java index 78fd34159..bf4d33c4b 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java @@ -249,13 +249,18 @@ public GeckoResult onPopupPrompt(@NonNull GeckoSession geckoSess Session session = mAttachedWindow.getSession(); if (session != null) { final String uri = UrlUtils.getHost(session.getCurrentUri()); - SitePermission site = mAllowedPopUpSites.stream().filter((item) -> UrlUtils.getHost(item.url).equals(uri)).findFirst().orElse(null); + SitePermission site = mAllowedPopUpSites.stream().filter((item) -> item.url.equals(uri)).findFirst().orElse(null); if (site != null) { - result.complete(popupPrompt.confirm(AllowOrDeny.ALLOW)); - session.setPopUpState(SessionState.POPUP_ALLOWED); + mAttachedWindow.postDelayed(() -> { + result.complete(popupPrompt.confirm(AllowOrDeny.ALLOW)); + session.setPopUpState(SessionState.POPUP_ALLOWED); + }, 500); + } else { - result.complete(popupPrompt.confirm(AllowOrDeny.DENY)); - session.setPopUpState(SessionState.POPUP_BLOCKED); + mAttachedWindow.postDelayed(() -> { + result.complete(popupPrompt.confirm(AllowOrDeny.DENY)); + session.setPopUpState(SessionState.POPUP_BLOCKED); + }, 500); } } else { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/Services.kt b/app/src/common/shared/org/mozilla/vrbrowser/browser/Services.kt index 48013ee63..df4619c76 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/Services.kt +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/Services.kt @@ -61,8 +61,8 @@ class Services(val context: Context, places: Places): GeckoSession.NavigationDel // Make sure we get logs out of our android-components. Log.addSink(AndroidLogSink()) - GlobalSyncableStoreProvider.configureStore(SyncEngine.Bookmarks to lazy {places.bookmarks}) - GlobalSyncableStoreProvider.configureStore(SyncEngine.History to lazy {places.history}) + GlobalSyncableStoreProvider.configureStore(SyncEngine.Bookmarks to places.bookmarks) + GlobalSyncableStoreProvider.configureStore(SyncEngine.History to places.history) // TODO this really shouldn't be necessary, since WorkManager auto-initializes itself, unless // auto-initialization is disabled in the manifest file. We don't disable the initialization, @@ -81,26 +81,26 @@ class Services(val context: Context, places: Places): GeckoSession.NavigationDel // Process received device events, only handling received tabs for now. // They'll come from other FxA devices (e.g. Firefox Desktop). - private val deviceEventObserver = object : AccountEventsObserver { + private val deviceEventObserver = object : DeviceEventsObserver { private val logTag = "DeviceEventsObserver" - override fun onEvents(events: List) { + override fun onEvents(events: List) { CoroutineScope(Dispatchers.Main).launch { Logger(logTag).info("Received ${events.size} device event(s)") - events - .filterIsInstance() - .map { it.command } - .filterIsInstance() - .forEach { command -> - command.from?.deviceType?.let { GleanMetricsService.FxA.receivedTab(it) } - tabReceivedDelegate?.onTabsReceived(command.entries) - } + val filteredEvents = events.filterIsInstance(DeviceEvent.TabReceived::class.java) + if (filteredEvents.isNotEmpty()) { + filteredEvents.map { event -> event.from?.deviceType?.let { GleanMetricsService.FxA.receivedTab(it) } } + val tabs = filteredEvents.map { + event -> event.entries + }.flatten() + tabReceivedDelegate?.onTabsReceived(tabs) + } } } } val accountManager = FxaAccountManager( context = context, - serverConfig = ServerConfig(Server.RELEASE, CLIENT_ID, REDIRECT_URL), + serverConfig = ServerConfig.release(CLIENT_ID, REDIRECT_URL), deviceConfig = DeviceConfig( // This is a default name, and can be changed once user is logged in. // E.g. accountManager.authenticatedAccount()?.deviceConstellation()?.setDeviceNameAsync("new name") @@ -111,7 +111,7 @@ class Services(val context: Context, places: Places): GeckoSession.NavigationDel syncConfig = SyncConfig(setOf(SyncEngine.History, SyncEngine.Bookmarks), syncPeriodInMinutes = 1440L) ).also { - it.registerForAccountEvents(deviceEventObserver, ProcessLifecycleOwner.get(), true) + it.registerForDeviceEvents(deviceEventObserver, ProcessLifecycleOwner.get(), true) } init { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java index de61fae3c..bc30b4a19 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java @@ -84,7 +84,7 @@ SettingsStore getInstance(final @NonNull Context aContext) { public final static int POINTER_COLOR_DEFAULT_DEFAULT = Color.parseColor("#FFFFFF"); public final static int SCROLL_DIRECTION_DEFAULT = 0; public final static String ENV_DEFAULT = "offworld"; - public final static int MSAA_DEFAULT_LEVEL = 0; + public final static int MSAA_DEFAULT_LEVEL = 1; public final static boolean AUDIO_ENABLED = false; public final static float CYLINDER_DENSITY_ENABLED_DEFAULT = 4680.0f; private final static long CRASH_RESTART_DELTA = 2000; @@ -101,7 +101,7 @@ SettingsStore getInstance(final @NonNull Context aContext) { public final static boolean BYPASS_CACHE_ON_RELOAD = false; public final static boolean MULTI_E10S = false; public final static int DOWNLOADS_STORAGE_DEFAULT = INTERNAL; - public final static int DOWNLOADS_SORTING_ORDER_DEFAULT = SortingContextMenuWidget.SORT_DATE_ASC; + public final static int DOWNLOADS_SORTING_ORDER_DEFAULT = SortingContextMenuWidget.SORT_FILENAME_AZ; // Enable telemetry by default (opt-out). public final static boolean CRASH_REPORTING_DEFAULT = false; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java index b305fa110..c39497685 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java @@ -4,6 +4,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; +import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -11,6 +12,8 @@ import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.Observer; +import androidx.recyclerview.widget.DiffUtil; +import androidx.recyclerview.widget.ListUpdateCallback; import org.json.JSONException; import org.json.JSONObject; @@ -24,19 +27,18 @@ import org.mozilla.vrbrowser.browser.engine.Session; import org.mozilla.vrbrowser.db.SitePermission; import org.mozilla.vrbrowser.ui.viewmodel.SitePermissionViewModel; +import org.mozilla.vrbrowser.utils.UrlUtils; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.function.Function; -import java.util.stream.Collectors; - -import static org.mozilla.vrbrowser.db.SitePermission.SITE_PERMISSION_TRACKING; public class TrackingProtectionStore implements DefaultLifecycleObserver, - SharedPreferences.OnSharedPreferenceChangeListener { + SharedPreferences.OnSharedPreferenceChangeListener, ListUpdateCallback { public interface TrackingProtectionListener { - default void onExcludedTrackingProtectionChange(@NonNull String url, boolean excluded, boolean isPrivate) {}; + default void onExcludedTrackingProtectionChange(@NonNull String uri, boolean excluded) {}; default void onTrackingProtectionLevelUpdated(int level) {}; } @@ -54,8 +56,8 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin private SitePermissionViewModel mViewModel; private List mListeners; private SharedPreferences mPrefs; + private List mCurrentSitePermissions; private List mSitePermissions; - private boolean mIsFirstUpdate; public TrackingProtectionStore(@NonNull Context context, @NonNull GeckoRuntime runtime) { @@ -63,8 +65,8 @@ public TrackingProtectionStore(@NonNull Context context, mRuntime = runtime; mContentBlockingController = mRuntime.getContentBlockingController(); mListeners = new ArrayList<>(); + mCurrentSitePermissions = new ArrayList<>(); mSitePermissions = new ArrayList<>(); - mIsFirstUpdate = true; mLifeCycle = ((VRBrowserActivity) context).getLifecycle(); mLifeCycle.addObserver(this); @@ -95,24 +97,100 @@ public void onStop(@NonNull LifecycleOwner owner) { mViewModel.getAll(SitePermission.SITE_PERMISSION_TRACKING).removeObserver(mSitePermissionObserver); } - private Observer> mSitePermissionObserver = new Observer>() { - @Override - public void onChanged(List sitePermissions) { - if (sitePermissions != null) { - mSitePermissions = sitePermissions; - - // Restore the site list on the permissions storage notification - if (mIsFirstUpdate) { - List exceptions = sitePermissions - .stream() - .map(TrackingProtectionStore::toContentBlockingException) - .collect(Collectors.toList()); - mContentBlockingController.restoreExceptionList(exceptions); - mIsFirstUpdate = false; - } + private Observer> mSitePermissionObserver = this::notifyDiff; + + @Override + public void onInserted(int position, int count) { + if (mSitePermissions == null) { + return; + } + + for (int i=0; i listener.onExcludedTrackingProtectionChange( + UrlUtils.getHost(exception.uri), + true)); + } + } + + final List exceptionsList = new ArrayList<>(); + mContentBlockingController.clearExceptionList(); + for (SitePermission permission: mSitePermissions) { + ContentBlockingException exception = toContentBlockingException(permission); + if (exception != null) { + exceptionsList.add(exception); } } - }; + mContentBlockingController.restoreExceptionList(exceptionsList); + } + + @Override + public void onRemoved(int position, int count) { + if (mCurrentSitePermissions == null) { + return; + } + + for (int i=0; i listener.onExcludedTrackingProtectionChange( + UrlUtils.getHost(exception.uri), + false)); + } + } + } + + @Override + public void onMoved(int fromPosition, int toPosition) { + // We never move from the exceptions list + } + + @Override + public void onChanged(int position, int count, @Nullable Object payload) { + // We never update from the exceptions list + } + + private void notifyDiff(List newList) { + if (newList == null) { + return; + } + + DiffUtil.DiffResult result = DiffUtil.calculateDiff(new DiffUtil.Callback() { + @Override + public int getOldListSize() { + return mSitePermissions.size(); + } + + @Override + public int getNewListSize() { + return newList.size(); + } + + @Override + public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { + return mSitePermissions.get(oldItemPosition).url.equals(newList.get(newItemPosition).url) && + mSitePermissions.get(oldItemPosition).principal.equals(newList.get(newItemPosition).principal) && + mSitePermissions.get(oldItemPosition).category == newList.get(newItemPosition).category; + } + + @Override + public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { + SitePermission newSite = newList.get(newItemPosition); + SitePermission olSite = mSitePermissions.get(oldItemPosition); + return newSite.url.equals(olSite.url) + && Objects.equals(newSite.category, olSite.category) + && Objects.equals(newSite.principal, olSite.principal); + } + }); + + mCurrentSitePermissions = mSitePermissions; + mSitePermissions = newList; + result.dispatchUpdatesTo(this); + } @Override public void onDestroy(@NonNull LifecycleOwner owner) { @@ -149,56 +227,46 @@ public void fetchAll(Function, Void> onResult) { public void add(@NonNull Session session) { mContentBlockingController.addException(session.getGeckoSession()); mListeners.forEach(listener -> listener.onExcludedTrackingProtectionChange( - session.getCurrentUri(), - true, - session.isPrivateMode())); - saveExceptions(); + UrlUtils.getHost(session.getCurrentUri()), + true)); + persist(); } public void remove(@NonNull Session session) { mContentBlockingController.removeException(session.getGeckoSession()); mListeners.forEach(listener -> listener.onExcludedTrackingProtectionChange( - session.getCurrentUri(), - false, - session.isPrivateMode())); - saveExceptions(); + UrlUtils.getHost(session.getCurrentUri()), + false)); + persist(); } public void remove(@NonNull SitePermission permission) { ContentBlockingException exception = toContentBlockingException(permission); if (exception != null) { mContentBlockingController.removeException(exception); + persist(); } - mListeners.forEach(listener -> listener.onExcludedTrackingProtectionChange( - permission.url, - false, - false)); - saveExceptions(); } - public void removeAll() { - // We can't use clearExceptionList as that clears also the private browsing exceptions - mSitePermissions.forEach(permission -> { - ContentBlockingException exception = toContentBlockingException(permission); - if (exception != null) { - mContentBlockingController.removeException(exception); - } - mListeners.forEach(listener -> listener.onExcludedTrackingProtectionChange( - permission.url, - false, - false)); - }); - saveExceptions(); + public void removeAll(@NonNull List activeSessions) { + mContentBlockingController.clearExceptionList(); + activeSessions.forEach(session -> + mListeners.forEach(listener -> + listener.onExcludedTrackingProtectionChange( + UrlUtils.getHost(session.getCurrentUri()), + false))); + persist(); } - private void saveExceptions() { + private void persist() { + mViewModel.deleteAll(SitePermission.SITE_PERMISSION_TRACKING); mRuntime.getContentBlockingController().saveExceptionList().accept(contentBlockingExceptions -> { - mViewModel.deleteAll(SITE_PERMISSION_TRACKING); - if (contentBlockingExceptions != null) { + if (contentBlockingExceptions != null && !contentBlockingExceptions.isEmpty()) { contentBlockingExceptions.forEach(exception -> { - SitePermission permission = toSitePermission(exception); - if (permission != null) { - mViewModel.insertSite(permission); + Log.d("TrackingProtectionStore", "Excluded site: " + exception.uri); + SitePermission site = toSitePermission(exception); + if (site != null) { + mViewModel.insertSite(site); } }); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/EngineProvider.kt b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/EngineProvider.kt index a646e6c7b..f43acc0d7 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/EngineProvider.kt +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/EngineProvider.kt @@ -38,8 +38,6 @@ object EngineProvider { builder.screenSizeOverride(SettingsStore.getInstance(context).maxWindowWidth, SettingsStore.getInstance(context).maxWindowHeight) builder.useMultiprocess(true) - builder.inputAutoZoomEnabled(false) - builder.doubleTapZoomingEnabled(false) if (SettingsStore.getInstance(context).transparentBorderWidth > 0) { builder.useMaxScreenDepth(true) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java index f234ff47d..be1284e14 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java @@ -121,7 +121,7 @@ protected Session(Context aContext, GeckoRuntime aRuntime, mRuntime = aRuntime; initialize(); mState = createSession(aSettings, aOpenMode); - mState.setActive(aOpenMode == SESSION_OPEN); + mState.setActive(true); } protected Session(Context aContext, GeckoRuntime aRuntime, @NonNull SessionState aRestoreState) { @@ -286,7 +286,7 @@ public void setHistoryDelegate(GeckoSession.HistoryDelegate aDelegate) { } public void addNavigationListener(GeckoSession.NavigationDelegate aListener) { - mNavigationListeners.addIfAbsent(aListener); + mNavigationListeners.add(aListener); dumpState(aListener); } @@ -295,7 +295,7 @@ public void removeNavigationListener(GeckoSession.NavigationDelegate aListener) } public void addProgressListener(GeckoSession.ProgressDelegate aListener) { - mProgressListeners.addIfAbsent(aListener); + mProgressListeners.add(aListener); dumpState(aListener); } @@ -304,7 +304,7 @@ public void removeProgressListener(GeckoSession.ProgressDelegate aListener) { } public void addContentListener(GeckoSession.ContentDelegate aListener) { - mContentListeners.addIfAbsent(aListener); + mContentListeners.add(aListener); dumpState(aListener); } @@ -313,7 +313,7 @@ public void removeContentListener(GeckoSession.ContentDelegate aListener) { } public void addSessionChangeListener(SessionChangeListener aListener) { - mSessionChangeListeners.addIfAbsent(aListener); + mSessionChangeListeners.add(aListener); } public void removeSessionChangeListener(SessionChangeListener aListener) { @@ -321,7 +321,7 @@ public void removeSessionChangeListener(SessionChangeListener aListener) { } public void addTextInputListener(GeckoSession.TextInputDelegate aListener) { - mTextInputListeners.addIfAbsent(aListener); + mTextInputListeners.add(aListener); } public void removeTextInputListener(GeckoSession.TextInputDelegate aListener) { @@ -329,7 +329,7 @@ public void removeTextInputListener(GeckoSession.TextInputDelegate aListener) { } public void addVideoAvailabilityListener(VideoAvailabilityListener aListener) { - mVideoAvailabilityListeners.addIfAbsent(aListener); + mVideoAvailabilityListeners.add(aListener); dumpState(aListener); } @@ -338,7 +338,7 @@ public void removeVideoAvailabilityListener(VideoAvailabilityListener aListener) } public void addSelectionActionListener(GeckoSession.SelectionActionDelegate aListener) { - mSelectionActionListeners.addIfAbsent(aListener); + mSelectionActionListeners.add(aListener); } public void removeSelectionActionListener(GeckoSession.ContentDelegate aListener) { @@ -346,7 +346,7 @@ public void removeSelectionActionListener(GeckoSession.ContentDelegate aListener } public void addBitmapChangedListener(BitmapChangedListener aListener) { - mBitmapChangedListeners.addIfAbsent(aListener); + mBitmapChangedListeners.add(aListener); } public void removeBitmapChangedListener(BitmapChangedListener aListener) { @@ -354,7 +354,7 @@ public void removeBitmapChangedListener(BitmapChangedListener aListener) { } public void addWebXRStateChangedListener(WebXRStateChangedListener aListener) { - mWebXRStateListeners.addIfAbsent(aListener); + mWebXRStateListeners.add(aListener); dumpState(aListener); } @@ -363,7 +363,7 @@ public void removeWebXRStateChangedListener(WebXRStateChangedListener aListener) } public void addPopUpStateChangedListener(PopUpStateChangedListener aListener) { - mPopUpStateStateListeners.addIfAbsent(aListener); + mPopUpStateStateListeners.add(aListener); dumpState(aListener); } @@ -372,7 +372,7 @@ public void removePopUpStateChangedListener(PopUpStateChangedListener aListener) } public void addDrmStateChangedListener(DrmStateChangedListener aListener) { - mDrmStateStateListeners.addIfAbsent(aListener); + mDrmStateStateListeners.add(aListener); dumpState(aListener); } @@ -408,16 +408,6 @@ private void cleanSessionListeners(GeckoSession aSession) { aSession.setContentBlockingDelegate(null); } - public void updateTrackingProtection() { - if ((mState != null) && (mState.mSettings != null)) { - TrackingProtectionPolicy policy = TrackingProtectionStore.getTrackingProtectionPolicy(mContext); - mState.mSettings.setTrackingProtectionEnabled(mState.mSettings.isPrivateBrowsingEnabled() || policy.shouldBlockContent()); - if (mState.mSession != null) { - mState.mSession.getSettings().setUseTrackingProtection(mState.mSettings.isTrackingProtectionEnabled()); - } - } - } - public void suspend() { if (mState.isActive()) { Log.e(LOGTAG, "Active Sessions can not be suspended"); @@ -460,8 +450,6 @@ private void restore() { settings = new SessionSettings.Builder() .withDefaultSettings(mContext) .build(); - } else { - updateTrackingProtection(); } mState.mSession = createGeckoSession(settings); @@ -533,6 +521,9 @@ public void recreateSession() { SessionState previous = mState; mState = mState.recreate(); + TrackingProtectionPolicy policy = TrackingProtectionStore.getTrackingProtectionPolicy(mContext); + mState.mSettings.setTrackingProtectionEnabled(policy.shouldBlockContent()); + restore(); GeckoSession previousGeckoSession = null; @@ -767,19 +758,15 @@ public void goForward() { } public void setActive(boolean aActive) { - if (!aActive && mState.mSession != null && !mState.isActive()) { - // Prevent duplicated setActive(false) calls. There is a GV - // bug that makes the session not to be resumed correctly. - // See https://github.com/MozillaReality/FirefoxReality/issues/3375. - return; - } // Flush the events queued while the session was inactive if (mState.mSession != null && !mState.isActive() && aActive) { flushQueuedEvents(); } if (mState.mSession != null) { - mState.mSession.setActive(aActive); + if (mState.isActive() != aActive) { + mState.mSession.setActive(aActive); + } mState.setActive(aActive); } else if (aActive) { restore(); @@ -1693,20 +1680,4 @@ public void surfaceChanged(@NonNull final Surface surface, final int left, final } mState.mDisplay.surfaceChanged(surface, left, top, width, height); } - - public void logState() { - if (mState == null) { - Log.d(LOGTAG, "Session state is null"); - return; - } - Log.d(LOGTAG, "Session: " + (mState.mSession != null ? mState.mSession.hashCode() : "null")); - Log.d(LOGTAG, "\tActive: " + mState.isActive()); - Log.d(LOGTAG, "\tUri: " + (mState.mUri != null ? mState.mUri : "null")); - Log.d(LOGTAG, "\tFullscreen: " + mState.mFullScreen); - Log.d(LOGTAG, "\tCan go back: " + mState.mCanGoBack); - Log.d(LOGTAG, "\tCan go forward: " + mState.mCanGoForward); - if (mState.mSettings != null) { - Log.d(LOGTAG, "\tPrivate Browsing: " + mState.mSettings.isPrivateBrowsingEnabled()); - } - } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java index 96cc355fc..744fcb84d 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionSettings.java @@ -89,13 +89,11 @@ public Builder() { public Builder withPrivateBrowsing(boolean enabled) { isPrivateBrowsingEnabled = enabled; - isTrackingProtectionEnabled = isPrivateBrowsingEnabled || isTrackingProtectionEnabled; - return this; } public Builder withTrackingProtection(boolean isTrackingProtectionEnabled){ - this.isTrackingProtectionEnabled = isPrivateBrowsingEnabled || isTrackingProtectionEnabled; + this.isTrackingProtectionEnabled = isTrackingProtectionEnabled; return this; } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionStore.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionStore.java index b67eecdab..eeee545c7 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionStore.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionStore.java @@ -24,7 +24,6 @@ import java.util.LinkedList; import java.util.List; import java.util.concurrent.Executor; -import java.util.stream.Collectors; public class SessionStore implements GeckoSession.PermissionDelegate{ private static final String LOGTAG = SystemUtils.createLogtag(SessionStore.class); @@ -67,26 +66,18 @@ public void setContext(Context context, Bundle aExtras) { mTrackingProtectionStore = new TrackingProtectionStore(context, mRuntime); mTrackingProtectionStore.addListener(new TrackingProtectionStore.TrackingProtectionListener() { @Override - public void onExcludedTrackingProtectionChange(@NonNull String url, boolean excluded, boolean isPrivate) { + public void onExcludedTrackingProtectionChange(@NonNull String host, boolean excluded) { mSessions.forEach(existingSession -> { - String currentSessionHost = UrlUtils.getHost(existingSession.getCurrentUri()); - String sessionHost = UrlUtils.getHost(url); - if (currentSessionHost.equals(sessionHost) && existingSession.isPrivateMode() == isPrivate) { - existingSession.reload(GeckoSession.LOAD_FLAGS_BYPASS_CACHE); + String existingHost = UrlUtils.getHost(existingSession.getCurrentUri()); + if (existingHost.equals(host)) { + existingSession.recreateSession(); } }); } @Override public void onTrackingProtectionLevelUpdated(int level) { - mSessions.forEach(session -> { - if (session.isActive()) { - session.updateTrackingProtection(); - session.reload(GeckoSession.LOAD_FLAGS_BYPASS_CACHE); - } else { - session.suspend(); - } - }); + mSessions.forEach(Session::recreateSession); } }); } @@ -173,13 +164,6 @@ public void suspendAllInactiveSessions() { return mSessions.stream().filter(session -> session.getGeckoSession() == aGeckoSession).findFirst().orElse(null); } - public @NonNull List getSessionsByHost(@NonNull String aHost, boolean aIsPrivate) { - return mSessions.stream() - .filter(session -> session.isPrivateMode() == aIsPrivate) - .filter(session -> UrlUtils.getHost(session.getCurrentUri()).equals(aHost)) - .collect(Collectors.toList()); - } - public void setActiveSession(Session aSession) { if (aSession != null) { aSession.setActive(true); @@ -278,7 +262,7 @@ public void onConfigurationChanged(Configuration newConfig) { mRuntime.configurationChanged(newConfig); } - mBookmarksStore.onConfigurationChanged(); + mBookmarksStore.onConfigurationChanged(newConfig); } // Session Settings @@ -348,13 +332,13 @@ public void onMediaPermissionRequest(@NonNull GeckoSession session, @NonNull Str } } - public void addPermissionException(@NonNull String uri, @SitePermission.Category int category) { + public void addPermissionException(String uri, @SitePermission.Category int category) { if (mPermissionDelegate != null) { mPermissionDelegate.addPermissionException(uri, category); } } - public void removePermissionException(@NonNull String uri, @SitePermission.Category int category) { + public void removePermissionException(String uri, @SitePermission.Category int category) { if (mPermissionDelegate != null) { mPermissionDelegate.removePermissionException(uri, category); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java index bcdc9fdee..d9913d941 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/SessionUtils.java @@ -30,38 +30,36 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) { String prefFileName = path.getAbsolutePath() + File.separator + "user.js"; Log.i(LOGTAG, "Creating file: " + prefFileName); try (FileOutputStream out = new FileOutputStream(prefFileName)) { - out.write("user_pref(\"dom.vr.enabled\", true);\n".getBytes()); - out.write("user_pref(\"dom.vr.external.enabled\", true);\n".getBytes()); - out.write("user_pref(\"dom.vr.webxr.enabled\", true);\n".getBytes()); - out.write("user_pref(\"webgl.enable-surface-texture\", true);\n".getBytes()); + out.write("pref(\"dom.vr.enabled\", true);\n".getBytes()); + out.write("pref(\"dom.vr.external.enabled\", true);\n".getBytes()); + out.write("pref(\"webgl.enable-surface-texture\", true);\n".getBytes()); // Enable MultiView draft extension - out.write("user_pref(\"webgl.enable-draft-extensions\", true);\n".getBytes()); - out.write("user_pref(\"dom.webcomponents.customelements.enabled\", true);\n".getBytes()); - out.write("user_pref(\"javascript.options.ion\", true);\n".getBytes()); - out.write("user_pref(\"media.webspeech.synth.enabled\", false);\n".getBytes()); + out.write("pref(\"webgl.enable-draft-extensions\", true);\n".getBytes()); + out.write("pref(\"apz.allow_double_tap_zooming\", false);\n".getBytes()); + out.write("pref(\"dom.webcomponents.customelements.enabled\", true);\n".getBytes()); + out.write("pref(\"javascript.options.ion\", true);\n".getBytes()); + out.write("pref(\"media.webspeech.synth.enabled\", false);\n".getBytes()); + // Prevent autozoom when giving a form field focus. + out.write("pref(\"formhelper.autozoom\", false);\n".getBytes()); // Disable WebRender until it works with FxR - out.write("user_pref(\"gfx.webrender.force-disabled\", true);\n".getBytes()); - // Disable web extension process until it is able to restart. - out.write("user_pref(\"extensions.webextensions.remote\", false);\n".getBytes()); + out.write("pref(\"gfx.webrender.force-disabled\", true);\n".getBytes()); + out.write("pref(\"signon.rememberSignons\", false);\n".getBytes()); + if (BuildConfig.DEBUG) { + int processCount = SettingsStore.getInstance(aContext).isMultiE10s() ? 3 : 1; + out.write(("pref(\"dom.ipc.processCount\", " + processCount + ");\n").getBytes()); + } int msaa = SettingsStore.getInstance(aContext).getMSAALevel(); if (msaa > 0) { int msaaLevel = msaa == 2 ? 4 : 2; - out.write(("user_pref(\"webgl.msaa-samples\"," + msaaLevel + ");\n").getBytes()); - out.write("user_pref(\"webgl.msaa-force\", true);\n".getBytes()); - } else { - out.write("user_pref(\"webgl.msaa-force\", false);\n".getBytes()); + out.write(("pref(\"gl.msaa-level\"," + msaaLevel + ");\n").getBytes()); } - if (BuildConfig.DEBUG) { - int processCount = SettingsStore.getInstance(aContext).isMultiE10s() ? 3 : 1; - out.write(("user_pref(\"dom.ipc.processCount\", " + processCount + ");\n").getBytes()); - addOptionalPref(out, "dom.vr.require-gesture", aExtras); - addOptionalPref(out, "privacy.reduceTimerPrecision", aExtras); - if (aExtras != null && aExtras.getBoolean("media.autoplay.enabled", false)) { - // Enable playing audios without gesture (used for gfx automated testing) - out.write("user_pref(\"media.autoplay.enabled.user-gestures-needed\", false);\n".getBytes()); - out.write("user_pref(\"media.autoplay.enabled.ask-permission\", false);\n".getBytes()); - out.write("user_pref(\"media.autoplay.default\", 0);\n".getBytes()); - } + addOptionalPref(out, "dom.vr.require-gesture", aExtras); + addOptionalPref(out, "privacy.reduceTimerPrecision", aExtras); + if (aExtras != null && aExtras.getBoolean("media.autoplay.enabled", false)) { + // Enable playing audios without gesture (used for gfx automated testing) + out.write("pref(\"media.autoplay.enabled.user-gestures-needed\", false);\n".getBytes()); + out.write("pref(\"media.autoplay.enabled.ask-permission\", false);\n".getBytes()); + out.write("pref(\"media.autoplay.default\", 0);\n".getBytes()); } } catch (FileNotFoundException e) { Log.e(LOGTAG, "Unable to create file: '" + prefFileName + "' got exception: " + e.toString()); @@ -73,7 +71,7 @@ public static void vrPrefsWorkAround(Context aContext, Bundle aExtras) { private static void addOptionalPref(FileOutputStream out, String aKey, Bundle aExtras) throws IOException { if (aExtras != null && aExtras.containsKey(aKey)) { boolean value = aExtras.getBoolean(aKey); - out.write(String.format("user_pref(\"%s\", %s);\n", aKey, value ? "true" : "false").getBytes()); + out.write(String.format("pref(\"%s\", %s);\n", aKey, value ? "true" : "false").getBytes()); } } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java b/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java index bd1d5c99a..d7a071129 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/db/AppDatabase.java @@ -13,7 +13,7 @@ import org.mozilla.vrbrowser.AppExecutors; -@Database(entities = {SitePermission.class}, version = 4) +@Database(entities = {SitePermission.class}, version = 3) public abstract class AppDatabase extends RoomDatabase { private static final String DATABASE_NAME = "app"; @@ -38,7 +38,7 @@ public static AppDatabase getAppDatabase(Context context, final AppExecutors exe @NonNull private static AppDatabase buildDatabase(final @NonNull Context appContext, final @NonNull AppExecutors executors) { return Room.databaseBuilder(appContext, AppDatabase.class, DATABASE_NAME) - .addMigrations(MIGRATION_1_2, MIGRATION_2_4) + .addMigrations(MIGRATION_1_2) .addCallback(new Callback() { @Override public void onCreate(@NonNull SupportSQLiteDatabase db) { @@ -87,11 +87,19 @@ public void migrate(SupportSQLiteDatabase database) { } }; - // Note: We skip version 3 as a workaround to fix a crash between v10 releases - private static final Migration MIGRATION_2_4 = new Migration(2, 4) { + private static final Migration MIGRATION_1_3 = new Migration(1, 3) { @Override public void migrate(SupportSQLiteDatabase database) { - database.execSQL("ALTER TABLE SitePermission ADD COLUMN principal TEXT NOT NULL DEFAULT ''"); + database.execSQL("ALTER TABLE PopUpSite RENAME TO SitePermission"); + database.execSQL("ALTER TABLE SitePermission ADD COLUMN category INTEGER NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE SitePermission ADD COLUMN principal STRING NOT NULL DEFAULT ''"); + } + }; + + private static final Migration MIGRATION_2_3 = new Migration(2, 3) { + @Override + public void migrate(SupportSQLiteDatabase database) { + database.execSQL("ALTER TABLE SitePermission ADD COLUMN principal STRING NOT NULL DEFAULT ''"); } }; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/db/DataRepository.java b/app/src/common/shared/org/mozilla/vrbrowser/db/DataRepository.java index aca8d72a2..a05d21033 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/db/DataRepository.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/db/DataRepository.java @@ -72,10 +72,6 @@ public void deleteSitePermission(final @NonNull SitePermission site) { mExecutors.diskIO().execute(() -> mDatabase.sitePermissionDao().delete(site)); } - public void deleteSites(final @NonNull List sites) { - mExecutors.diskIO().execute(() -> mDatabase.sitePermissionDao().delete(sites)); - } - public void deleteAllSitePermission(@SitePermission.Category int category) { mExecutors.diskIO().execute(() -> mDatabase.sitePermissionDao().deleteAll(category)); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermission.java b/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermission.java index 4d44b17e0..c0c900e23 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermission.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermission.java @@ -20,7 +20,6 @@ public SitePermission(@NonNull String url, @NonNull String principal, @Category this.url = url; this.principal = principal; this.category = category; - this.allowed = false; } @PrimaryKey(autoGenerate = true) @@ -30,12 +29,9 @@ public SitePermission(@NonNull String url, @NonNull String principal, @Category public String url; @NonNull - @ColumnInfo(name = "principal", defaultValue = "") + @ColumnInfo(name = "principal") public String principal; - @ColumnInfo(name = "allowed") - public boolean allowed; - @ColumnInfo(name = "category") public @Category int category; } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermissionDao.java b/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermissionDao.java index 070232624..f160c7621 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermissionDao.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/db/SitePermissionDao.java @@ -23,9 +23,6 @@ public interface SitePermissionDao { @Delete void delete(SitePermission site); - @Delete - void delete(List sites); - @Query("DELETE FROM SitePermission WHERE url = :url AND category = :category") void deleteByUrl(String url, @SitePermission.Category int category); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/downloads/DownloadsManager.java b/app/src/common/shared/org/mozilla/vrbrowser/downloads/DownloadsManager.java index 0203f3206..636dc3442 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/downloads/DownloadsManager.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/downloads/DownloadsManager.java @@ -10,7 +10,6 @@ import android.os.Environment; import android.os.Handler; import android.os.Looper; -import android.util.Log; import android.webkit.URLUtil; import androidx.annotation.NonNull; @@ -22,7 +21,6 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -43,7 +41,6 @@ default void onDownloadError(@NonNull String error, @NonNull String file) {} private List mListeners; private DownloadManager mDownloadManager; private ScheduledThreadPoolExecutor mExecutor; - private ScheduledFuture mFuture; public DownloadsManager(@NonNull Context context) { mMainHandler = new Handler(Looper.getMainLooper()); @@ -70,29 +67,14 @@ public void end() { public void addListener(@NonNull DownloadsListener listener) { mListeners.add(listener); if (mListeners.size() == 1) { - scheduleUpdates(); + mExecutor.scheduleAtFixedRate(mDownloadUpdateTask, 0, REFRESH_INTERVAL, TimeUnit.MILLISECONDS); } } public void removeListener(@NonNull DownloadsListener listener) { mListeners.remove(listener); if (mListeners.size() == 0) { - stopUpdates(); - } - } - - private void scheduleUpdates() { - if (mFuture != null) { - // Already scheduled - return; - } - mFuture = mExecutor.scheduleAtFixedRate(mDownloadUpdateTask, 0, REFRESH_INTERVAL, TimeUnit.MILLISECONDS); - } - - private void stopUpdates() { - if (mFuture != null) { - mFuture.cancel(true); - mFuture = null; + mExecutor.remove(mDownloadUpdateTask); } } @@ -122,7 +104,6 @@ public void startDownload(@NonNull DownloadJob job) { } mDownloadManager.enqueue(request); - scheduleUpdates(); } @Nullable @@ -136,30 +117,37 @@ private String getOutputPathForJob(@NonNull DownloadJob job) { return null; } - public void removeDownload(long downloadId, boolean deleteFiles) { + public void removeDownload(long downloadId) { + mDownloadManager.remove(downloadId); + notifyDownloadsUpdate(); + } + + public void removeAllDownloads() { + if (getDownloads().size() > 0) { + mDownloadManager.remove(getDownloads().stream().mapToLong(Download::getId).toArray()); + notifyDownloadsUpdate(); + } + } + + public void clearDownload(long downloadId) { Download download = getDownload(downloadId); if (download != null) { - if (!deleteFiles) { - File file = new File(UrlUtils.stripProtocol(download.getOutputFile())); - if (file.exists()) { - File newFile = new File(UrlUtils.stripProtocol(download.getOutputFile().concat(".bak"))); - file.renameTo(newFile); - mDownloadManager.remove(downloadId); - newFile.renameTo(file); - - } else { - mDownloadManager.remove(downloadId); - } - - } else { + File file = new File(UrlUtils.stripProtocol(download.getOutputFile())); + if (file.exists()) { + File newFile = new File(UrlUtils.stripProtocol(download.getOutputFile().concat(".bak"))); + file.renameTo(newFile); mDownloadManager.remove(downloadId); + newFile.renameTo(file); } } notifyDownloadsUpdate(); } - public void removeAllDownloads(boolean deleteFiles) { - getDownloads().forEach(download -> removeDownload(download.getId(), deleteFiles)); + public void clearAllDownloads() { + getDownloads().forEach(download -> { + clearDownload(download.getId()); + }); + notifyDownloadsUpdate(); } @Nullable @@ -211,12 +199,7 @@ public void onReceive(Context context, Intent intent) { private void notifyDownloadsUpdate() { List downloads = getDownloads(); - int filter = Download.RUNNING | Download.PAUSED | Download.PENDING; - boolean activeDownloads = downloads.stream().filter(d -> (d.getStatus() & filter) != 0).count() > 0; mListeners.forEach(listener -> listener.onDownloadsUpdate(downloads)); - if (!activeDownloads) { - stopUpdates(); - } } private void notifyDownloadCompleted(@NonNull Download download) { @@ -227,8 +210,17 @@ private void notifyDownloadError(@NonNull String error, @NonNull String file) { mListeners.forEach(listener -> listener.onDownloadError(error, file)); } - private Runnable mDownloadUpdateTask = () -> { - mMainHandler.post(this::notifyDownloadsUpdate); + private Runnable mDownloadUpdateTask = new Runnable() { + @Override + public void run() { + DownloadManager.Query query = new DownloadManager.Query(); + Cursor c = mDownloadManager.query(query); + + while (c.moveToNext()) { + mMainHandler.post(() -> notifyDownloadsUpdate()); + } + c.close(); + } }; } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/geolocation/GeolocationWrapper.kt b/app/src/common/shared/org/mozilla/vrbrowser/geolocation/GeolocationWrapper.kt index fe2f83e5d..fadcfead6 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/geolocation/GeolocationWrapper.kt +++ b/app/src/common/shared/org/mozilla/vrbrowser/geolocation/GeolocationWrapper.kt @@ -6,7 +6,6 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.future.future import kotlinx.coroutines.launch -import mozilla.components.service.location.LocationService import mozilla.components.service.location.MozillaLocationService import org.mozilla.vrbrowser.browser.engine.EngineProvider import org.mozilla.vrbrowser.browser.SettingsStore @@ -23,12 +22,12 @@ object GeolocationWrapper { CoroutineScope(Dispatchers.IO).launch { locationService.fetchRegion(true)?.run { val data: GeolocationData = GeolocationData.create(countryCode, countryName) - SettingsStore.getInstance(context).geolocationData = data.toString() + SettingsStore.getInstance(context).setGeolocationData(data.toString()) } } } - fun get(context: Context): CompletableFuture = + fun get(context: Context): CompletableFuture = GlobalScope.future { val locationService = MozillaLocationService( context, diff --git a/app/src/common/shared/org/mozilla/vrbrowser/search/GeolocationLocalizationProvider.java b/app/src/common/shared/org/mozilla/vrbrowser/search/GeolocationLocalizationProvider.java index 75d6cac1e..2177dfe43 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/search/GeolocationLocalizationProvider.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/search/GeolocationLocalizationProvider.java @@ -23,6 +23,12 @@ public class GeolocationLocalizationProvider implements SearchLocalizationProvid mRegion = data.getCountryCode(); } + GeolocationLocalizationProvider(@NonNull String countryCode, @NonNull String region) { + mCountry = countryCode; + mLanguage = Locale.getDefault().getLanguage(); + mRegion = region; + } + @Nullable @Override public SearchLocalization determineRegion(@NonNull Continuation continuation) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/search/SearchEngineWrapper.java b/app/src/common/shared/org/mozilla/vrbrowser/search/SearchEngineWrapper.java index 7e54447a5..45b14ddb4 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/search/SearchEngineWrapper.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/search/SearchEngineWrapper.java @@ -12,17 +12,21 @@ import androidx.annotation.NonNull; import org.mozilla.vrbrowser.R; +import org.mozilla.vrbrowser.VRBrowserApplication; import org.mozilla.vrbrowser.browser.SettingsStore; +import org.mozilla.vrbrowser.browser.engine.EngineProvider; import org.mozilla.vrbrowser.geolocation.GeolocationData; -import org.mozilla.vrbrowser.search.suggestions.SearchSuggestionsCLientKt; +import org.mozilla.vrbrowser.search.suggestions.SuggestionsClient; import org.mozilla.vrbrowser.utils.SystemUtils; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; import kotlinx.coroutines.Dispatchers; import mozilla.components.browser.search.SearchEngine; @@ -60,14 +64,22 @@ SearchEngineWrapper get(final @NonNull Context aContext) { return mSearchEngineWrapperInstance; } + public interface SuggestionsDelegate { + void OnSuggestions(List aSuggestionsList); + } + private Context mContext; private SearchEngine mSearchEngine; + private SearchLocalizationProvider mLocalizationProvider; + private SearchEngineManager mSearchEngineManager; private SearchSuggestionClient mSuggestionsClient; private SharedPreferences mPrefs; + private Executor mUIThreadExecutor; private SearchEngineWrapper(@NonNull Context aContext) { mContext = aContext; mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext); + mUIThreadExecutor = ((VRBrowserApplication)aContext.getApplicationContext()).getExecutors().mainThread(); setupSearchEngine(aContext, EMPTY); } @@ -99,9 +111,21 @@ public String getSearchURL(String aQuery) { return mSearchEngine.buildSearchUrl(aQuery); } + private String getSuggestionURL(String aQuery) { + return mSearchEngine.buildSuggestionsURL(aQuery); + } + public CompletableFuture> getSuggestions(String aQuery) { - String query = mSearchEngine.buildSuggestionsURL(aQuery); - return SearchSuggestionsCLientKt.getSuggestionsAsync(mSuggestionsClient, query != null ? query : ""); + CompletableFuture> future = new CompletableFuture<>(); + // TODO: Use mSuggestionsClient.getSuggestions when fixed in browser-search. + String query = getSuggestionURL(aQuery); + mUIThreadExecutor.execute(() -> + SuggestionsClient.getSuggestions( + EngineProvider.INSTANCE.getDefaultGeckoWebExecutor(mContext), + mSearchEngine, + query).thenAcceptAsync(future::complete)); + + return future; } public String getResourceURL() { @@ -133,7 +157,6 @@ private void setupSearchEngine(@NonNull Context aContext, String userPref) { List engineFilterList = new ArrayList<>(); GeolocationData data = GeolocationData.parse(SettingsStore.getInstance(aContext).getGeolocationData()); - SearchLocalizationProvider mLocalizationProvider; if (data == null) { Log.d(LOGTAG, "Using Locale based search localization provider"); // If we don't have geolocation data we default to the Locale search localization provider @@ -158,7 +181,7 @@ private void setupSearchEngine(@NonNull Context aContext, String userPref) { engineFilterList, Collections.emptyList()); - SearchEngineManager mSearchEngineManager = new SearchEngineManager(Collections.singletonList(engineProvider), Dispatchers.getDefault()); + mSearchEngineManager = new SearchEngineManager(Arrays.asList(engineProvider), Dispatchers.getDefault()); // If we don't get any result we use the default configuration. if (mSearchEngineManager.getSearchEngines(aContext).size() == 0) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SearchSuggestionsCLient.kt b/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SearchSuggestionsCLient.kt deleted file mode 100644 index aba557de6..000000000 --- a/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SearchSuggestionsCLient.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.mozilla.vrbrowser.search.suggestions - -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.future.future -import mozilla.components.browser.search.suggestions.SearchSuggestionClient -import java.util.concurrent.CompletableFuture - -fun getSuggestionsAsync(client: SearchSuggestionClient, query: String): CompletableFuture?> = - GlobalScope.future { - client.getSuggestions(query) - } \ No newline at end of file diff --git a/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionParser.java b/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionParser.java new file mode 100644 index 000000000..031bc371a --- /dev/null +++ b/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionParser.java @@ -0,0 +1,102 @@ +package org.mozilla.vrbrowser.search.suggestions; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; + +import mozilla.components.browser.search.SearchEngine; + +public class SuggestionParser { + + private static final String AZERDICT = "Azerdict"; + private static final String DAUM = "다음지도"; + private static final String QWANT = "Qwant"; + + public static Function> selectResponseParser(SearchEngine mEngine) { + if (mEngine.getName().equals(AZERDICT)) { + return azerdictResponseParser; + + } else if (mEngine.getName().equals(DAUM)) { + return daumResponseParser; + + } else if (mEngine.getName().equals(QWANT)) { + return qwantResponseParser; + } + + return defaultResponseParser; + } + + private static Function> defaultResponseParser = buildJSONArrayParser(1); + private static Function> azerdictResponseParser = buildJSONObjectParser("suggestions"); + private static Function> daumResponseParser = buildJSONObjectParser("items"); + private static Function> qwantResponseParser = buildQwantParser(); + + private static Function> buildJSONArrayParser(int ressultsIndex) { + return input -> { + List list = new ArrayList<>(); + try { + JSONArray root = new JSONArray(input); + JSONArray array = root.getJSONArray(ressultsIndex); + if (array != null) { + int len = array.length(); + for (int i=0; i> buildJSONObjectParser(String resultsKey) { + return input -> { + List list = new ArrayList<>(); + try { + JSONObject root = new JSONObject(input); + JSONArray array = root.getJSONArray(resultsKey); + if (array != null) { + int len = array.length(); + for (int i=0; i> buildQwantParser() { + return input -> { + List list = new ArrayList<>(); + try { + JSONObject root = new JSONObject(input); + JSONObject data = root.getJSONObject("data"); + JSONArray items = data.getJSONArray("items"); + if (items != null) { + int len = items.length(); + for (int i=0; i> getSuggestions(@NonNull GeckoWebExecutor executor, SearchEngine mEngine, String aQuery) { + final CompletableFuture> future = new CompletableFuture<>(); + + new Handler(Looper.getMainLooper()).post(() -> { + WebRequest request = new WebRequest.Builder(aQuery) + .method("GET") + .build(); + + executor.fetch(request).then(webResponse -> { + String body; + if (webResponse != null) { + if (webResponse.body != null) { + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + int nRead; + byte[] data = new byte[1024]; + while ((nRead = webResponse.body.read(data, 0, data.length)) != -1) { + buffer.write(data, 0, nRead); + } + body = new String(buffer.toByteArray(), StandardCharsets.UTF_8); + + if (webResponse.statusCode == 200) { + future.complete(SuggestionParser.selectResponseParser(mEngine).apply(body)); + + } else { + // called when response HTTP status is not "200" + future.completeExceptionally(new Throwable(String.format("Network Error: %s", webResponse.statusCode))); + } + + } else { + // WebResponse body is null + future.completeExceptionally(new Throwable("Response body is null")); + } + + } else { + // WebResponse is null + future.completeExceptionally(new Throwable("Response is null")); + } + return null; + + }).exceptionally(throwable -> { + // Exception happened + future.completeExceptionally(new Throwable(String.format("Unknown network Error: %s", String.format("An exception happened during the request: %s", throwable.getMessage())))); + return null; + }); + }); + + return future; + } +} diff --git a/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionsProvider.java b/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionsProvider.java index ed938d0b2..7adf9ea58 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionsProvider.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionsProvider.java @@ -17,29 +17,30 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; -import java.util.function.Supplier; public class SuggestionsProvider { private static final String LOGTAG = SuggestionsProvider.class.getSimpleName(); - public static class DefaultSuggestionsComparator implements Comparator { + public class DefaultSuggestionsComparator implements Comparator { - public int compare(SuggestionItem obj1, SuggestionItem obj2) { - if (obj1.type == Type.SUGGESTION && obj2.type == Type.SUGGESTION) { + public int compare(Object obj1, Object obj2) { + SuggestionItem suggestion1 = (SuggestionItem)obj1; + SuggestionItem suggestion2 = (SuggestionItem)obj2; + if (suggestion1.type == Type.SUGGESTION && suggestion2.type == Type.SUGGESTION) { return 0; - } else if (obj1.type == obj2.type) { - if (obj1.type == Type.HISTORY) { - if (obj1.score != obj2.score) { - return obj1.score - obj2.score; + } else if (suggestion1.type == suggestion2.type) { + if (suggestion1.type == Type.HISTORY) { + if (suggestion1.score != suggestion2.score) { + return suggestion1.score - suggestion2.score; } } - return obj1.url.compareTo(obj2.url); + return suggestion1.url.compareTo(suggestion2.url); } else { - return obj1.type.ordinal() - obj2.type.ordinal(); + return suggestion1.type.ordinal() - suggestion2.type.ordinal(); } } } @@ -47,7 +48,7 @@ public int compare(SuggestionItem obj1, SuggestionItem obj2) { private SearchEngineWrapper mSearchEngineWrapper; private String mText; private String mFilterText; - private Comparator mComparator; + private Comparator mComparator; private Executor mUIThreadExecutor; public SuggestionsProvider(Context context) { @@ -73,15 +74,15 @@ public void setFilterText(String text) { public void setText(String text) { mText = text; } - public void setComparator(Comparator comparator) { + public void setComparator(Comparator comparator) { mComparator = comparator; } private CompletableFuture> getBookmarkSuggestions(@NonNull List items) { - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture future = new CompletableFuture(); SessionStore.get().getBookmarkStore().searchBookmarks(mFilterText, 100).thenAcceptAsync((bookmarks) -> { bookmarks.stream() - .filter((b) -> b.getUrl() != null && !b.getUrl().startsWith("place:") && + .filter((b) -> !b.getUrl().startsWith("place:") && !b.getUrl().startsWith("about:reader")) .forEach(b -> items.add(SuggestionItem.create( b.getTitle(), @@ -106,7 +107,7 @@ private CompletableFuture> getBookmarkSuggestions(@NonNull } private CompletableFuture> getHistorySuggestions(@NonNull final List items) { - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture future = new CompletableFuture(); SessionStore.get().getHistoryStore().getSuggestions(mFilterText, 100).thenAcceptAsync((history) -> { history.forEach(h -> items.add(SuggestionItem.create( h.getTitle(), @@ -131,7 +132,7 @@ private CompletableFuture> getHistorySuggestions(@NonNull f } private CompletableFuture> getSearchEngineSuggestions(@NonNull final List items) { - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture future = new CompletableFuture(); // Completion from browser-domains if (!mText.equals(mFilterText)) { @@ -181,7 +182,7 @@ private CompletableFuture> getSearchEngineSuggestions(@NonN } public CompletableFuture> getSuggestions() { - return CompletableFuture.supplyAsync((Supplier>) ArrayList::new) + return CompletableFuture.supplyAsync(() -> new ArrayList()) .thenComposeAsync(this::getSearchEngineSuggestions) .thenComposeAsync(this::getBookmarkSuggestions) .thenComposeAsync(this::getHistorySuggestions); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java b/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java index 7e94bddf4..dcbc0c1a0 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java @@ -84,9 +84,9 @@ public static void stopPageLoadTimeWithURI(String uri) { } if (domainMap.add(UrlUtils.stripCommonSubdomains(uriLink.getHost()))) { - Url.INSTANCE.domains().add(); + Url.INSTANCE.getDomains().add(); } - Url.INSTANCE.visits().add(); + Url.INSTANCE.getVisits().add(); } catch (IllegalArgumentException e) { Log.e(LOGTAG, "Invalid URL", e); @@ -96,7 +96,7 @@ public static void stopPageLoadTimeWithURI(String uri) { public static void sessionStop() { domainMap.clear(); - Pings.INSTANCE.sessionEnd().send(); + Pings.INSTANCE.getSessionEnd().send(); } @UiThread @@ -153,11 +153,11 @@ private static String getDefaultSearchEngineIdentifierForTelemetry() { } public static void newWindowOpenEvent() { - Control.INSTANCE.openNewWindow().add(); + Control.INSTANCE.getOpenNewWindow().add(); } private static void setStartupMetrics() { - Distribution.INSTANCE.channelName().set(DeviceType.isOculusBuild() ? "oculusvr" : BuildConfig.FLAVOR_platform); + Distribution.INSTANCE.getChannelName().set(DeviceType.isOculusBuild() ? "oculusvr" : BuildConfig.FLAVOR_platform); } @VisibleForTesting @@ -168,29 +168,29 @@ public static void testSetStartupMetrics() { public static class FxA { public static void signIn() { - FirefoxAccount.INSTANCE.signIn().record(); + FirefoxAccount.INSTANCE.getSignIn().record(); } public static void signInResult(boolean status) { Map map = new HashMap<>(); map.put(FirefoxAccount.signInResultKeys.state, String.valueOf(status)); - FirefoxAccount.INSTANCE.signInResult().record(map); + FirefoxAccount.INSTANCE.getSignInResult().record(map); } public static void signOut() { - FirefoxAccount.INSTANCE.signOut().record(); + FirefoxAccount.INSTANCE.getSignOut().record(); } public static void bookmarksSyncStatus(boolean status) { - FirefoxAccount.INSTANCE.bookmarksSyncStatus().set(status); + FirefoxAccount.INSTANCE.getBookmarksSyncStatus().set(status); } public static void historySyncStatus(boolean status) { - FirefoxAccount.INSTANCE.historySyncStatus().set(status); + FirefoxAccount.INSTANCE.getHistorySyncStatus().set(status); } public static void sentTab() { - FirefoxAccount.INSTANCE.tabSent().add(); + FirefoxAccount.INSTANCE.getTabSent().add(); } public static void receivedTab(@NonNull mozilla.components.concept.sync.DeviceType source) { @@ -217,7 +217,7 @@ public static void openedCounter(@NonNull TabSource source) { } public static void activatedEvent() { - org.mozilla.vrbrowser.GleanMetrics.Tabs.INSTANCE.activated().add(); + org.mozilla.vrbrowser.GleanMetrics.Tabs.INSTANCE.getActivated().add(); } } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/DownloadsAdapter.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/DownloadsAdapter.java index 42b592e44..01ba9be02 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/DownloadsAdapter.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/DownloadsAdapter.java @@ -77,16 +77,18 @@ public int getNewListSize() { @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { - return mDownloadsList.get(oldItemPosition).getId() == downloadsList.get(newItemPosition).getId(); + return mDownloadsList.get(oldItemPosition).getUri().equals(downloadsList.get(newItemPosition).getUri()); } @Override public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) { Download newDownloadItem = downloadsList.get(newItemPosition); Download oldDownloadItem = mDownloadsList.get(oldItemPosition); - return newDownloadItem.getProgress() == oldDownloadItem.getProgress() - && newDownloadItem.getStatus() == oldDownloadItem.getStatus() - && newDownloadItem.getFilename().equals(oldDownloadItem.getFilename()); + return newDownloadItem.getLastModified() == oldDownloadItem.getLastModified() + && Objects.equals(newDownloadItem.getTitle(), oldDownloadItem.getTitle()) + && Objects.equals(newDownloadItem.getDescription(), oldDownloadItem.getDescription()) + && Objects.equals(newDownloadItem.getOutputFile(), oldDownloadItem.getOutputFile()) + && Objects.equals(newDownloadItem.getUri(), oldDownloadItem.getUri()); } }); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/SitePermissionAdapter.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/SitePermissionAdapter.java index e3396b41b..f330b13a6 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/SitePermissionAdapter.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/adapters/SitePermissionAdapter.java @@ -53,7 +53,7 @@ public SitePermissionAdapter(Context aContext, PermissionSiteItemCallback callba public void setSites(@NonNull List sites) { if (mDisplayList == null) { mDisplayList = sites; - notifyDataSetChanged(); + notifyItemRangeChanged(0, sites.size()); } else { notifyDiff(sites); @@ -78,7 +78,7 @@ public int getNewListSize() { @Override public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { - return mDisplayList.get(oldItemPosition).id == newDisplayList.get(newItemPosition).id; + return mDisplayList.get(oldItemPosition).url.equals(newDisplayList.get(newItemPosition).url); } @Override @@ -125,11 +125,6 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi siteHolder.binding.setItem(site); } - @Override - public long getItemId(int position) { - return mDisplayList.get(position).id; - } - @Override public int getItemCount() { return mDisplayList == null ? 0 : mDisplayList.size(); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/SitePermissionViewModel.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/SitePermissionViewModel.java index 1b862c586..2156a68a4 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/SitePermissionViewModel.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/SitePermissionViewModel.java @@ -59,10 +59,6 @@ public void deleteSite(@NonNull SitePermission site) { mRepository.deleteSitePermission(site); } - public void deleteSites(@NonNull List sites) { - mRepository.deleteSites(sites); - } - public void deleteAll(@SitePermission.Category int category) { mRepository.deleteAllSitePermission(category); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/WindowViewModel.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/WindowViewModel.java index ae2fa92b9..42bb23fa0 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/WindowViewModel.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/WindowViewModel.java @@ -6,7 +6,6 @@ import android.text.SpannableString; import android.text.style.ForegroundColorSpan; import android.util.TypedValue; -import android.webkit.URLUtil; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -16,7 +15,6 @@ import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.Observer; -import org.mozilla.geckoview.ContentBlocking; import org.mozilla.vrbrowser.R; import org.mozilla.vrbrowser.browser.SettingsStore; import org.mozilla.vrbrowser.ui.widgets.Windows; @@ -69,8 +67,6 @@ public class WindowViewModel extends AndroidViewModel { private MutableLiveData isWebXRBlocked; private MutableLiveData isTrackingEnabled; private MutableLiveData isDrmUsed; - private MediatorLiveData isUrlBarButtonsVisible; - private MediatorLiveData isUrlBarIconsVisible; public WindowViewModel(Application application) { super(application); @@ -166,20 +162,6 @@ public WindowViewModel(Application application) { isTrackingEnabled = new MutableLiveData<>(new ObservableBoolean(true)); isDrmUsed = new MutableLiveData<>(new ObservableBoolean(false)); - - isUrlBarButtonsVisible = new MediatorLiveData<>(); - isUrlBarButtonsVisible.addSource(isTrackingEnabled, mIsUrlBarButtonsVisibleObserver); - isUrlBarButtonsVisible.addSource(isDrmUsed, mIsUrlBarButtonsVisibleObserver); - isUrlBarButtonsVisible.addSource(isPopUpAvailable, mIsUrlBarButtonsVisibleObserver); - isUrlBarButtonsVisible.addSource(isWebXRUsed, mIsUrlBarButtonsVisibleObserver); - isUrlBarButtonsVisible.addSource(isLibraryVisible, mIsUrlBarButtonsVisibleObserver); - isUrlBarButtonsVisible.addSource(isFocused, mIsUrlBarButtonsVisibleObserver); - isUrlBarButtonsVisible.setValue(new ObservableBoolean(false)); - - isUrlBarIconsVisible = new MediatorLiveData<>(); - isUrlBarIconsVisible.addSource(isLoading, mIsUrlBarIconsVisibleObserver); - isUrlBarIconsVisible.addSource(isInsecureVisible, mIsUrlBarIconsVisibleObserver); - isUrlBarIconsVisible.setValue(new ObservableBoolean(false)); } private Observer mIsTopBarVisibleObserver = new Observer() { @@ -315,37 +297,6 @@ public void onChanged(Spannable aUrl) { } }; - private Observer mIsUrlBarButtonsVisibleObserver = new Observer() { - @Override - public void onChanged(ObservableBoolean o) { - String aUrl = url.getValue().toString(); - isUrlBarButtonsVisible.postValue(new ObservableBoolean( - !isFocused.getValue().get() && - !isLibraryVisible.getValue().get() && - !UrlUtils.isContentFeed(getApplication(), aUrl) && - !UrlUtils.isPrivateAboutPage(getApplication(), aUrl) && - (URLUtil.isHttpUrl(aUrl) || URLUtil.isHttpsUrl(aUrl)) && - ( - (SettingsStore.getInstance(getApplication()).getTrackingProtectionLevel() != ContentBlocking.EtpLevel.NONE) || - isPopUpAvailable.getValue().get() || - isDrmUsed.getValue().get() || - isWebXRUsed.getValue().get() - ) - )); - } - }; - - private Observer mIsUrlBarIconsVisibleObserver = new Observer() { - @Override - public void onChanged(ObservableBoolean o) { - isUrlBarIconsVisible.postValue(new ObservableBoolean( - !isLibraryVisible.getValue().get() && - (isLoading.getValue().get() || - isInsecureVisible.getValue().get()) - )); - } - }; - public void refresh() { url.postValue(url.getValue()); hint.postValue(getHintValue()); @@ -397,6 +348,10 @@ public void setUrl(@Nullable Spannable url) { String aURL = url.toString(); + if (isLibraryVisible.getValue().get()) { + return; + } + int index = -1; try { aURL = URLDecoder.decode(aURL, "UTF-8"); @@ -553,7 +508,7 @@ public MutableLiveData getIsActiveWindow() { } public void setIsActiveWindow(boolean isActiveWindow) { - this.isActiveWindow.setValue(new ObservableBoolean(isActiveWindow)); + this.isActiveWindow.postValue(new ObservableBoolean(isActiveWindow)); } @NonNull @@ -775,14 +730,4 @@ public MutableLiveData getIsDrmUsed() { public void setIsDrmUsed(boolean isEnabled) { this.isDrmUsed.postValue(new ObservableBoolean(isEnabled)); } - - @NonNull - public MutableLiveData getIsUrlBarButtonsVisible() { - return isUrlBarButtonsVisible; - } - - @NonNull - public MutableLiveData getIsUrlBarIconsVisible() { - return isUrlBarIconsVisible; - } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java index faf3f3296..c95fcf08a 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java @@ -240,7 +240,6 @@ private void initialize(Context aContext) { public void detachFromWindow() { if (mViewModel != null) { - mViewModel.setIsFocused(false); mViewModel.getIsLoading().removeObserver(mIsLoadingObserver); mViewModel.getIsBookmarked().removeObserver(mIsBookmarkedObserver); mViewModel = null; @@ -375,8 +374,6 @@ public void handleURLEdit(String text) { GleanMetricsService.urlBarEvent(false); } - mViewModel.setUrl(url); - mSession.loadUri(url); if (mDelegate != null) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/TabView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/TabView.java index 4054722bf..71b6dc84a 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/TabView.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/TabView.java @@ -50,7 +50,7 @@ public class TabView extends RelativeLayout implements GeckoSession.ContentDeleg protected boolean mPressed; protected CompletableFuture mBitmapFuture; protected boolean mUsingPlaceholder; - private boolean mSendTabEnabled; + private boolean mIsPrivateMode; private static final int ICON_ANIMATION_DURATION = 100; public interface Delegate { @@ -216,8 +216,8 @@ public void setActive(boolean aActive) { } } - public void setSendTabEnabled(boolean enabled) { - mSendTabEnabled = enabled; + public void setPrivate(boolean privateMode) { + mIsPrivateMode = privateMode; } public void reset() { @@ -261,7 +261,7 @@ private void updateState() { boolean selected = isSelected(); mCloseButton.setVisibility(interacted && !selected && !mSelecting ? View.VISIBLE : View.GONE); - mSendTabButton.setVisibility(mSendTabEnabled && interacted && !selected && !mSelecting ? View.VISIBLE : View.GONE); + mSendTabButton.setVisibility(interacted && !selected && !mSelecting && !mIsPrivateMode ? View.VISIBLE : View.GONE); mTitle.setVisibility(interacted && !selected ? View.VISIBLE : View.GONE); mTabOverlay.setPressed(mPressed); if (mSelecting) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/library/DownloadsView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/library/DownloadsView.java index 6bb30446c..d0a3076c1 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/library/DownloadsView.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/library/DownloadsView.java @@ -82,7 +82,7 @@ protected void initialize() { ViewModelProvider.AndroidViewModelFactory.getInstance(((VRBrowserActivity) getContext()).getApplication())) .get(DownloadsViewModel.class); - mSortingComparator = getSorting(SettingsStore.getInstance(getContext()).getDownloadsSortingOrder()); + mSortingComparator = mAZFileNameComparator; updateUI(); } @@ -161,9 +161,9 @@ public void onDelete(@NonNull View view, @NonNull Download item) { getContext().getString(R.string.download_delete_confirm_delete) }, getContext().getString(R.string.download_delete_file_confirm_checkbox), - (index, isChecked) -> { + index -> { if (index == PromptDialogWidget.POSITIVE) { - mDownloadsManager.removeDownload(item.getId(), isChecked); + mDownloadsManager.removeDownload(item.getId()); } } ); @@ -207,10 +207,9 @@ public void onDeleteDownloads(@NonNull View view) { getContext().getString(R.string.download_delete_confirm_delete) }, getContext().getString(R.string.download_delete_all_confirm_checkbox), - (index, isChecked) -> { + index -> { if (index == PromptDialogWidget.POSITIVE) { - mViewModel.setIsEmpty(true); - post(() -> mDownloadsManager.removeAllDownloads(isChecked)); + mDownloadsManager.clearAllDownloads(); } } ); @@ -294,9 +293,9 @@ public void onDelete(DownloadsContextMenuWidget.DownloadsContextMenuItem item) { getContext().getString(R.string.download_delete_confirm_delete) }, getContext().getString(R.string.download_delete_file_confirm_checkbox), - (index, isChecked) -> { + index -> { if (index == PromptDialogWidget.POSITIVE) { - mDownloadsManager.removeDownload(item.getDownloadsId(), isChecked); + mDownloadsManager.removeDownload(item.getDownloadsId()); } } ); @@ -319,9 +318,27 @@ protected void showSortingContextMenu(@NonNull View view) { SortingContextMenuWidget menu = new SortingContextMenuWidget(getContext()); menu.setItemDelegate(item -> { - mSortingComparator = getSorting(item); + switch (item) { + case SortingContextMenuWidget.SORT_FILENAME_AZ: + mSortingComparator = mAZFileNameComparator; + break; + case SortingContextMenuWidget.SORT_FILENAME_ZA: + mSortingComparator = mZAFilenameComparator; + break; + case SortingContextMenuWidget.SORT_DATE_ASC: + mSortingComparator = mDownloadDateAscComparator; + break; + case SortingContextMenuWidget.SORT_DATE_DESC: + mSortingComparator = mDownloadDateDescComparator; + break; + case SortingContextMenuWidget.SORT_SIZE_ASC: + mSortingComparator = mDownloadSizeAscComparator; + break; + case SortingContextMenuWidget.SORT_SIZE_DESC: + mSortingComparator = mDownloadSizeDescComparator; + break; + } onDownloadsUpdate(mDownloadsManager.getDownloads()); - mBinding.downloadsList.scrollToPosition(0); }); menu.getPlacement().parentHandle = window.getHandle(); @@ -334,67 +351,14 @@ protected void showSortingContextMenu(@NonNull View view) { menu.show(UIWidget.REQUEST_FOCUS); } - private Comparator getSorting(@SortingContextMenuWidget.Order int order) { - switch (order) { - case SortingContextMenuWidget.SORT_FILENAME_AZ: - return mAZFileNameComparator; - case SortingContextMenuWidget.SORT_FILENAME_ZA: - return mZAFilenameComparator; - case SortingContextMenuWidget.SORT_DATE_ASC: - return mDownloadDateAscComparator; - case SortingContextMenuWidget.SORT_DATE_DESC: - return mDownloadDateDescComparator; - case SortingContextMenuWidget.SORT_SIZE_ASC: - return mDownloadSizeAscComparator; - case SortingContextMenuWidget.SORT_SIZE_DESC: - return mDownloadSizeDescComparator; - } - - return mDownloadIdComparator; - } - // DownloadsManager.DownloadsListener - private Comparator mDownloadIdComparator = (o1, o2) -> (int)(o1.getId() - o2.getId()); - - private Comparator mAZFileNameComparator = (o1, o2) -> { - int nameDiff = o1.getFilename().compareTo(o2.getFilename()); - if (nameDiff == 0) { - return mDownloadIdComparator.compare(o1, o2); - - } else { - return nameDiff; - } - }; - private Comparator mZAFilenameComparator = (o1, o2) -> { - int nameDiff = o2.getFilename().compareTo(o1.getFilename()); - if (nameDiff == 0) { - return mDownloadIdComparator.compare(o1, o2); - - } else { - return nameDiff; - } - }; - private Comparator mDownloadDateAscComparator = (o1, o2) -> mDownloadIdComparator.compare(o1, o2); - private Comparator mDownloadDateDescComparator = (o1, o2) -> mDownloadIdComparator.compare(o2, o1); - private Comparator mDownloadSizeAscComparator = (o1, o2) -> { - int sizeDiff = (int)(o1.getSizeBytes() - o2.getSizeBytes()); - if (sizeDiff == 0) { - return mDownloadIdComparator.compare(o1, o2); - - } else { - return sizeDiff; - } - }; - private Comparator mDownloadSizeDescComparator = (o1, o2) -> { - int sizeDiff = (int)(o2.getSizeBytes() - o1.getSizeBytes()); - if (sizeDiff == 0) { - return mDownloadIdComparator.compare(o1, o2); - - } else { - return sizeDiff; - } - }; + private Comparator mAZFileNameComparator = (o1, o2) -> o1.getFilename().compareTo(o2.getFilename()); + private Comparator mZAFilenameComparator = (o1, o2) -> o2.getFilename().compareTo(o1.getFilename()); + private Comparator mDownloadDateAscComparator = (o1, o2) -> (int)(o1.getLastModified() - o2.getLastModified()); + private Comparator mDownloadDateDescComparator = (o1, o2) -> (int)(o2.getLastModified() - o1.getLastModified()); + private Comparator mDownloadSizeAscComparator = (o1, o2) -> (int)(o1.getSizeBytes() - o2.getSizeBytes()); + private Comparator mDownloadSizeDescComparator = (o1, o2) -> (int)(o2.getSizeBytes() - o1.getSizeBytes()); @Override public void onDownloadsUpdate(@NonNull List downloads) { @@ -416,7 +380,7 @@ public void onDownloadsUpdate(@NonNull List downloads) { public void onDownloadError(@NonNull String error, @NonNull String filename) { Log.e(LOGTAG, error); mWidgetManager.getFocusedWindow().showAlert( - getContext().getString(R.string.download_error_title), + getContext().getString(R.string.download_error_title, filename), error, null ); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MediaControlsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MediaControlsWidget.java index cdb78f8c9..9efd6453c 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MediaControlsWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MediaControlsWidget.java @@ -8,18 +8,15 @@ import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.os.Handler; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import android.widget.TextView; -import org.mozilla.telemetry.schedule.jobscheduler.TelemetryJobService; import org.mozilla.vrbrowser.R; import org.mozilla.geckoview.MediaElement; import org.mozilla.vrbrowser.browser.Media; -import org.mozilla.vrbrowser.browser.SettingsStore; import org.mozilla.vrbrowser.ui.views.MediaSeekBar; import org.mozilla.vrbrowser.ui.views.UIButton; import org.mozilla.vrbrowser.ui.views.VolumeControl; @@ -45,10 +42,6 @@ public class MediaControlsWidget extends UIWidget implements MediaElement.Delega private boolean mPlayOnSeekEnd; private Rect mOffsetViewBounds; private VideoProjectionMenuWidget mProjectionMenu; - static long VOLUME_SLIDER_CHECK_DELAY = 1000; - private Handler mVolumeCtrlHandler = new Handler(); - private boolean mHideVolumeSlider = false; - private Runnable mVolumeCtrlRunnable; public MediaControlsWidget(Context aContext) { super(aContext); @@ -83,13 +76,6 @@ private void initialize(Context aContext) { mVolumeIcon = aContext.getDrawable(R.drawable.ic_icon_media_volume); mOffsetViewBounds = new Rect(); - mVolumeCtrlRunnable = () -> { - if ((mHideVolumeSlider) && (mVolumeControl.getVisibility() == View.VISIBLE)) { - mVolumeControl.setVisibility(View.INVISIBLE); - stopVolumeCtrlHandler(); - } - }; - mMediaPlayButton.setOnClickListener(v -> { if (mMedia.isEnded()) { mMedia.seek(0); @@ -124,7 +110,6 @@ private void initialize(Context aContext) { placement.parentAnchorX = 0.65f; placement.parentAnchorY = 0.4f; placement.cylinderMapRadius = 0.0f; - placement.cylinder = SettingsStore.getInstance(getContext()).isCurvedModeEnabled(); if (mWidgetManager.getCylinderDensity() > 0) { placement.rotationAxisY = 1.0f; placement.rotation = (float) Math.toRadians(-7); @@ -194,8 +179,8 @@ public void onSeekPreview(String aText, double aRatio) { childView.getDrawingRect(mOffsetViewBounds); MediaControlsWidget.this.offsetDescendantRectToMyCoords(childView, mOffsetViewBounds); - FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mMediaSeekLabel.getLayoutParams(); - params.setMarginStart(mOffsetViewBounds.left + (int) (aRatio * mOffsetViewBounds.width()) - mMediaSeekLabel.getMeasuredWidth() / 2); + FrameLayout.LayoutParams params = (FrameLayout.LayoutParams)mMediaSeekLabel.getLayoutParams(); + params.setMarginStart(mOffsetViewBounds.left + (int)(aRatio * mOffsetViewBounds.width()) - mMediaSeekLabel.getMeasuredWidth() / 2); mMediaSeekLabel.setLayoutParams(params); } }); @@ -207,38 +192,37 @@ public void onSeekPreview(String aText, double aRatio) { } mVolumeControl.requestFocusFromTouch(); }); - mMediaVolumeButton.setOnHoverListener((v, event) -> { - float startY = v.getY(); - float maxY = startY + v.getHeight(); - //for this we only hide on the left side of volume button or outside y area of button - if ((event.getX() <= 0) || (event.getX() >= v.getWidth()) || (!(event.getY() > startY && event.getY() < maxY))) { - mHideVolumeSlider = true; - startVolumeCtrlHandler(); - } else { - mVolumeControl.setVisibility(View.VISIBLE); - mHideVolumeSlider = false; - stopVolumeCtrlHandler(); + this.setOnHoverListener((v, event) -> { + if (mMedia == null) { + return false; + } + if (event.getAction() == MotionEvent.ACTION_HOVER_MOVE || event.getAction() == MotionEvent.ACTION_HOVER_ENTER) { + float threshold = (float)MediaControlsWidget.this.getMeasuredWidth() * 0.65f; + boolean isVisible = mVolumeControl.getVisibility() == View.VISIBLE; + boolean makeVisible = event.getX() >= threshold; + if (isVisible != makeVisible) { + mVolumeControl.setVisibility(makeVisible ? View.VISIBLE : View.GONE); + } + } else if (event.getAction() == MotionEvent.ACTION_HOVER_EXIT && !mMediaVolumeButton.isHovered() && this.isInTouchMode()) { + mVolumeControl.setVisibility(View.INVISIBLE); } return false; }); - mVolumeControl.setOnHoverListener((v, event) -> { - float startY = 0; - float maxY = startY + v.getHeight(); - if ((event.getX() > 0 && event.getX() < v.getWidth()) && (event.getY() > startY && event.getY() < maxY)) { - mHideVolumeSlider = false; - stopVolumeCtrlHandler(); - } - //for this we only hide on the right side of volume button or outside y area of button - else if ((event.getX() <= 0) || (event.getX() >= v.getWidth()) || (!(event.getY() > startY && event.getY() < maxY))) { - mHideVolumeSlider = true; - startVolumeCtrlHandler(); + mMediaVolumeButton.setOnHoverListener((v, event) -> { + if (event.getAction() == MotionEvent.ACTION_HOVER_ENTER || event.getAction() == MotionEvent.ACTION_HOVER_MOVE) { + mVolumeControl.setVisibility(View.VISIBLE); } return false; }); - + mMediaProjectionButton.setOnHoverListener((v, event) -> { + if (event.getAction() == MotionEvent.ACTION_HOVER_ENTER || event.getAction() == MotionEvent.ACTION_HOVER_MOVE) { + mVolumeControl.setVisibility(View.INVISIBLE); + } + return false; + }); } @Override @@ -338,7 +322,7 @@ public void onMetadataChange(MediaElement mediaElement, MediaElement.Metadata me @Override public void onLoadProgress(MediaElement mediaElement, MediaElement.LoadProgressInfo progressInfo) { if (progressInfo.buffered != null) { - mSeekBar.setBuffered(progressInfo.buffered[progressInfo.buffered.length - 1].end); + mSeekBar.setBuffered(progressInfo.buffered[progressInfo.buffered.length -1].end); } } @@ -369,11 +353,4 @@ public void onFullscreenChange(MediaElement mediaElement, boolean fullscreen) { public void onError(MediaElement mediaElement, int code) { } - private void startVolumeCtrlHandler() { - mVolumeCtrlHandler.postDelayed(mVolumeCtrlRunnable, VOLUME_SLIDER_CHECK_DELAY); - } - - public void stopVolumeCtrlHandler() { - mVolumeCtrlHandler.removeCallbacks(mVolumeCtrlRunnable); - } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java index 2b489e14e..c0bf94961 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java @@ -16,9 +16,7 @@ import android.util.Log; import android.util.Pair; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; -import android.webkit.URLUtil; import android.widget.EditText; import androidx.annotation.NonNull; @@ -116,7 +114,7 @@ public interface NavigationListener { private Executor mUIThreadExecutor; private ArrayList mNavigationListeners; private TrackingProtectionStore mTrackingDelegate; - private WidgetPlacement mBeforeFullscreenPlacement; + private boolean mIsWindowAttached; public NavigationBarWidget(Context aContext) { super(aContext); @@ -142,6 +140,8 @@ private void initialize(@NonNull Context aContext) { updateUI(); + mIsWindowAttached = false; + mAppContext = aContext.getApplicationContext(); mUIThreadExecutor = ((VRBrowserApplication)aContext.getApplicationContext()).getExecutors().mainThread(); @@ -152,16 +152,11 @@ private void initialize(@NonNull Context aContext) { mNavigationListeners = new ArrayList<>(); - mFullScreenBackHandler = () -> { - if (mAttachedWindow != null) { - mAttachedWindow.setIsFullScreen(false); - } - }; + mFullScreenBackHandler = this::exitFullScreenMode; mVRVideoBackHandler = () -> { exitVRVideo(); - if (mAttachedWindow != null && - mViewModel.getAutoEnteredVRVideo().getValue().get()) { - mAttachedWindow.setIsFullScreen(false); + if (mViewModel.getAutoEnteredVRVideo().getValue().get()) { + exitFullScreenMode(); } }; @@ -283,9 +278,7 @@ private void updateUI() { mBinding.navigationBarFullscreen.fullScreenExitButton.setOnClickListener(view -> { view.requestFocusFromTouch(); - if (mAttachedWindow != null) { - mAttachedWindow.setIsFullScreen(false); - } + exitFullScreenMode(); if (mAudio != null) { mAudio.playSound(AudioEngine.Sound.CLICK); } @@ -303,8 +296,6 @@ private void updateUI() { boolean wasVisible = mProjectionMenu.isVisible(); closeFloatingMenus(); - mProjectionMenu.mWidgetPlacement.cylinder = SettingsStore.getInstance(getContext()).isCurvedModeEnabled(); - if (!wasVisible) { mProjectionMenu.show(REQUEST_FOCUS); } @@ -322,8 +313,6 @@ private void updateUI() { boolean wasVisible = mBrightnessWidget.isVisible(); closeFloatingMenus(); - mBrightnessWidget.mWidgetPlacement.cylinder = SettingsStore.getInstance(getContext()).isCurvedModeEnabled(); - if (!wasVisible) { float anchor = 0.5f + (float)mBinding.navigationBarFullscreen.brightnessButton.getMeasuredWidth() / (float)NavigationBarWidget.this.getMeasuredWidth(); mBrightnessWidget.getPlacement().parentAnchorX = anchor; @@ -386,22 +375,15 @@ private void updateUI() { if (mAttachedWindow != null) { mBinding.navigationBarNavigation.urlBar.attachToWindow(mAttachedWindow); } - - setOnTouchListener((v, event) -> { - closeFloatingMenus(); - v.performClick(); - return true; - }); } TrackingProtectionStore.TrackingProtectionListener mTrackingListener = new TrackingProtectionStore.TrackingProtectionListener() { @Override - public void onExcludedTrackingProtectionChange(@NonNull String url, boolean excluded, boolean isPrivate) { + public void onExcludedTrackingProtectionChange(@NonNull String host, boolean excluded) { Session currentSession = getSession(); if (currentSession != null) { - String currentSessionHost = UrlUtils.getHost(currentSession.getCurrentUri()); - String sessionHost = UrlUtils.getHost(url); - if (currentSessionHost.equals(sessionHost) && currentSession.isPrivateMode() == isPrivate) { + String existingHost = UrlUtils.getHost(currentSession.getCurrentUri()); + if (existingHost.equals(host)) { mViewModel.setIsTrackingEnabled(!excluded); } } @@ -506,10 +488,14 @@ public void detachFromWindow() { mTrackingDelegate.removeListener(mTrackingListener); if (mViewModel != null) { + mViewModel.getIsFullscreen().removeObserver(mIsFullscreenObserver); mViewModel.getIsActiveWindow().removeObserver(mIsActiveWindowObserver); mViewModel.getIsPopUpBlocked().removeObserver(mIsPopUpBlockedListener); + mViewModel.getUrl().removeObserver(mUrlObserver); mViewModel = null; } + + mIsWindowAttached = false; } @Override @@ -529,22 +515,24 @@ public void attachToWindow(@NonNull WindowWidget aWindow) { mBinding.setViewmodel(mViewModel); + mViewModel.getIsFullscreen().observeForever( mIsFullscreenObserver); mViewModel.getIsActiveWindow().observeForever(mIsActiveWindowObserver); mViewModel.getIsPopUpBlocked().observeForever(mIsPopUpBlockedListener); + mViewModel.getUrl().observeForever(mUrlObserver); mBinding.navigationBarNavigation.urlBar.attachToWindow(mAttachedWindow); mTrackingDelegate.addListener(mTrackingListener); mAttachedWindow.addWindowListener(this); - mBeforeFullscreenPlacement = mWidgetPlacement; - clearFocus(); if (getSession() != null) { setUpSession(getSession()); } handleWindowResize(); + + mIsWindowAttached = true; } private Session getSession() { @@ -574,40 +562,6 @@ public void onSessionChanged(@NonNull Session aOldSession, @NonNull Session aSes exitFullScreenMode(); } - @Override - public void onFullScreen(@NonNull WindowWidget aWindow, boolean aFullScreen) { - if (aFullScreen) { - enterFullScreenMode(); - - mBeforeFullscreenPlacement = mWidgetPlacement.clone(); - mWidgetPlacement.cylinder = SettingsStore.getInstance(getContext()).isCurvedModeEnabled(); - updateWidget(); - - if (mAttachedWindow.isResizing()) { - exitResizeMode(ResizeAction.KEEP_SIZE); - } - AtomicBoolean autoEnter = new AtomicBoolean(false); - mAutoSelectedProjection = VideoProjectionMenuWidget.getAutomaticProjection(getSession().getCurrentUri(), autoEnter); - if (mAutoSelectedProjection != VIDEO_PROJECTION_NONE && autoEnter.get()) { - mViewModel.setAutoEnteredVRVideo(true); - postDelayed(() -> enterVRVideo(mAutoSelectedProjection), 300); - } else { - mViewModel.setAutoEnteredVRVideo(false); - if (mProjectionMenu != null) { - mProjectionMenu.setSelectedProjection(mAutoSelectedProjection); - } - } - } else { - mWidgetPlacement = mBeforeFullscreenPlacement; - updateWidget(); - - if (mViewModel.getIsInVRVideo().getValue().get()) { - exitVRVideo(); - } - exitFullScreenMode(); - } - } - @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); @@ -649,7 +603,7 @@ private void enterFullScreenMode() { } private void exitFullScreenMode() { - if (mAttachedWindow == null || !mAttachedWindow.isFullScreen()) { + if (mAttachedWindow == null || !mViewModel.getIsFullscreen().getValue().get()) { return; } @@ -849,16 +803,39 @@ private void closeFloatingMenus() { } } - // NavigationDelegate + // Content delegate - @Override - public void onLocationChange(@NonNull GeckoSession geckoSession, @Nullable String s) { - if (getSession() != null && getSession().getGeckoSession() == geckoSession) { - updateTrackingProtection(); + private Observer mIsFullscreenObserver = isFullScreen -> { + if (!mIsWindowAttached) { + return; } - } - // Content delegate + if (isFullScreen.get()) { + enterFullScreenMode(); + + if (mAttachedWindow.isResizing()) { + exitResizeMode(ResizeAction.KEEP_SIZE); + } + AtomicBoolean autoEnter = new AtomicBoolean(false); + mAutoSelectedProjection = VideoProjectionMenuWidget.getAutomaticProjection(getSession().getCurrentUri(), autoEnter); + if (mAutoSelectedProjection != VIDEO_PROJECTION_NONE && autoEnter.get()) { + mViewModel.setAutoEnteredVRVideo(true); + postDelayed(() -> enterVRVideo(mAutoSelectedProjection), 300); + } else { + mViewModel.setAutoEnteredVRVideo(false); + if (mProjectionMenu != null) { + mProjectionMenu.setSelectedProjection(mAutoSelectedProjection); + } + } + } else { + if (mViewModel.getIsInVRVideo().getValue().get()) { + exitVRVideo(); + } + exitFullScreenMode(); + } + }; + + private Observer mUrlObserver = sitePermissions -> updateTrackingProtection(); private Observer mIsActiveWindowObserver = aIsActiveWindow -> updateTrackingProtection(); @@ -1171,12 +1148,7 @@ public void onSwitchMode() { hideMenu(); } }); - boolean isSendTabEnabled = false; - if (URLUtil.isHttpUrl(mAttachedWindow.getSession().getCurrentUri()) || - URLUtil.isHttpsUrl(mAttachedWindow.getSession().getCurrentUri())) { - isSendTabEnabled = true; - } - mHamburgerMenu.setSendTabEnabled(isSendTabEnabled); + mHamburgerMenu.setSendTabEnabled(!UrlUtils.isPrivateAboutPage(getContext(), mAttachedWindow.getSession().getCurrentUri())); mHamburgerMenu.setUAMode(mAttachedWindow.getSession().getUaMode()); mHamburgerMenu.show(UIWidget.KEEP_FOCUS); } @@ -1204,7 +1176,7 @@ public void showPopUpsBlockedNotification() { showNotification(POPUP_NOTIFICATION_ID, mBinding.navigationBarNavigation.urlBar.getPopUpButton(), NotificationManager.Notification.TOP, - R.string.popup_blocked_tooltip); + R.string.popup_tooltip); } }, POP_UP_NOTIFICATION_DELAY); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NotificationManager.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NotificationManager.java index e9cd73506..ef8a47dd1 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NotificationManager.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NotificationManager.java @@ -166,10 +166,7 @@ public static void show(int notificationId, @NonNull Notification notification) } Runnable hideTask = () -> hide(notificationId); - - if (notification.mView != null) { - notification.mView.postDelayed(hideTask, notification.mDuration); - } + notification.mView.postDelayed(hideTask, notification.mDuration); mData.put(notificationId, new NotificationData(notificationView, notification, hideTask)); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java index 03858de01..fa0a0ac4a 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TabsWidget.java @@ -6,7 +6,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.webkit.URLUtil; import android.widget.LinearLayout; import android.widget.TextView; @@ -241,17 +240,13 @@ public void onBindViewHolder(MyViewHolder holder, int position) { holder.tabView.setSelected(mSelectedTabs.contains(holder.tabView.getSession())); holder.tabView.setActive(SessionStore.get().getActiveSession() == holder.tabView.getSession()); if (holder.tabView.getSession() != null) { - String uri = holder.tabView.getSession().getCurrentUri(); - holder.tabView.setSendTabEnabled(URLUtil.isHttpUrl(uri) || URLUtil.isHttpsUrl(uri)); - } else { - holder.tabView.setSendTabEnabled(false); + holder.tabView.setPrivate(UrlUtils.isPrivateAboutPage(getContext(), holder.tabView.getSession().getCurrentUri())); } holder.tabView.setDelegate(new TabView.Delegate() { @Override public void onClose(TabView aSender) { if (aSender.getSession() != null) { - String uri = aSender.getSession().getCurrentUri(); - aSender.setSendTabEnabled(URLUtil.isHttpUrl(uri) || URLUtil.isHttpsUrl(uri)); + holder.tabView.setPrivate(aSender.getSession().isPrivateMode()); } if (mTabDelegate != null) { ArrayList closed = new ArrayList<>(); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TrayWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TrayWidget.java index 9c85d9e58..0a2211550 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TrayWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TrayWidget.java @@ -61,7 +61,6 @@ public class TrayWidget extends UIWidget implements WidgetManagerDelegate.Update private int mMaxPadding; private Session mSession; private WindowWidget mAttachedWindow; - private boolean mIsWindowAttached; public TrayWidget(Context aContext) { super(aContext); @@ -90,8 +89,6 @@ private void initialize(Context aContext) { updateUI(); - mIsWindowAttached = false; - mTrayListeners = new ArrayList<>(); mMinPadding = WidgetPlacement.pixelDimension(getContext(), R.dimen.tray_icon_padding_min); @@ -224,15 +221,11 @@ public void onConfigurationChanged(Configuration newConfig) { int ev = motionEvent.getActionMasked(); switch (ev) { case MotionEvent.ACTION_HOVER_ENTER: - if (!view.isPressed() && ViewUtils.isInsideView(view, (int)motionEvent.getRawX(), (int)motionEvent.getRawY())) { - animateViewPadding(view, mMaxPadding, mMinPadding, ICON_ANIMATION_DURATION); - } + animateViewPadding(view, mMaxPadding, mMinPadding, ICON_ANIMATION_DURATION); return false; case MotionEvent.ACTION_HOVER_EXIT: - if (!ViewUtils.isInsideView(view, (int)motionEvent.getRawX(), (int)motionEvent.getRawY())) { - animateViewPadding(view, mMinPadding, mMaxPadding, ICON_ANIMATION_DURATION); - } + animateViewPadding(view, mMinPadding, mMaxPadding, ICON_ANIMATION_DURATION); return false; } @@ -240,11 +233,6 @@ public void onConfigurationChanged(Configuration newConfig) { }; private void animateViewPadding(View view, int paddingStart, int paddingEnd, int duration) { - if (view.isPressed() || !mIsWindowAttached) { - view.setPadding(paddingEnd, paddingEnd, paddingEnd, paddingEnd); - return; - } - ValueAnimator animation = ValueAnimator.ofInt(paddingStart, paddingEnd); animation.setDuration(duration); animation.setInterpolator(new AccelerateDecelerateInterpolator()); @@ -396,8 +384,6 @@ public void detachFromWindow() { mViewModel.getIsDownloadsVisible().removeObserver(mIsDownloadsVisible); mViewModel = null; } - - mIsWindowAttached = false; } @Override @@ -422,14 +408,9 @@ public void attachToWindow(@NonNull WindowWidget aWindow) { mBinding.setViewmodel(mViewModel); SessionStore.get().getBookmarkStore().addListener(mBookmarksListener); - - mIsWindowAttached = true; } private Observer mIsBookmarksVisible = aBoolean -> { - if (mBinding.bookmarksButton.isHovered()) { - return; - } if (aBoolean.get()) { animateViewPadding(mBinding.bookmarksButton, mMaxPadding, mMinPadding, ICON_ANIMATION_DURATION); } else { @@ -438,21 +419,14 @@ public void attachToWindow(@NonNull WindowWidget aWindow) { }; private Observer mIsHistoryVisible = aBoolean -> { - if (mBinding.historyButton.isHovered()) { - return; - } if (aBoolean.get()) { animateViewPadding(mBinding.historyButton, mMaxPadding, mMinPadding, ICON_ANIMATION_DURATION); - } else { animateViewPadding(mBinding.historyButton, mMinPadding, mMaxPadding, ICON_ANIMATION_DURATION); } }; private Observer mIsDownloadsVisible = aBoolean -> { - if (mBinding.downloadsButton.isHovered()) { - return; - } if (aBoolean.get()) { animateViewPadding(mBinding.downloadsButton, mMaxPadding, mMinPadding, ICON_ANIMATION_DURATION); } else { @@ -525,15 +499,13 @@ private void showNotification(int notificationId, UIButton button, int stringRes } private void showNotification(int notificationId, UIButton button, String string) { - if (isVisible()) { - NotificationManager.Notification notification = new NotificationManager.Builder(this) - .withView(button) - .withDensity(R.dimen.tray_tooltip_density) - .withString(string) - .withPosition(NotificationManager.Notification.TOP) - .withZTranslation(25.0f).build(); - NotificationManager.show(notificationId, notification); - } + NotificationManager.Notification notification = new NotificationManager.Builder(this) + .withView(button) + .withDensity(R.dimen.tray_tooltip_density) + .withString(string) + .withPosition(NotificationManager.Notification.TOP) + .withZTranslation(25.0f).build(); + NotificationManager.show(notificationId, notification); } private void hideNotifications() { @@ -556,26 +528,16 @@ public void onBookmarkAdded() { @Override public void onDownloadsUpdate(@NonNull List downloads) { - long inProgressNum = downloads.stream().filter(item -> - item.getStatus() == Download.RUNNING || - item.getStatus() == Download.PAUSED || - item.getStatus() == Download.PENDING).count(); + long inProgressNum = downloads.stream().filter(item -> item.getStatus() == Download.RUNNING).count(); mTrayViewModel.setDownloadsNumber((int)inProgressNum); if (inProgressNum == 0) { mBinding.downloadsButton.setLevel(0); } else { - long size = downloads.stream() - .filter(item -> item.getStatus() == Download.RUNNING) - .mapToLong(Download::getSizeBytes) - .sum(); - long downloaded = downloads.stream().filter(item -> item.getStatus() == Download.RUNNING) - .mapToLong(Download::getDownloadedBytes) - .sum(); - if (size > 0) { - long percent = downloaded*100/size; - mBinding.downloadsButton.setLevel((int)percent*100); - } + long size = downloads.stream().filter(item -> item.getStatus() == Download.RUNNING).mapToLong(Download::getSizeBytes).sum(); + long downloaded = downloads.stream().filter(item -> item.getStatus() == Download.RUNNING).mapToLong(Download::getDownloadedBytes).sum(); + long percent = downloaded*100/size; + mBinding.downloadsButton.setLevel((int)percent*100); } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WebXRInterstitialWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WebXRInterstitialWidget.java index 713a143f9..8617f6f2e 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WebXRInterstitialWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WebXRInterstitialWidget.java @@ -19,8 +19,6 @@ public class WebXRInterstitialWidget extends UIWidget implements WidgetManagerDe private ArrayList mControllers = new ArrayList<>(); private boolean firstEnterXR = true; private AnimatedVectorDrawable mSpinnerAnimation; - private boolean mWebXRRendering = false; - private boolean mInterstitialDismissed = false; public WebXRInterstitialWidget(Context aContext) { super(aContext); @@ -93,8 +91,6 @@ private void initializeControllers() { addController(DeviceType.PicoNeo2, WebXRInterstitialController.HAND_RIGHT); } else if (deviceType == DeviceType.PicoG2) { addController(DeviceType.PicoG2, WebXRInterstitialController.HAND_NONE); - } else if (deviceType == DeviceType.ViveFocus) { - addController(DeviceType.ViveFocus, WebXRInterstitialController.HAND_NONE); } else if (deviceType == DeviceType.ViveFocusPlus) { addController(DeviceType.ViveFocusPlus, WebXRInterstitialController.HAND_LEFT); addController(DeviceType.ViveFocusPlus, WebXRInterstitialController.HAND_RIGHT); @@ -137,7 +133,7 @@ public void onEnterWebXR() { showControllers(); // Add some delay to duplicated input detection conflicts with the EnterVR button. postDelayed(() -> { - if (mWidgetManager != null && !mWidgetManager.isWebXRIntersitialHidden()) { + if (mWidgetManager != null) { mWidgetManager.setWebXRIntersitialState(WidgetManagerDelegate.WEBXR_INTERSTITIAL_ALLOW_DISMISS); } }, 50); @@ -155,22 +151,8 @@ public void onExitWebXR() { @Override public void onDismissWebXRInterstitial() { - mInterstitialDismissed = true; setHowToVisible(false); hideControllers(); - if (!mWebXRRendering) { - stopAnimation(); - } mWidgetManager.updateWidget(this); } - - @Override - public void onWebXRRenderStateChange(boolean aRendering) { - mWebXRRendering = aRendering; - if (aRendering && mInterstitialDismissed) { - stopAnimation(); - } else if (!aRendering) { - startAnimation(); - } - } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WidgetManagerDelegate.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WidgetManagerDelegate.java index 9b7b5d69e..0405ca0f1 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WidgetManagerDelegate.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WidgetManagerDelegate.java @@ -33,7 +33,6 @@ interface WebXRListener { void onEnterWebXR(); void onExitWebXR(); void onDismissWebXRInterstitial(); - void onWebXRRenderStateChange(boolean aRendering); } float DEFAULT_DIM_BRIGHTNESS = 0.25f; @@ -92,7 +91,6 @@ interface WebXRListener { void addWebXRListener(WebXRListener aListener); void removeWebXRListener(WebXRListener aListener); void setWebXRIntersitialState(@WebXRInterstitialState int aState); - boolean isWebXRIntersitialHidden(); boolean isPermissionGranted(@NonNull String permission); void requestPermission(String uri, @NonNull String permission, GeckoSession.PermissionDelegate.Callback aCallback); boolean canOpenNewWindow(); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java index 4b933ec53..b91c246ee 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java @@ -492,12 +492,8 @@ public void switchPanel(@NonNull Windows.PanelType panelType) { case BOOKMARKS: if (mViewModel.getIsHistoryVisible().getValue().get() || mViewModel.getIsDownloadsVisible().getValue().get()) { - if (isHistoryVisible()) { - hidePanel(Windows.PanelType.HISTORY, false); - } - if (isDownloadsVisible()) { - hidePanel(Windows.PanelType.DOWNLOADS, false); - } + hidePanel(Windows.PanelType.HISTORY, false); + hidePanel(Windows.PanelType.DOWNLOADS, false); showPanel(Windows.PanelType.BOOKMARKS, false); } else if (mViewModel.getIsBookmarksVisible().getValue().get()) { @@ -510,12 +506,8 @@ public void switchPanel(@NonNull Windows.PanelType panelType) { case HISTORY: if (mViewModel.getIsBookmarksVisible().getValue().get() || mViewModel.getIsDownloadsVisible().getValue().get()) { - if (isBookmarksVisible()) { - hidePanel(Windows.PanelType.BOOKMARKS, false); - } - if (isDownloadsVisible()) { - hidePanel(Windows.PanelType.DOWNLOADS, false); - } + hidePanel(Windows.PanelType.BOOKMARKS, false); + hidePanel(Windows.PanelType.DOWNLOADS, false); showPanel(Windows.PanelType.HISTORY, false); } else if (mViewModel.getIsHistoryVisible().getValue().get()) { @@ -528,12 +520,8 @@ public void switchPanel(@NonNull Windows.PanelType panelType) { case DOWNLOADS: if (mViewModel.getIsBookmarksVisible().getValue().get() || mViewModel.getIsHistoryVisible().getValue().get()) { - if (isBookmarksVisible()) { - hidePanel(Windows.PanelType.BOOKMARKS, false); - } - if (isHistoryVisible()) { - hidePanel(Windows.PanelType.HISTORY, false); - } + hidePanel(Windows.PanelType.BOOKMARKS, false); + hidePanel(Windows.PanelType.HISTORY, false); showPanel(Windows.PanelType.DOWNLOADS, false); } else if (mViewModel.getIsDownloadsVisible().getValue().get()) { @@ -1129,9 +1117,12 @@ public void setSession(@NonNull Session aSession, @OldSessionDisplayAction int a } else { onCurrentSessionChange(null, aSession.getGeckoSession()); } + setupListeners(mSession); for (WindowListener listener: mListeners) { listener.onSessionChanged(oldSession, aSession); } + + } mCaptureOnPageStop = false; hideLibraryPanels(); @@ -1158,17 +1149,11 @@ public void onCurrentSessionChange(GeckoSession aOldSession, GeckoSession aSessi @Override public void onStackSession(Session aSession) { - if (aSession == mSession) { - Log.e(LOGTAG, "Attempting to stack same session."); - return; - } // e.g. tab opened via window.open() aSession.updateLastUse(); Session current = mSession; - setupListeners(aSession); setSession(aSession); SessionStore.get().setActiveSession(aSession); - aSession.setActive(true); current.captureBackgroundBitmap(getWindowWidth(), getWindowHeight()).thenAccept(aVoid -> current.setActive(false)); mWidgetManager.getWindows().showTabAddedNotification(); @@ -1179,7 +1164,6 @@ public void onStackSession(Session aSession) { public void onUnstackSession(Session aSession, Session aParent) { if (mSession == aSession) { aParent.setActive(true); - setupListeners(aParent); setSession(aParent); SessionStore.get().setActiveSession(aParent); SessionStore.get().destroySession(aSession); @@ -1281,10 +1265,10 @@ public void showAlert(String title, @NonNull String msg, @Nullable PromptDialogW } mAlertDialog.setTitle(title); mAlertDialog.setBody(msg); - mAlertDialog.setButtonsDelegate((index, isChecked) -> { + mAlertDialog.setButtonsDelegate(index -> { mAlertDialog.hide(REMOVE_WIDGET); if (callback != null) { - callback.onButtonClicked(index, isChecked); + callback.onButtonClicked(index); } mAlertDialog.releaseWidget(); mAlertDialog = null; @@ -1361,10 +1345,10 @@ public void showConfirmPrompt(@DrawableRes int icon, mConfirmDialog.setTitle(title); mConfirmDialog.setBody(msg); mConfirmDialog.setButtons(btnMsg); - mConfirmDialog.setButtonsDelegate((index, isChecked) -> { + mConfirmDialog.setButtonsDelegate(index -> { mConfirmDialog.hide(REMOVE_WIDGET); if (callback != null) { - callback.onButtonClicked(index, isChecked); + callback.onButtonClicked(index); } mConfirmDialog.releaseWidget(); mConfirmDialog = null; @@ -1387,10 +1371,10 @@ public void showDialog(@NonNull String title, @StringRes int description, @NonN mAppDialog.setTitle(title); mAppDialog.setBody(description); mAppDialog.setButtons(btnMsg); - mAppDialog.setButtonsDelegate((index, isChecked) -> { + mAppDialog.setButtonsDelegate(index -> { mAppDialog.hide(REMOVE_WIDGET); if (buttonsCallback != null) { - buttonsCallback.onButtonClicked(index, isChecked); + buttonsCallback.onButtonClicked(index); } mAppDialog.releaseWidget(); }); @@ -1410,12 +1394,12 @@ public void showFirstTimeDrmDialog(@NonNull Runnable callback) { showConfirmPrompt( R.drawable.ic_icon_drm_allowed, getContext().getString(R.string.drm_first_use_title_v1), - getContext().getString(R.string.drm_first_use_body_v2, getResources().getString(R.string.sumo_drm_url)), + getContext().getString(R.string.drm_first_use_body_v1, getResources().getString(R.string.sumo_drm_url)), new String[]{ getContext().getString(R.string.drm_first_use_do_not_allow), getContext().getString(R.string.drm_first_use_allow), }, - (index, isChecked) -> { + index -> { // We remove the prefs listener before the first DRM update to avoid reloading the session mPrefs.unregisterOnSharedPreferenceChangeListener(this); SettingsStore.getInstance(getContext()).setDrmContentPlaybackEnabled(index == PromptDialogWidget.POSITIVE); @@ -1557,7 +1541,7 @@ public void startDownload(@NonNull DownloadJob downloadJob, boolean showConfirmD new String[]{ getResources().getString(R.string.download_confirm_cancel), getResources().getString(R.string.download_confirm_download)}, - (index, isChecked) -> { + index -> { if (index == PromptDialogWidget.POSITIVE) { mDownloadsManager.startDownload(downloadJob); } @@ -1605,19 +1589,10 @@ public void onFullScreen(@NonNull GeckoSession session, boolean aFullScreen) { public void onContextMenu(GeckoSession session, int screenX, int screenY, ContextElement element) { hideContextMenus(); - // We don't show the menu for blobs - if (UrlUtils.isBlobUri(element.srcUri)) { - return; - } - mContextMenu = new ContextMenuWidget(getContext()); mContextMenu.mWidgetPlacement.parentHandle = getHandle(); mContextMenu.setDismissCallback(this::hideContextMenus); mContextMenu.setContextElement(element); - if (!mContextMenu.hasActions()) { - hideContextMenus(); - return; - } mContextMenu.show(REQUEST_FOCUS); mWidgetPlacement.tintColor = 0x555555FF; @@ -1669,7 +1644,7 @@ public void onExternalResponse(@NonNull GeckoSession geckoSession, @NonNull Geck new String[]{ getResources().getString(R.string.download_open_file_unsupported_cancel), getResources().getString(R.string.download_open_file_unsupported_open) - }, (index, isChecked) -> { + }, index -> { if (index == PromptDialogWidget.POSITIVE) { Uri contentUri = FileProvider.getUriForFile( getContext(), @@ -1748,6 +1723,8 @@ public void onPlaybackStateChange(@NonNull MediaElement mediaElement, int state) @Override public void onPageStart(@NonNull GeckoSession geckoSession, @NonNull String aUri) { mCaptureOnPageStop = true; + + mViewModel.setUrl(aUri); mViewModel.setIsLoading(true); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java index 4a077cd9c..bf6a4f950 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java @@ -194,9 +194,7 @@ public void saveState() { ArrayList sessions = SessionStore.get().getSortedSessions(false); state.tabs = sessions.stream() .map(Session::getSessionState) - .filter(sessionState -> SAVE_BLACKLIST.stream().noneMatch(uri -> - sessionState.mUri != null && sessionState.mUri.startsWith(uri) - )) + .filter(sessionState -> SAVE_BLACKLIST.stream().noneMatch(uri -> sessionState.mUri.startsWith(uri))) .collect(Collectors.toCollection(ArrayList::new)); for (WindowWidget window : mRegularWindows) { if (window.getSession() != null) { @@ -1213,9 +1211,7 @@ public void onTabSelect(Session aTab) { Session moveTo = targetWindow.getSession(); moveFrom.surfaceDestroyed(); moveTo.surfaceDestroyed(); - windowToMove.setupListeners(moveTo); windowToMove.setSession(moveTo, WindowWidget.SESSION_DO_NOT_RELEASE_DISPLAY); - targetWindow.setupListeners(moveFrom); targetWindow.setSession(moveFrom, WindowWidget.SESSION_DO_NOT_RELEASE_DISPLAY); SessionStore.get().setActiveSession(targetWindow.getSession()); windowToMove.setActiveWindow(false); @@ -1224,7 +1220,6 @@ public void onTabSelect(Session aTab) { } else { setFirstPaint(targetWindow, aTab); targetWindow.getSession().setActive(false); - targetWindow.setupListeners(aTab); aTab.setActive(true); targetWindow.setSession(aTab); SessionStore.get().setActiveSession(aTab); @@ -1239,7 +1234,6 @@ public void addTab(@NonNull WindowWidget targetWindow, @Nullable String aUri) { Session session = SessionStore.get().createSuspendedSession(aUri, targetWindow.getSession().isPrivateMode()); setFirstPaint(targetWindow, session); targetWindow.getSession().setActive(false); - targetWindow.setupListeners(session); session.setActive(true); targetWindow.setSession(session); if (aUri == null || aUri.isEmpty()) { @@ -1303,7 +1297,6 @@ public void onTabsClose(ArrayList aTabs) { Session tab = available.get(0); if (tab != null) { setFirstPaint(window, tab); - window.setupListeners(tab); tab.setActive(true); window.setSession(tab); } @@ -1343,7 +1336,6 @@ public void onTabsReceived(@NonNull List aTabs) { if (i == 0 && !fullscreen) { // Set the first received tab of the list the current one. SessionStore.get().setActiveSession(session); - targetWindow.setupListeners(session); targetWindow.getSession().setActive(false); targetWindow.setSession(session); } @@ -1368,7 +1360,7 @@ public void onTabsReceived(@NonNull List aTabs) { mNoInternetDialog.setDescriptionVisible(false); mNoInternetDialog.setTitle(R.string.no_internet_title); mNoInternetDialog.setBody(R.string.no_internet_message); - mNoInternetDialog.setButtonsDelegate((index, isChecked) -> { + mNoInternetDialog.setButtonsDelegate(index -> { mNoInternetDialog.hide(UIWidget.REMOVE_WIDGET); mNoInternetDialog.releaseWidget(); mNoInternetDialog = null; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/CrashDialogWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/CrashDialogWidget.java index 08f18e835..5af8a44ea 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/CrashDialogWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/CrashDialogWidget.java @@ -48,7 +48,7 @@ public void updateUI() { R.string.do_not_sent_button, R.string.send_data_button }); - setButtonsDelegate((index, isChecked) -> { + setButtonsDelegate(index -> { if (index == PromptDialogWidget.NEGATIVE) { if (mFiles != null) { SystemUtils.clearCrashFiles(getContext(), mFiles); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PermissionWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PermissionWidget.java index 8d2c8ca21..706100edf 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PermissionWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PermissionWidget.java @@ -43,7 +43,7 @@ public void updateUI() { R.string.permission_reject, R.string.permission_allow }); - setButtonsDelegate((index, isChecked) -> { + setButtonsDelegate(index -> { if (index == PromptDialogWidget.NEGATIVE) { // Do not allow handlePermissionResult(false); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PromptDialogWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PromptDialogWidget.java index 30970f2ea..df83a1f86 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PromptDialogWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/PromptDialogWidget.java @@ -24,7 +24,7 @@ public class PromptDialogWidget extends UIDialog { public interface Delegate { - void onButtonClicked(int index, boolean isChecked); + void onButtonClicked(int index); default void onDismiss() {} } @@ -54,12 +54,12 @@ public void updateUI() { mBinding.leftButton.setOnClickListener(v -> { if (mAppDialogDelegate != null) { - mAppDialogDelegate.onButtonClicked(NEGATIVE, isChecked()); + mAppDialogDelegate.onButtonClicked(NEGATIVE); } }); mBinding.rightButton.setOnClickListener(v -> { if (mAppDialogDelegate != null) { - mAppDialogDelegate.onButtonClicked(POSITIVE, isChecked()); + mAppDialogDelegate.onButtonClicked(POSITIVE); } }); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/RestartDialogWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/RestartDialogWidget.java index 49fd81f88..d7f2d749e 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/RestartDialogWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/RestartDialogWidget.java @@ -25,7 +25,7 @@ public void updateUI() { R.string.restart_later_dialog_button, R.string.restart_now_dialog_button }); - setButtonsDelegate((index, isChecked) -> { + setButtonsDelegate(index -> { if (index == PromptDialogWidget.NEGATIVE) { onDismiss(); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SignOutDialogWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SignOutDialogWidget.java index aa3400a64..b994f75a7 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SignOutDialogWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SignOutDialogWidget.java @@ -47,7 +47,7 @@ public void updateUI() { R.string.fxa_signout_confirmation_signout, R.string.fxa_signout_confirmation_cancel }); - setButtonsDelegate((index, isChecked) -> { + setButtonsDelegate(index -> { if (index == PromptDialogWidget.NEGATIVE) { try { Objects.requireNonNull(mAccounts.logoutAsync()).thenAcceptAsync(unit -> { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/VoiceSearchWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/VoiceSearchWidget.java index f11f8515e..a63e0a750 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/VoiceSearchWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/VoiceSearchWidget.java @@ -296,7 +296,7 @@ public void show(@ShowFlags int aShowFlags) { new int[]{ R.string.voice_samples_collect_dialog_do_not_allow, R.string.voice_samples_collect_dialog_allow}, - (index, isChecked) -> { + index -> { SettingsStore.getInstance(getContext()).setSpeechDataCollectionReviewed(true); if (index == PromptDialogWidget.POSITIVE) { SettingsStore.getInstance(getContext()).setSpeechDataCollectionEnabled(true); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/WhatsNewWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/WhatsNewWidget.java index 5bdb74860..d46114bf2 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/WhatsNewWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/WhatsNewWidget.java @@ -46,7 +46,7 @@ public void updateUI() { R.string.whats_new_button_start_browsing, R.string.whats_new_button_sign_in }); - setButtonsDelegate((index, isChecked) -> { + setButtonsDelegate(index -> { if (index == PromptDialogWidget.NEGATIVE) { onDismiss(); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/ContextMenuWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/ContextMenuWidget.java index cdd858f49..70945a478 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/ContextMenuWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/ContextMenuWidget.java @@ -10,7 +10,6 @@ import android.content.Context; import android.content.res.Configuration; import android.net.Uri; -import android.webkit.URLUtil; import androidx.annotation.StringRes; @@ -21,10 +20,8 @@ import org.mozilla.vrbrowser.ui.widgets.WidgetManagerDelegate; import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement; import org.mozilla.vrbrowser.utils.StringUtils; -import org.mozilla.vrbrowser.utils.UrlUtils; import java.util.ArrayList; -import java.util.function.Predicate; public class ContextMenuWidget extends MenuWidget { ArrayList mItems; @@ -76,46 +73,38 @@ protected void onDismiss() { } } - public boolean hasActions() { - return mItems.stream().anyMatch(menuItem -> menuItem.mCallback != null); - } - public void setDismissCallback(Runnable aCallback) { mDismissCallback = aCallback; } public void setContextElement(ContextElement aContextElement) { mItems = new ArrayList<>(); + mItems.add(new MenuWidget.MenuItem(aContextElement.linkUri, 0, null)); final WidgetManagerDelegate widgetManager = mWidgetManager; - if (aContextElement.linkUri != null && !aContextElement.linkUri.isEmpty()) { - mItems.add(new MenuWidget.MenuItem(aContextElement.linkUri, 0, null)); - if (mWidgetManager.canOpenNewWindow()) { - mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_open_new_window_1), 0, () -> { - if (!StringUtils.isEmpty(aContextElement.linkUri)) { - widgetManager.openNewWindow(aContextElement.linkUri); - } - onDismiss(); - })); - } - mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_open_new_tab_1), 0, () -> { + if (mWidgetManager.canOpenNewWindow()) { + mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_open_new_window_1), 0, () -> { if (!StringUtils.isEmpty(aContextElement.linkUri)) { - widgetManager.openNewTab(aContextElement.linkUri); - GleanMetricsService.Tabs.openedCounter(GleanMetricsService.Tabs.TabSource.CONTEXT_MENU); + widgetManager.openNewWindow(aContextElement.linkUri); } onDismiss(); })); + } + mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_open_new_tab_1), 0, () -> { if (!StringUtils.isEmpty(aContextElement.linkUri)) { - mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_download_link), 0, () -> { - DownloadJob job = DownloadJob.fromLink(aContextElement); - widgetManager.getFocusedWindow().startDownload(job, false); - // TODO Add Download from context menu Telemetry - onDismiss(); - })); + widgetManager.openNewTab(aContextElement.linkUri); + GleanMetricsService.Tabs.openedCounter(GleanMetricsService.Tabs.TabSource.CONTEXT_MENU); } - } else { - mItems.add(new MenuWidget.MenuItem(aContextElement.srcUri, 0, null)); + onDismiss(); + })); + if (!StringUtils.isEmpty(aContextElement.linkUri)) { + mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_download_link), 0, () -> { + DownloadJob job = DownloadJob.fromLink(aContextElement); + widgetManager.getFocusedWindow().startDownload(job, false); + // TODO Add Download from context menu Telemetry + onDismiss(); + })); } - if (URLUtil.isNetworkUrl(aContextElement.srcUri)) { + if (!StringUtils.isEmpty(aContextElement.srcUri)) { @StringRes int srcText; switch (aContextElement.type) { case ContextElement.TYPE_IMAGE: @@ -138,35 +127,33 @@ public void setContextElement(ContextElement aContextElement) { onDismiss(); })); } - if (URLUtil.isNetworkUrl(aContextElement.linkUri) || URLUtil.isNetworkUrl(aContextElement.srcUri)) { - mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_copy_link), 0, () -> { - ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE); - Uri uri; - if (aContextElement.linkUri != null) { - uri = Uri.parse(aContextElement.linkUri); - - } else { - uri = Uri.parse(aContextElement.srcUri); + mItems.add(new MenuWidget.MenuItem(getContext().getString(R.string.context_menu_copy_link), 0, () -> { + ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE); + Uri uri; + if (aContextElement.linkUri != null) { + uri = Uri.parse(aContextElement.linkUri); + + } else { + uri = Uri.parse(aContextElement.srcUri); + } + if (uri != null) { + String label = aContextElement.title; + if (StringUtils.isEmpty(label)) { + label = aContextElement.altText; } - if (uri != null) { - String label = aContextElement.title; - if (StringUtils.isEmpty(label)) { - label = aContextElement.altText; - } - if (StringUtils.isEmpty(label)) { - label = aContextElement.altText; - } - if (StringUtils.isEmpty(label)) { - label = uri.toString(); - } - ClipData clip = ClipData.newRawUri(label, uri); - if (clipboard != null) { - clipboard.setPrimaryClip(clip); - } + if (StringUtils.isEmpty(label)) { + label = aContextElement.altText; } - onDismiss(); - })); - } + if (StringUtils.isEmpty(label)) { + label = uri.toString(); + } + ClipData clip = ClipData.newRawUri(label, uri); + if (clipboard != null) { + clipboard.setPrimaryClip(clip); + } + } + onDismiss(); + })); updateMenuItems(mItems); mWidgetPlacement.height = mItems.size() * WidgetPlacement.dpDimension(getContext(), R.dimen.context_menu_row_height); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/library/SortingContextMenuWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/library/SortingContextMenuWidget.java index 3a7b07665..9680fcf89 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/library/SortingContextMenuWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/menus/library/SortingContextMenuWidget.java @@ -15,7 +15,7 @@ public class SortingContextMenuWidget extends MenuWidget { - @IntDef(value = {SORT_FILENAME_AZ, SORT_FILENAME_ZA, SORT_DATE_ASC, SORT_DATE_DESC, SORT_SIZE_ASC, SORT_SIZE_DESC}) + @IntDef(value = {SORT_FILENAME_AZ, SORT_FILENAME_ZA, SORT_DATE_ASC, SORT_DATE_DESC}) public @interface Order {} public static final int SORT_FILENAME_AZ = 0; public static final int SORT_FILENAME_ZA = 1; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/PrivacyOptionsView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/PrivacyOptionsView.java index e28fe22e9..e3f32a3c8 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/PrivacyOptionsView.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/PrivacyOptionsView.java @@ -215,7 +215,7 @@ private void resetOptions() { setDrmContent(SettingsStore.DRM_PLAYBACK_DEFAULT, true); } - if (!mBinding.trackingProtectionRadio.getValueForId(mBinding.trackingProtectionRadio.getCheckedRadioButtonId()).equals(SettingsStore.TRACKING_DEFAULT)) { + if (!mBinding.trackingProtectionRadio.getValueForId(mBinding.trackingProtectionRadio.getCheckedRadioButtonId()).equals(SettingsStore.MSAA_DEFAULT_LEVEL)) { setTrackingProtection(mBinding.trackingProtectionRadio.getIdForValue(SettingsStore.TRACKING_DEFAULT), true); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsView.java index 59aa16c74..1071c7f8e 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsView.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsView.java @@ -85,7 +85,6 @@ public void onShown() { if (mScrollbar != null) { mScrollbar.fullScroll(ScrollView.FOCUS_UP); mScrollbar.setSmoothScrollingEnabled(true); - mScrollbar.smoothScrollTo(0,0); } setFocusableInTouchMode(true); diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsWidget.java index 913ff4405..6bf8563bf 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SettingsWidget.java @@ -432,7 +432,7 @@ public void showView(SettingsView.SettingViewType aType) { showView(new ControllerOptionsView(getContext(), mWidgetManager)); break; case TRACKING_EXCEPTION: - showView(new TrackingPermissionsOptionsView(getContext(), mWidgetManager)); + showView(new SitePermissionsOptionsView(getContext(), mWidgetManager, SitePermission.SITE_PERMISSION_TRACKING)); break; } } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SitePermissionsOptionsView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SitePermissionsOptionsView.java index 7f0733d01..9f21bdd27 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SitePermissionsOptionsView.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/SitePermissionsOptionsView.java @@ -32,8 +32,8 @@ class SitePermissionsOptionsView extends SettingsView { private OptionsExceptionsBinding mBinding; - protected SitePermissionAdapter mAdapter; - protected SitePermissionViewModel mViewModel; + private SitePermissionAdapter mAdapter; + private SitePermissionViewModel mViewModel; private @SitePermission.Category int mCategory; public SitePermissionsOptionsView(Context aContext, WidgetManagerDelegate aWidgetManager, @SitePermission.Category int category) { @@ -42,7 +42,9 @@ public SitePermissionsOptionsView(Context aContext, WidgetManagerDelegate aWidge initialize(aContext); } - protected void initialize(Context aContext) { + private void initialize(Context aContext) { + LayoutInflater inflater = LayoutInflater.from(aContext); + // Preferred languages adapter mAdapter = new SitePermissionAdapter(getContext(), mCallback); @@ -93,7 +95,7 @@ protected void updateUI() { mBinding.executePendingBindings(); } - protected OnClickListener mClearAllListener = (view) -> { + private OnClickListener mClearAllListener = (view) -> { reset(); }; @@ -156,7 +158,7 @@ public void onChanged(List sites) { } }; - protected PermissionSiteItemCallback mCallback = new PermissionSiteItemCallback() { + private PermissionSiteItemCallback mCallback = new PermissionSiteItemCallback() { @Override public void onDelete(@NonNull SitePermission item) { mViewModel.deleteSite(item); @@ -164,7 +166,7 @@ public void onDelete(@NonNull SitePermission item) { } }; - protected void reloadIfSameDomain(String aHost) { + private void reloadIfSameDomain(String aHost) { if (mCategory != SitePermission.SITE_PERMISSION_WEBXR) { return; } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/TrackingPermissionsOptionsView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/TrackingPermissionsOptionsView.java deleted file mode 100644 index b4f6406d9..000000000 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/TrackingPermissionsOptionsView.java +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- - * 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/. */ - -package org.mozilla.vrbrowser.ui.widgets.settings; - -import android.content.Context; - -import org.mozilla.vrbrowser.browser.content.TrackingProtectionStore; -import org.mozilla.vrbrowser.browser.engine.SessionStore; -import org.mozilla.vrbrowser.ui.widgets.WidgetManagerDelegate; - -import static org.mozilla.vrbrowser.db.SitePermission.SITE_PERMISSION_TRACKING; - -class TrackingPermissionsOptionsView extends SitePermissionsOptionsView { - - private TrackingProtectionStore mTrackingProtectionStore; - - public TrackingPermissionsOptionsView(Context aContext, WidgetManagerDelegate aWidgetManager) { - super(aContext, aWidgetManager, SITE_PERMISSION_TRACKING); - - mTrackingProtectionStore = SessionStore.get().getTrackingProtectionStore(); - } - - protected void initialize(Context aContext) { - mCallback = item -> mTrackingProtectionStore.remove(item); - - super.initialize(aContext); - } - - @Override - protected boolean reset() { - mTrackingProtectionStore.removeAll(); - return true; - } -} diff --git a/app/src/common/shared/org/mozilla/vrbrowser/utils/DeviceType.java b/app/src/common/shared/org/mozilla/vrbrowser/utils/DeviceType.java index 55446b4a1..9a43e6c14 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/utils/DeviceType.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/utils/DeviceType.java @@ -8,15 +8,14 @@ public class DeviceType { // These values need to match those in Device.h - @IntDef(value = { Unknown, OculusGo, OculusQuest, ViveFocus, ViveFocusPlus, PicoNeo2, PicoG2 }) + @IntDef(value = { Unknown, OculusGo, OculusQuest, ViveFocusPlus, PicoNeo2, PicoG2 }) public @interface Type {} public static final int Unknown = 0; public static final int OculusGo = 1; public static final int OculusQuest = 2; - public static final int ViveFocus = 3; - public static final int ViveFocusPlus = 4; - public static final int PicoNeo2 = 6; - public static final int PicoG2 = 7; + public static final int ViveFocusPlus = 3; + public static final int PicoNeo2 = 4; + public static final int PicoG2 = 5; private static @Type int mType = Unknown; @@ -29,9 +28,6 @@ public static void setType(@Type int aType) { case OculusQuest: name = "Oculus Quest"; break; - case ViveFocus: - name = "Vive Focus"; - break; case ViveFocusPlus: name = "Vive Focus Plus"; break; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java b/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java index 2e6494dee..627bc522b 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java @@ -15,7 +15,6 @@ import org.mozilla.vrbrowser.R; import org.mozilla.vrbrowser.browser.SettingsStore; -import java.io.File; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; @@ -115,10 +114,6 @@ public static Boolean isFileUri(@Nullable String aUri) { return aUri != null && aUri.startsWith("file"); } - public static Boolean isBlobUri(@Nullable String aUri) { - return aUri != null && aUri.startsWith("blob"); - } - public static Boolean isBlankUri(@Nullable Context context, @Nullable String aUri) { return context != null && aUri != null && aUri.equals(context.getString(R.string.about_blank)); } @@ -129,22 +124,16 @@ public static String titleBarUrl(@Nullable String aUri) { } if (URLUtil.isValidUrl(aUri)) { - if (UrlUtils.isFileUri(aUri)) { - File file = new File(aUri); - return file.getName(); - - } else { - try { - URI uri = URI.create(aUri); - URL url = new URL( - uri.getScheme() != null ? uri.getScheme() : "", - uri.getAuthority() != null ? uri.getAuthority() : "", - ""); - return url.toString(); - - } catch (MalformedURLException | IllegalArgumentException e) { - return ""; - } + try { + URI uri = URI.create(aUri); + URL url = new URL( + uri.getScheme() != null ? uri.getScheme() : "", + uri.getAuthority() != null ? uri.getAuthority() : "", + ""); + return url.toString(); + + } catch (MalformedURLException | IllegalArgumentException e) { + return ""; } } else { diff --git a/app/src/main/assets/searchplugins/google-b-1-m.xml b/app/src/main/assets/searchplugins/google-b-1-m.xml deleted file mode 100644 index 741475e05..000000000 --- a/app/src/main/assets/searchplugins/google-b-1-m.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - -Google -UTF-8 -data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAB71BMVEUAAAD29vb29vb29vb39/f////39/f19fXqQzU0qFNChfT7vAX09PRjmvSVufXqSDr19PTywr41qVRVtnDrT0Lv8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7r8l0d5LJdA+DcRryCQzmrmj7ktCIDEATHZXn967/8eSCfX5Aty/KvT2KQlXi0zYI0eYPcD0FBuaF4hSA4JQdY/7aRP4sMggvOy0F+fBHFpJJtFxyWN2n6KLqQYYH+Ljgqq1gtN5qvYFdwUi1owrvobioX4So6oxacRRhRVPbDgnNqwQlewV5YkK0WHOMV7IMFOWpBGq+gFRbkqgVHeAWFZguSza6iZLMbudDsbtpq9o0WDQiAoQIWtCC+wW6xDCsQradNLbiEDXa04fr3aykTQTS3qwUFPBPO91pJsnVDggPq/HykhzJlvkuQ/GRAgmRdL8UFCnnSfyMFKKPn76EPpkqoZcvPt1KQuWLoAvAmgBden+ulTTwplPwWTf4VhEFeOi7aJBXVSugKKiLUELz4fSRpyYwLlZ+vyW9rZlv8orhancHbTe6hReTpDH4AGZZ0JIzj1ZQ6M6jNb89jFiCPpMdeoa2n61U+yfYQGOhCPwT2NkgY9dV3U4NVWDruCXSDl9dUd/EFRH4IJBqGbBIJ35z3tD1L9V3tHcqSSKE9iFdJbCTcp7QwTYAyJEZe/O1LlxVeQQqzwX4jKupgHuIVIKWa1dAwSMyHX0hNsRq8BaQ/yPBKbaieKf9pCimf6aVgqgeO9w0jSj4gQEpFFpBf04sAAUDcgwZKfGYpVF5AIMWjXnK6LaMPKMr8crxvym7T38I1Famhu/gWXu8Xl1Vl+sehBJsvy14zM1pKm0gV0zco/t89HGT+Npf5G3WGtxp3vA38GN/u3fkNa8DAVcD0QwPmH3uw8BTl/5HF9KMn8OEZfjSHZ0w//vMHVqViODGkXAcAAAAASUVORK5CYII= - - - - - - - -https://www.google.com - diff --git a/app/src/main/assets/searchplugins/google-b-m.xml b/app/src/main/assets/searchplugins/google-b-m.xml deleted file mode 100644 index a8fb41d7d..000000000 --- a/app/src/main/assets/searchplugins/google-b-m.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - -Google -UTF-8 -data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAB71B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/6aDEO4c6wl82zXiXGP6/0rIKprH4pcnOrV3uJuSD7bBCDbmPLZivWwyBstnFXTqx5864ujf72bIRwKhCZ7r8l0d5LJdA+DcRryCQzmrmj7ktCIDEATHZXn967/8eSCfX5Aty/KvT2KQlXi0zYI0eYPcD0FBuaF4hSA4JQdY/7aRP4sMggvOy0F+fBHFpJJtFxyWN2n6KLqQYYH+Ljgqq1gtN5qvYFdwUi1owrvobioX4So6oxacRRhRVPbDgnNqwQlewV5YkK0WHOMV7IMFOWpBGq+gFRbkqgVHeAWFZguSza6iZLMbudDsbtpq9o0WDQiAoQIWtCC+wW6xDCsQradNLbiEDXa04fr3aykTQTS3qwUFPBPO91pJsnVDggPq/HykhzJlvkuQ/GRAgmRdL8UFCnnSfyMFKKPn76EPpkqoZcvPt1KQuWLoAvAmgBden+ulTTwplPwWTf4VhEFeOi7aJBXVSugKKiLUELz4fSRpyYwLlZ+vyW9rZlv8orhancHbTe6hReTpDH4AGZZ0JIzj1ZQ6M6jNb89jFiCPpMdeoa2n61U+yfYQGOhCPwT2NkgY9dV3U4NVWDruCXSDl9dUd/EFRH4IJBqGbBIJ35z3tD1L9V3tHcqSSKE9iFdJbCTcp7QwTYAyJEZe/O1LlxVeQQqzwX4jKupgHuIVIKWa1dAwSMyHX0hNsRq8BaQ/yPBKbaieKf9pCimf6aVgqgeO9w0jSj4gQEpFFpBf04sAAUDcgwZKfGYpVF5AIMWjXnK6LaMPKMr8crxvym7T38I1Famhu/gWXu8Xl1Vl+sehBJsvy14zM1pKm0gV0zco/t89HGT+Npf5G3WGtxp3vA38GN/u3fkNa8DAVcD0QwPmH3uw8BTl/5HF9KMn8OEZfjSHZ0w//vMHVqViODGkXAcAAAAASUVORK5CYII= - - - - - - - -https://www.google.com - diff --git a/app/src/main/assets/web_extensions/webcompat_youtube/main.css b/app/src/main/assets/web_extensions/webcompat_youtube/main.css index e37f65048..4a07c8f58 100644 --- a/app/src/main/assets/web_extensions/webcompat_youtube/main.css +++ b/app/src/main/assets/web_extensions/webcompat_youtube/main.css @@ -60,3 +60,15 @@ div.ytp-fullscreen video, .fxr-vr-video { height: 100% !important; position: relative !important; } + + +/* + Force a fixed height so that Youtube mini player can have a scrollbar + for items in queue. +*/ +#card #items +{ + display: block; + height: 70%; + overflow-y:scroll; +} diff --git a/app/src/main/assets/web_extensions/webcompat_youtube/main.js b/app/src/main/assets/web_extensions/webcompat_youtube/main.js index 52eb0f8dd..0b23f6a59 100644 --- a/app/src/main/assets/web_extensions/webcompat_youtube/main.js +++ b/app/src/main/assets/web_extensions/webcompat_youtube/main.js @@ -173,10 +173,7 @@ class YoutubeExtension { // Get's the preferred video qualities for the current device. getPreferredQualities() { - // Disable 5k video until issue can be resolved in Gecko Media Process - // see https://github.com/MozillaReality/FirefoxReality/issues/3193 - // let all = ['hd2880', 'hd2160','hd1440', 'hd1080', 'hd720', 'large', 'medium']; - let all = ['hd2160','hd1440', 'hd1080', 'hd720', 'large', 'medium']; + let all = ['hd2880', 'hd2160','hd1440', 'hd1080', 'hd720', 'large', 'medium']; return all; } diff --git a/app/src/main/cpp/BrowserWorld.cpp b/app/src/main/cpp/BrowserWorld.cpp index 7bb2332cf..cdb18964f 100644 --- a/app/src/main/cpp/BrowserWorld.cpp +++ b/app/src/main/cpp/BrowserWorld.cpp @@ -189,7 +189,6 @@ struct BrowserWorld::State { std::function frameEndHandler; bool wasInGazeMode = false; WebXRInterstialState webXRInterstialState; - bool wasWebXRRendering = false; State() : paused(true), glInitialized(false), modelsLoaded(false), env(nullptr), cylinderDensity(0.0f), nearClip(0.1f), farClip(300.0f), activity(nullptr), windowsInitialized(false), exitImmersiveRequested(false), loaderDelay(0) { @@ -250,7 +249,7 @@ BrowserWorld::State::CheckBackButton() { VRBrowser::HandleBack(); webXRInterstialState = WebXRInterstialState::HIDDEN; } else if (webXRInterstialState == WebXRInterstialState::ALLOW_DISMISS - && controller.lastButtonState && controller.buttonState == 0) { + && controller.lastButtonState == 0 && controller.buttonState) { VRBrowser::OnDismissWebXRInterstitial(); webXRInterstialState = WebXRInterstialState::HIDDEN; } @@ -261,11 +260,6 @@ BrowserWorld::State::CheckBackButton() { bool BrowserWorld::State::CheckExitImmersive() { if (exitImmersiveRequested && externalVR->IsPresenting()) { - webXRInterstialState = WebXRInterstialState::HIDDEN; - if (wasWebXRRendering) { - VRBrowser::OnWebXRRenderStateChange(false); - wasWebXRRendering = false; - } externalVR->StopPresenting(); blitter->StopPresenting(); exitImmersiveRequested = false; @@ -588,10 +582,6 @@ BrowserWorld::State::ClearWebXRControllerData() { }; controller.immersiveTouchedState = 0; controller.immersivePressedState = 0; - controller.selectActionStartFrameId = 0; - controller.selectActionStopFrameId = 0; - controller.squeezeActionStartFrameId = 0; - controller.squeezeActionStopFrameId = 0; for (int i = 0; i < controller.numAxes; ++i) { controller.immersiveAxes[i] = 0; } @@ -959,9 +949,6 @@ BrowserWorld::StartFrame() { m.context->Update(); m.externalVR->PullBrowserState(); m.externalVR->SetHapticState(m.controllers); - - const uint64_t frameId = m.externalVR->GetFrameId(); - m.controllers->SetFrameId(frameId); m.CheckExitImmersive(); if (m.splashAnimation) { @@ -1529,11 +1516,6 @@ BrowserWorld::TickImmersive() { if (m.webXRInterstialState != WebXRInterstialState::HIDDEN) { TickWebXRInterstitial(); } else { - if (!m.wasWebXRRendering) { - // Disable Spinner animation in Java to avoid triggering superfluous Android Draw calls. - VRBrowser::OnWebXRRenderStateChange(true); - m.wasWebXRRendering = true; - } m.drawHandler = [=](device::Eye aEye) { DrawImmersive(aEye); }; diff --git a/app/src/main/cpp/Controller.cpp b/app/src/main/cpp/Controller.cpp index 9605014e4..a5fb2dff7 100644 --- a/app/src/main/cpp/Controller.cpp +++ b/app/src/main/cpp/Controller.cpp @@ -51,7 +51,6 @@ Controller::operator=(const Controller& aController) { pointer = aController.pointer; transformMatrix = aController.transformMatrix; beamTransformMatrix = aController.beamTransformMatrix; - immersiveBeamTransform = aController.immersiveBeamTransform; immersiveName = aController.immersiveName; immersivePressedState = aController.immersivePressedState; immersiveTouchedState = aController.immersiveTouchedState; @@ -66,13 +65,6 @@ Controller::operator=(const Controller& aController) { leftHanded = aController.leftHanded; inDeadZone = aController.inDeadZone; lastHoverEvent = aController.lastHoverEvent; - profile = aController.profile; - type = aController.type; - targetRayMode = aController.targetRayMode; - selectActionStartFrameId = aController.selectActionStartFrameId; - selectActionStopFrameId = aController.selectActionStopFrameId; - squeezeActionStartFrameId = aController.squeezeActionStartFrameId; - squeezeActionStopFrameId = aController.squeezeActionStopFrameId; return *this; } @@ -96,7 +88,6 @@ Controller::Reset() { pointer = nullptr; transformMatrix = Matrix::Identity(); beamTransformMatrix = Matrix::Identity(); - immersiveBeamTransform = Matrix::Identity(); immersiveName.clear(); immersivePressedState = 0; immersiveTouchedState = 0; @@ -111,12 +102,6 @@ Controller::Reset() { leftHanded = false; inDeadZone = true; lastHoverEvent = 0.0; - type = device::UnknownType; - targetRayMode = device::TargetRayMode::TrackedPointer; - selectActionStartFrameId = 0; - selectActionStopFrameId = 0; - squeezeActionStartFrameId = 0; - squeezeActionStopFrameId = 0; } vrb::Vector Controller::StartPoint() const { diff --git a/app/src/main/cpp/Controller.h b/app/src/main/cpp/Controller.h index 37d869fb2..c311fa333 100644 --- a/app/src/main/cpp/Controller.h +++ b/app/src/main/cpp/Controller.h @@ -16,7 +16,7 @@ namespace crow { class Pointer; typedef std::shared_ptr PointerPtr; -static const int kControllerMaxButtonCount = 7; +static const int kControllerMaxButtonCount = 6; static const int kControllerMaxAxes = 6; struct Controller { @@ -44,7 +44,6 @@ struct Controller { PointerPtr pointer; vrb::Matrix transformMatrix; vrb::Matrix beamTransformMatrix; - vrb::Matrix immersiveBeamTransform; std::string immersiveName; uint64_t immersivePressedState; uint64_t immersiveTouchedState; @@ -53,8 +52,6 @@ struct Controller { float immersiveAxes[kControllerMaxAxes]; uint32_t numAxes; uint32_t numHaptics; - device::DeviceType type; - device::TargetRayMode targetRayMode; float inputFrameID; float pulseDuration; float pulseIntensity; @@ -64,12 +61,6 @@ struct Controller { double lastHoverEvent; device::CapabilityFlags deviceCapabilities; - std::string profile; - uint64_t selectActionStartFrameId; - uint64_t selectActionStopFrameId; - uint64_t squeezeActionStartFrameId; - uint64_t squeezeActionStopFrameId; - vrb::Vector StartPoint() const; vrb::Vector Direction() const; diff --git a/app/src/main/cpp/ControllerContainer.cpp b/app/src/main/cpp/ControllerContainer.cpp index 5e38553ac..216e1dc2e 100644 --- a/app/src/main/cpp/ControllerContainer.cpp +++ b/app/src/main/cpp/ControllerContainer.cpp @@ -36,16 +36,12 @@ struct ControllerContainer::State { bool visible = false; vrb::Color pointerColor; int gazeIndex = -1; - uint64_t immersiveFrameId; - uint64_t lastImmersiveFrameId; void Initialize(vrb::CreationContextPtr& aContext) { context = aContext; root = Toggle::Create(aContext); visible = true; pointerColor = vrb::Color(1.0f, 1.0f, 1.0f, 1.0f); - immersiveFrameId = 0; - lastImmersiveFrameId = 0; } bool Contains(const int32_t aControllerIndex) { @@ -198,7 +194,6 @@ ControllerContainer::CreateController(const int32_t aControllerIndex, const int3 controller.index = aControllerIndex; controller.immersiveName = aImmersiveName; controller.beamTransformMatrix = aBeamTransform; - controller.immersiveBeamTransform = aBeamTransform; if (aModelIndex < 0) { return; } @@ -239,15 +234,6 @@ ControllerContainer::CreateController(const int32_t aControllerIndex, const int3 m.updatePointerColor(controller); } -void -ControllerContainer::SetImmersiveBeamTransform(const int32_t aControllerIndex, - const vrb::Matrix& aImmersiveBeamTransform) { - if (!m.Contains(aControllerIndex)) { - return; - } - m.list[aControllerIndex].immersiveBeamTransform = aImmersiveBeamTransform; -} - void ControllerContainer::SetFocused(const int32_t aControllerIndex) { if (!m.Contains(aControllerIndex)) { @@ -301,24 +287,6 @@ ControllerContainer::SetVisible(const int32_t aControllerIndex, const bool aVisi } } -void -ControllerContainer::SetControllerType(const int32_t aControllerIndex, device::DeviceType aType) { - if (!m.Contains(aControllerIndex)) { - return; - } - Controller& controller = m.list[aControllerIndex]; - controller.type = aType; -} - -void -ControllerContainer::SetTargetRayMode(const int32_t aControllerIndex, device::TargetRayMode aMode) { - if (!m.Contains(aControllerIndex)) { - return; - } - Controller& controller = m.list[aControllerIndex]; - controller.targetRayMode = aMode; -} - void ControllerContainer::SetTransform(const int32_t aControllerIndex, const vrb::Matrix& aTransform) { if (!m.Contains(aControllerIndex)) { @@ -431,54 +399,6 @@ ControllerContainer::GetHapticFeedback(const int32_t aControllerIndex, uint64_t aPulseIntensity = m.list[aControllerIndex].pulseIntensity; } -void -ControllerContainer::SetSelectActionStart(const int32_t aControllerIndex) { - if (!m.Contains(aControllerIndex) || !m.immersiveFrameId) { - return; - } - - if (m.list[aControllerIndex].selectActionStopFrameId >= - m.list[aControllerIndex].selectActionStartFrameId) { - m.list[aControllerIndex].selectActionStartFrameId = m.immersiveFrameId; - } -} - -void -ControllerContainer::SetSelectActionStop(const int32_t aControllerIndex) { - if (!m.Contains(aControllerIndex) || !m.lastImmersiveFrameId) { - return; - } - - if (m.list[aControllerIndex].selectActionStartFrameId > - m.list[aControllerIndex].selectActionStopFrameId) { - m.list[aControllerIndex].selectActionStopFrameId = m.lastImmersiveFrameId; - } -} - -void -ControllerContainer::SetSqueezeActionStart(const int32_t aControllerIndex) { - if (!m.Contains(aControllerIndex) || !m.immersiveFrameId) { - return; - } - - if (m.list[aControllerIndex].squeezeActionStopFrameId >= - m.list[aControllerIndex].squeezeActionStartFrameId) { - m.list[aControllerIndex].squeezeActionStartFrameId = m.immersiveFrameId; - } -} - -void -ControllerContainer::SetSqueezeActionStop(const int32_t aControllerIndex) { - if (!m.Contains(aControllerIndex) || !m.lastImmersiveFrameId) { - return; - } - - if (m.list[aControllerIndex].squeezeActionStartFrameId > - m.list[aControllerIndex].squeezeActionStopFrameId) { - m.list[aControllerIndex].squeezeActionStopFrameId = m.lastImmersiveFrameId; - } -} - void ControllerContainer::SetLeftHanded(const int32_t aControllerIndex, const bool aLeftHanded) { if (!m.Contains(aControllerIndex)) { @@ -546,20 +466,6 @@ void ControllerContainer::SetGazeModeIndex(const int32_t aControllerIndex) { m.gazeIndex = aControllerIndex; } -void -ControllerContainer::SetFrameId(const uint64_t aFrameId) { - if (m.immersiveFrameId) { - m.lastImmersiveFrameId = aFrameId ? aFrameId : m.immersiveFrameId; - } else { - m.lastImmersiveFrameId = 0; - for (Controller& controller: m.list) { - controller.selectActionStartFrameId = controller.selectActionStopFrameId = 0; - controller.squeezeActionStartFrameId = controller.squeezeActionStopFrameId = 0; - } - } - m.immersiveFrameId = aFrameId; -} - ControllerContainer::ControllerContainer(State& aState, vrb::CreationContextPtr& aContext) : m(aState) { m.Initialize(aContext); } diff --git a/app/src/main/cpp/ControllerContainer.h b/app/src/main/cpp/ControllerContainer.h index f36ed7bf2..35f4b7141 100644 --- a/app/src/main/cpp/ControllerContainer.h +++ b/app/src/main/cpp/ControllerContainer.h @@ -35,14 +35,11 @@ class ControllerContainer : public crow::ControllerDelegate { uint32_t GetControllerCount() override; void CreateController(const int32_t aControllerIndex, const int32_t aModelIndex, const std::string& aImmersiveName) override; void CreateController(const int32_t aControllerIndex, const int32_t aModelIndex, const std::string& aImmersiveName, const vrb::Matrix& aBeamTransform) override; - void SetImmersiveBeamTransform(const int32_t aControllerIndex, const vrb::Matrix& aImmersiveBeamTransform) override; void SetFocused(const int32_t aControllerIndex) override; void DestroyController(const int32_t aControllerIndex) override; void SetCapabilityFlags(const int32_t aControllerIndex, const device::CapabilityFlags aFlags) override; void SetEnabled(const int32_t aControllerIndex, const bool aEnabled) override; void SetVisible(const int32_t aControllerIndex, const bool aVisible) override; - void SetControllerType(const int32_t aControllerIndex, device::DeviceType aType) override; - void SetTargetRayMode(const int32_t aControllerIndex, device::TargetRayMode aMode) override; void SetTransform(const int32_t aControllerIndex, const vrb::Matrix& aTransform) override; void SetButtonCount(const int32_t aControllerIndex, const uint32_t aNumButtons) override; void SetButtonState(const int32_t aControllerIndex, const Button aWhichButton, const int32_t aImmersiveIndex, const bool aPressed, const bool aTouched, const float aImmersiveTrigger = -1.0f) override; @@ -51,10 +48,6 @@ class ControllerContainer : public crow::ControllerDelegate { uint32_t GetHapticCount(const int32_t aControllerIndex) override; void SetHapticFeedback(const int32_t aControllerIndex, const uint64_t aInputFrameID, const float aPulseDuration, const float aPulseIntensity) override; void GetHapticFeedback(const int32_t aControllerIndex, uint64_t &aInputFrameID, float& aPulseDuration, float& aPulseIntensity) override; - void SetSelectActionStart(const int32_t aControllerIndex) override; - void SetSelectActionStop(const int32_t aControllerIndex) override; - void SetSqueezeActionStart(const int32_t aControllerIndex) override; - void SetSqueezeActionStop(const int32_t aControllerIndex) override; void SetLeftHanded(const int32_t aControllerIndex, const bool aLeftHanded) override; void SetTouchPosition(const int32_t aControllerIndex, const float aTouchX, const float aTouchY) override; void EndTouch(const int32_t aControllerIndex) override; @@ -62,7 +55,6 @@ class ControllerContainer : public crow::ControllerDelegate { void SetPointerColor(const vrb::Color& color) const; void SetVisible(const bool aVisible); void SetGazeModeIndex(const int32_t aControllerIndex) override; - void SetFrameId(const uint64_t aFrameId); protected: struct State; ControllerContainer(State& aState, vrb::CreationContextPtr& aContext); diff --git a/app/src/main/cpp/ControllerDelegate.h b/app/src/main/cpp/ControllerDelegate.h index 06cdc05c2..6000d8f68 100644 --- a/app/src/main/cpp/ControllerDelegate.h +++ b/app/src/main/cpp/ControllerDelegate.h @@ -12,7 +12,6 @@ #include "GestureDelegate.h" #include -#include namespace crow { @@ -23,27 +22,23 @@ class ControllerDelegate { public: enum Button { BUTTON_TRIGGER = 1u << 0u, - BUTTON_SQUEEZE = 1u << 1u, - BUTTON_TOUCHPAD = 1u << 2u, - BUTTON_APP = 1u << 3u, - BUTTON_A = 1u << 4u, - BUTTON_B = 1u << 5u, - BUTTON_X = 1u << 6u, - BUTTON_Y = 1u << 7u, - BUTTON_OTHERS = 1u << 8u, // Other buttons only for the immersive mode. + BUTTON_TOUCHPAD = 1u << 1u, + BUTTON_APP = 1u << 2u, + BUTTON_A = 1u << 3u, + BUTTON_B = 1u << 4u, + BUTTON_X = 1u << 5u, + BUTTON_Y = 1u << 6u, + BUTTON_OTHERS = 1u << 7u, // Other buttons only for the immersive mode. }; virtual void CreateController(const int32_t aControllerIndex, const int32_t aModelIndex, const std::string& aImmersiveName) = 0; virtual void CreateController(const int32_t aControllerIndex, const int32_t aModelIndex, const std::string& aImmersiveName, const vrb::Matrix& aBeamTransform) = 0; - virtual void SetImmersiveBeamTransform(const int32_t aControllerIndex, const vrb::Matrix& aImmersiveBeamTransform) = 0; virtual void SetFocused(const int32_t aControllerIndex) = 0; virtual void DestroyController(const int32_t aControllerIndex) = 0; virtual uint32_t GetControllerCount() = 0; virtual void SetCapabilityFlags(const int32_t aControllerIndex, const device::CapabilityFlags aFlags) = 0; virtual void SetEnabled(const int32_t aControllerIndex, const bool aEnabled) = 0; virtual void SetVisible(const int32_t aControllerIndex, const bool aVisible) = 0; - virtual void SetControllerType(const int32_t aControllerIndex, device::DeviceType aType) = 0; - virtual void SetTargetRayMode(const int32_t aControllerIndex, device::TargetRayMode aMode) = 0; virtual void SetTransform(const int32_t aControllerIndex, const vrb::Matrix& aTransform) = 0; virtual void SetButtonCount(const int32_t aControllerIndex, const uint32_t aNumButtons) = 0; virtual void SetButtonState(const int32_t aControllerIndex, const Button aWhichButton, const int32_t aImmersiveIndex, const bool aPressed, const bool aTouched, const float aImmersiveTrigger = -1.0f) = 0; @@ -52,10 +47,6 @@ class ControllerDelegate { virtual uint32_t GetHapticCount(const int32_t aControllerIndex) = 0; virtual void SetHapticFeedback(const int32_t aControllerIndex, const uint64_t aInputFrameID, const float aPulseDuration, const float aPulseIntensity) = 0; virtual void GetHapticFeedback(const int32_t aControllerIndex, uint64_t & aInputFrameID, float& aPulseDuration, float& aPulseIntensity) = 0; - virtual void SetSelectActionStart(const int32_t aControllerIndex) = 0; - virtual void SetSelectActionStop(const int32_t aControllerIndex) = 0; - virtual void SetSqueezeActionStart(const int32_t aControllerIndex) = 0; - virtual void SetSqueezeActionStop(const int32_t aControllerIndex) = 0; virtual void SetLeftHanded(const int32_t aControllerIndex, const bool aLeftHanded) = 0; virtual void SetTouchPosition(const int32_t aControllerIndex, const float aTouchX, const float aTouchY) = 0; virtual void EndTouch(const int32_t aControllerIndex) = 0; diff --git a/app/src/main/cpp/Device.h b/app/src/main/cpp/Device.h index ed0ce44c8..b02d84b89 100644 --- a/app/src/main/cpp/Device.h +++ b/app/src/main/cpp/Device.h @@ -22,7 +22,6 @@ const CapabilityFlags PositionEmulated = 1u << 9u; const CapabilityFlags InlineSession = 1u << 10u; const CapabilityFlags ImmersiveVRSession = 1u << 11u; const CapabilityFlags ImmersiveARSession = 1u << 12u; -const CapabilityFlags GripSpacePosition = 1u << 13u; enum class Eye { Left, Right }; enum class RenderMode { StandAlone, Immersive }; enum class CPULevel { Normal = 0, High }; @@ -33,31 +32,6 @@ typedef int32_t DeviceType; const DeviceType UnknownType = 0; const DeviceType OculusGo = 1; const DeviceType OculusQuest = 2; -const DeviceType ViveFocus = 3; -const DeviceType ViveFocusPlus = 4; -const DeviceType PicoGaze = 5; -const DeviceType PicoNeo2 = 6; -const DeviceType PicoG2 = 7; - -enum class TargetRayMode : uint8_t { Gaze, TrackedPointer, Screen }; - -// Placeholder buttons for WebXR -// https://www.w3.org/TR/webxr-gamepads-module-1/#xr-standard-gamepad-mapping -const uint8_t kImmersiveButtonTrigger = 0; -const uint8_t kImmersiveButtonSqueeze = 1; -const uint8_t kImmersiveButtonTouchpad = 2; -const uint8_t kImmersiveButtonThumbstick = 3; -const uint8_t kImmersiveButtonA = 4; -const uint8_t kImmersiveButtonB = 5; -const uint8_t kImmersiveButtonThumbrest = 6; - -// Placeholder axes for WebXR -// https://www.w3.org/TR/webxr-gamepads-module-1/#xr-standard-gamepad-mapping -const uint8_t kImmersiveAxisTouchpadX = 0; -const uint8_t kImmersiveAxisTouchpadY = 1; -const uint8_t kImmersiveAxisThumbstickX = 2; -const uint8_t kImmersiveAxisThumbstickY = 3; - struct EyeRect { float mX, mY; float mWidth, mHeight; diff --git a/app/src/main/cpp/ExternalVR.cpp b/app/src/main/cpp/ExternalVR.cpp index fea720f0c..8dbedd8a4 100644 --- a/app/src/main/cpp/ExternalVR.cpp +++ b/app/src/main/cpp/ExternalVR.cpp @@ -207,40 +207,6 @@ struct ExternalVR::State { ExternalVR::State * ExternalVR::State::sState = nullptr; -mozilla::gfx::VRControllerType GetVRControllerTypeByDevice(device::DeviceType aType) { - mozilla::gfx::VRControllerType result = mozilla::gfx::VRControllerType::_empty; - - switch (aType) { - case device::OculusGo: - result = mozilla::gfx::VRControllerType::OculusGo; - break; - case device::OculusQuest: - result = mozilla::gfx::VRControllerType::OculusTouch2; - break; - case device::ViveFocus: - result = mozilla::gfx::VRControllerType::HTCViveFocus; - break; - case device::ViveFocusPlus: - result = mozilla::gfx::VRControllerType::HTCViveFocusPlus; - break; - case device::PicoGaze: - result = mozilla::gfx::VRControllerType::PicoGaze; - break; - case device::PicoNeo2: - result = mozilla::gfx::VRControllerType::PicoNeo2; - break; - case device::PicoG2: - result = mozilla::gfx::VRControllerType::PicoG2; - break; - case device::UnknownType: - default: - result = mozilla::gfx::VRControllerType::_empty; - VRB_LOG("Unknown controller type."); - break; - } - return result; -} - ExternalVRPtr ExternalVR::Create() { return std::make_shared(); @@ -366,11 +332,6 @@ ExternalVR::SetSourceBrowser(VRBrowserType aBrowser) { m.SetSourceBrowser(aBrowser); } -uint64_t -ExternalVR::GetFrameId() const { - return m.lastFrameId; -} - void ExternalVR::SetCompositorEnabled(bool aEnabled) { if (aEnabled == m.compositorEnabled) { @@ -378,17 +339,9 @@ ExternalVR::SetCompositorEnabled(bool aEnabled) { } m.compositorEnabled = aEnabled; if (aEnabled) { - // Set suppressFrames to avoid a deadlock between the sync surfaceChanged call - // and the gecko VRManager SubmitFrame result wait. - m.system.displayState.suppressFrames = true; - PushSystemState(); - VRBrowser::OnExitWebXR([=]{ - m.system.displayState.suppressFrames = false; - PushSystemState(); - }); + VRBrowser::OnExitWebXR(); } else { - // Set suppressFrames to avoid a deadlock between the compositor sync pause call - // and the gecko VRManager SubmitFrame result wait. + // Set suppressFrames to avoid a deadlock between the compositor sync pause call and the gfxVRExternal SubmitFrame result wait. m.system.displayState.suppressFrames = true; m.system.displayState.lastSubmittedFrameId = 0; m.lastFrameId = 0; @@ -419,12 +372,6 @@ ExternalVR::GetControllerCapabilityFlags(device::CapabilityFlags aFlags) { if (device::LinearAcceleration & aFlags) { result |= static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_LinearAcceleration); } - if (device::PositionEmulated & aFlags) { - result |= static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_PositionEmulated); - } - if (device::GripSpacePosition & aFlags) { - result |= static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_GripSpacePosition); - } return result; } @@ -482,44 +429,23 @@ ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector< } immersiveController.numHaptics = controller.numHaptics; immersiveController.hand = controller.leftHanded ? mozilla::gfx::ControllerHand::Left : mozilla::gfx::ControllerHand::Right; - immersiveController.type = GetVRControllerTypeByDevice(controller.type); const uint16_t flags = GetControllerCapabilityFlags(controller.deviceCapabilities); immersiveController.flags = static_cast(flags); - const vrb::Matrix beamTransform = controller.transformMatrix.PostMultiply(controller.immersiveBeamTransform); + if (flags & static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_Orientation)) { immersiveController.isOrientationValid = true; - vrb::Quaternion rotate; - if (flags & static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_GripSpacePosition)) { - rotate = controller.transformMatrix; - rotate = rotate.Inverse(); - memcpy(&(immersiveController.pose.orientation), rotate.Data(), sizeof(immersiveController.pose.orientation)); - } - rotate.SetFromRotationMatrix(beamTransform); - rotate = rotate.Inverse(); - memcpy(&(immersiveController.targetRayPose.orientation), rotate.Data(), sizeof(immersiveController.targetRayPose.orientation)); + vrb::Quaternion quaternion(controller.transformMatrix); + quaternion = quaternion.Inverse(); + memcpy(&(immersiveController.pose.orientation), quaternion.Data(), sizeof(immersiveController.pose.orientation)); } - if (flags & static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_Position) || - flags & static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_PositionEmulated)) { + if (flags & static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_Position)) { immersiveController.isPositionValid = true; - vrb::Vector position; - if (flags & static_cast(mozilla::gfx::ControllerCapabilityFlags::Cap_GripSpacePosition)) { - position = controller.transformMatrix.GetTranslation(); - memcpy(&(immersiveController.pose.position), position.Data(), sizeof(immersiveController.pose.position)); - } - position = beamTransform.GetTranslation(); - memcpy(&(immersiveController.targetRayPose.position), position.Data(), sizeof(immersiveController.targetRayPose.position)); + vrb::Vector position(controller.transformMatrix.GetTranslation()); + memcpy(&(immersiveController.pose.position), position.Data(), sizeof(immersiveController.pose.position)); } - // TODO:: We should add TargetRayMode::_end in moz_external_vr.h to help this check. - assert((uint8_t)mozilla::gfx::TargetRayMode::Screen == (uint8_t)device::TargetRayMode::Screen); - immersiveController.targetRayMode = (mozilla::gfx::TargetRayMode)controller.targetRayMode; - immersiveController.mappingType = mozilla::gfx::GamepadMappingType::XRStandard; - immersiveController.selectActionStartFrameId = controller.selectActionStartFrameId; - immersiveController.selectActionStopFrameId = controller.selectActionStopFrameId; - immersiveController.squeezeActionStartFrameId = controller.squeezeActionStartFrameId; - immersiveController.squeezeActionStopFrameId = controller.squeezeActionStopFrameId; } m.system.sensorState.timestamp = aTimestamp; diff --git a/app/src/main/cpp/ExternalVR.h b/app/src/main/cpp/ExternalVR.h index 78d82dee5..8f1cf7301 100644 --- a/app/src/main/cpp/ExternalVR.h +++ b/app/src/main/cpp/ExternalVR.h @@ -66,7 +66,6 @@ class ExternalVR : public ImmersiveDisplay { void SetSourceBrowser(VRBrowserType aBrowser); void OnPause(); void OnResume(); - uint64_t GetFrameId() const; ExternalVR(); ~ExternalVR() = default; protected: diff --git a/app/src/main/cpp/VRBrowser.cpp b/app/src/main/cpp/VRBrowser.cpp index 2c0afac07..4c49544b3 100644 --- a/app/src/main/cpp/VRBrowser.cpp +++ b/app/src/main/cpp/VRBrowser.cpp @@ -10,58 +10,54 @@ namespace { -const char* const kDispatchCreateWidgetName = "dispatchCreateWidget"; -const char* const kDispatchCreateWidgetSignature = "(ILandroid/graphics/SurfaceTexture;II)V"; -const char* const kDispatchCreateWidgetLayerName = "dispatchCreateWidgetLayer"; -const char* const kDispatchCreateWidgetLayerSignature = "(ILandroid/view/Surface;IIJ)V"; -const char* const kHandleMotionEventName = "handleMotionEvent"; -const char* const kHandleMotionEventSignature = "(IIZZFF)V"; -const char* const kHandleScrollEventName = "handleScrollEvent"; -const char* const kHandleScrollEventSignature = "(IIFF)V"; -const char* const kHandleAudioPoseName = "handleAudioPose"; -const char* const kHandleAudioPoseSignature = "(FFFFFFF)V"; -const char* const kHandleGestureName = "handleGesture"; -const char* const kHandleGestureSignature = "(I)V"; -const char* const kHandleResizeName = "handleResize"; -const char* const kHandleResizeSignature = "(IFF)V"; -const char* const kHandleMoveEndName = "handleMoveEnd"; -const char* const kHandleMoveEndSignature = "(IFFFF)V"; -const char* const kHandleBackEventName = "handleBack"; -const char* const kHandleBackEventSignature = "()V"; -const char* const kRegisterExternalContextName = "registerExternalContext"; -const char* const kRegisterExternalContextSignature = "(J)V"; -const char* const kOnEnterWebXRName = "onEnterWebXR"; -const char* const kOnEnterWebXRSignature = "()V"; -const char* const kOnExitWebXRName = "onExitWebXR"; -const char* const kOnExitWebXRSignature = "(J)V"; -const char* const kOnDismissWebXRInterstitialName = "onDismissWebXRInterstitial"; -const char* const kOnDismissWebXRInterstitialSignature = "()V"; -const char* const kOnWebXRRenderStateChangeName = "onWebXRRenderStateChange"; -const char* const kOnWebXRRenderStateChangeSignature = "(Z)V"; -const char* const kRenderPointerLayerName = "renderPointerLayer"; -const char* const kRenderPointerLayerSignature = "(Landroid/view/Surface;J)V"; -const char* const kGetStorageAbsolutePathName = "getStorageAbsolutePath"; -const char* const kGetStorageAbsolutePathSignature = "()Ljava/lang/String;"; -const char* const kIsOverrideEnvPathEnabledName = "isOverrideEnvPathEnabled"; -const char* const kIsOverrideEnvPathEnabledSignature = "()Z"; -const char* const kGetActiveEnvironment = "getActiveEnvironment"; -const char* const kGetActiveEnvironmentSignature = "()Ljava/lang/String;"; -const char* const kGetPointerColor = "getPointerColor"; -const char* const kGetPointerColorSignature = "()I"; -const char* const kAreLayersEnabled = "areLayersEnabled"; -const char* const kAreLayersEnabledSignature = "()Z"; -const char* const kSetDeviceType = "setDeviceType"; -const char* const kSetDeviceTypeSignature = "(I)V"; -const char* const kHaltActivity = "haltActivity"; -const char* const kHaltActivitySignature = "(I)V"; -const char* const kHandlePoorPerformance = "handlePoorPerformance"; -const char* const kHandlePoorPerformanceSignature = "()V"; -const char* const kOnAppLink = "onAppLink"; -const char* const kOnAppLinkSignature = "(Ljava/lang/String;)V"; -const char* const kDisableLayers = "disableLayers"; -const char* const kDisableLayersSignature = "()V"; -const char* const kAppendAppNotesToCrashReport = "appendAppNotesToCrashReport"; -const char* const kAppendAppNotesToCrashReportSignature = "(Ljava/lang/String;)V"; +const char* kDispatchCreateWidgetName = "dispatchCreateWidget"; +const char* kDispatchCreateWidgetSignature = "(ILandroid/graphics/SurfaceTexture;II)V"; +const char* kDispatchCreateWidgetLayerName = "dispatchCreateWidgetLayer"; +const char* kDispatchCreateWidgetLayerSignature = "(ILandroid/view/Surface;IIJ)V"; +const char* kHandleMotionEventName = "handleMotionEvent"; +const char* kHandleMotionEventSignature = "(IIZZFF)V"; +const char* kHandleScrollEventName = "handleScrollEvent"; +const char* kHandleScrollEventSignature = "(IIFF)V"; +const char* kHandleAudioPoseName = "handleAudioPose"; +const char* kHandleAudioPoseSignature = "(FFFFFFF)V"; +const char* kHandleGestureName = "handleGesture"; +const char* kHandleGestureSignature = "(I)V"; +const char* kHandleResizeName = "handleResize"; +const char* kHandleResizeSignature = "(IFF)V"; +const char* kHandleMoveEndName = "handleMoveEnd"; +const char* kHandleMoveEndSignature = "(IFFFF)V"; +const char* kHandleBackEventName = "handleBack"; +const char* kHandleBackEventSignature = "()V"; +const char* kRegisterExternalContextName = "registerExternalContext"; +const char* kRegisterExternalContextSignature = "(J)V"; +const char* kOnEnterWebXRName = "onEnterWebXR"; +const char* kOnEnterWebXRSignature = "()V"; +const char* kOnExitWebXRName = "onExitWebXR"; +const char* kOnExitWebXRSignature = "()V"; +const char* kOnDismissWebXRInterstitialName = "onDismissWebXRInterstitial"; +const char* kOnDismissWebXRInterstitialSignature = "()V"; +const char* kRenderPointerLayerName = "renderPointerLayer"; +const char* kRenderPointerLayerSignature = "(Landroid/view/Surface;J)V"; +const char* kGetStorageAbsolutePathName = "getStorageAbsolutePath"; +const char* kGetStorageAbsolutePathSignature = "()Ljava/lang/String;"; +const char* kIsOverrideEnvPathEnabledName = "isOverrideEnvPathEnabled"; +const char* kIsOverrideEnvPathEnabledSignature = "()Z"; +const char* kGetActiveEnvironment = "getActiveEnvironment"; +const char* kGetActiveEnvironmentSignature = "()Ljava/lang/String;"; +const char* kGetPointerColor = "getPointerColor"; +const char* kGetPointerColorSignature = "()I"; +const char* kAreLayersEnabled = "areLayersEnabled"; +const char* kAreLayersEnabledSignature = "()Z"; +const char* kSetDeviceType = "setDeviceType"; +const char* kSetDeviceTypeSignature = "(I)V"; +const char* kHaltActivity = "haltActivity"; +const char* kHaltActivitySignature = "(I)V"; +const char* kHandlePoorPerformance = "handlePoorPerformance"; +const char* kHandlePoorPerformanceSignature = "()V"; +const char* kOnAppLink = "onAppLink"; +const char* kOnAppLinkSignature = "(Ljava/lang/String;)V"; +const char* kDisableLayers = "disableLayers"; +const char* kDisableLayersSignature = "()V"; JNIEnv* sEnv = nullptr; jclass sBrowserClass = nullptr; @@ -79,7 +75,6 @@ jmethodID sRegisterExternalContext = nullptr; jmethodID sOnEnterWebXR = nullptr; jmethodID sOnExitWebXR = nullptr; jmethodID sOnDismissWebXRInterstitial = nullptr; -jmethodID sOnWebXRRenderStateChange = nullptr; jmethodID sRenderPointerLayer = nullptr; jmethodID sGetStorageAbsolutePath = nullptr; jmethodID sIsOverrideEnvPathEnabled = nullptr; @@ -91,7 +86,6 @@ jmethodID sHaltActivity = nullptr; jmethodID sHandlePoorPerformance = nullptr; jmethodID sOnAppLink = nullptr; jmethodID sDisableLayers = nullptr; -jmethodID sAppendAppNotesToCrashReport = nullptr; } namespace crow { @@ -124,7 +118,6 @@ VRBrowser::InitializeJava(JNIEnv* aEnv, jobject aActivity) { sOnEnterWebXR = FindJNIMethodID(sEnv, sBrowserClass, kOnEnterWebXRName, kOnEnterWebXRSignature); sOnExitWebXR = FindJNIMethodID(sEnv, sBrowserClass, kOnExitWebXRName, kOnExitWebXRSignature); sOnDismissWebXRInterstitial = FindJNIMethodID(sEnv, sBrowserClass, kOnDismissWebXRInterstitialName, kOnDismissWebXRInterstitialSignature); - sOnWebXRRenderStateChange = FindJNIMethodID(sEnv, sBrowserClass, kOnWebXRRenderStateChangeName, kOnWebXRRenderStateChangeSignature); sRenderPointerLayer = FindJNIMethodID(sEnv, sBrowserClass, kRenderPointerLayerName, kRenderPointerLayerSignature); sGetStorageAbsolutePath = FindJNIMethodID(sEnv, sBrowserClass, kGetStorageAbsolutePathName, kGetStorageAbsolutePathSignature); sIsOverrideEnvPathEnabled = FindJNIMethodID(sEnv, sBrowserClass, kIsOverrideEnvPathEnabledName, kIsOverrideEnvPathEnabledSignature); @@ -136,7 +129,6 @@ VRBrowser::InitializeJava(JNIEnv* aEnv, jobject aActivity) { sHandlePoorPerformance = FindJNIMethodID(sEnv, sBrowserClass, kHandlePoorPerformance, kHandlePoorPerformanceSignature); sOnAppLink = FindJNIMethodID(sEnv, sBrowserClass, kOnAppLink, kOnAppLinkSignature); sDisableLayers = FindJNIMethodID(sEnv, sBrowserClass, kDisableLayers, kDisableLayersSignature); - sAppendAppNotesToCrashReport = FindJNIMethodID(sEnv, sBrowserClass, kAppendAppNotesToCrashReport, kAppendAppNotesToCrashReportSignature); } void @@ -164,7 +156,6 @@ VRBrowser::ShutdownJava() { sOnEnterWebXR = nullptr; sOnExitWebXR = nullptr; sOnDismissWebXRInterstitial = nullptr; - sOnWebXRRenderStateChange = nullptr; sRenderPointerLayer = nullptr; sGetStorageAbsolutePath = nullptr; sIsOverrideEnvPathEnabled = nullptr; @@ -176,7 +167,6 @@ VRBrowser::ShutdownJava() { sOnAppLink = nullptr; sDisableLayers = nullptr; sEnv = nullptr; - sAppendAppNotesToCrashReport = nullptr; } void @@ -263,13 +253,9 @@ VRBrowser::OnEnterWebXR() { } void -VRBrowser::OnExitWebXR(const std::function& aCallback) { +VRBrowser::OnExitWebXR() { if (!ValidateMethodID(sEnv, sActivity, sOnExitWebXR, __FUNCTION__)) { return; } - jlong callback = 0; - if (aCallback) { - callback = reinterpret_cast(new std::function(aCallback)); - } - sEnv->CallVoidMethod(sActivity, sOnExitWebXR, callback); + sEnv->CallVoidMethod(sActivity, sOnExitWebXR); CheckJNIException(sEnv, __FUNCTION__); } @@ -279,12 +265,6 @@ void VRBrowser::OnDismissWebXRInterstitial() { CheckJNIException(sEnv, __FUNCTION__); } -void VRBrowser::OnWebXRRenderStateChange(const bool aRendering) { - if (!ValidateMethodID(sEnv, sActivity, sOnWebXRRenderStateChange, __FUNCTION__)) { return; } - sEnv->CallVoidMethod(sActivity, sOnWebXRRenderStateChange, (jboolean) aRendering); - CheckJNIException(sEnv, __FUNCTION__); -} - void VRBrowser::RenderPointerLayer(jobject aSurface, const std::function& aFirstCompositeCallback) { if (!ValidateMethodID(sEnv, sActivity, sRenderPointerLayer, __FUNCTION__)) { return; } @@ -396,13 +376,4 @@ VRBrowser::DisableLayers() { CheckJNIException(sEnv, __FUNCTION__); } -void -VRBrowser::AppendAppNotesToCrashLog(const std::string& aNotes) { - if (!ValidateMethodID(sEnv, sActivity, sAppendAppNotesToCrashReport, __FUNCTION__)) { return; } - jstring notes = sEnv->NewStringUTF(aNotes.c_str()); - sEnv->CallVoidMethod(sActivity, sAppendAppNotesToCrashReport, notes); - sEnv->DeleteLocalRef(notes); - CheckJNIException(sEnv, __FUNCTION__); -} - } // namespace crow diff --git a/app/src/main/cpp/VRBrowser.h b/app/src/main/cpp/VRBrowser.h index 68fbac254..6dba20f46 100644 --- a/app/src/main/cpp/VRBrowser.h +++ b/app/src/main/cpp/VRBrowser.h @@ -29,9 +29,8 @@ void HandleMoveEnd(jint aWidgetHandle, jfloat aX, jfloat aY, jfloat aZ, jfloat a void HandleBack(); void RegisterExternalContext(jlong aContext); void OnEnterWebXR(); -void OnExitWebXR(const std::function& aCallback); +void OnExitWebXR(); void OnDismissWebXRInterstitial(); -void OnWebXRRenderStateChange(const bool aRendering); void RenderPointerLayer(jobject aSurface, const std::function& aFirstCompositeCallback); std::string GetStorageAbsolutePath(const std::string& aRelativePath); bool isOverrideEnvPathEnabled(); @@ -43,7 +42,6 @@ void HaltActivity(const jint aReason); void HandlePoorPerformance(); void OnAppLink(const std::string& aJSON); void DisableLayers(); -void AppendAppNotesToCrashLog(const std::string& aNotes); } // namespace VRBrowser; } // namespace crow diff --git a/app/src/main/cpp/moz_external_vr.h b/app/src/main/cpp/moz_external_vr.h index a86a5c8f6..6096ee538 100644 --- a/app/src/main/cpp/moz_external_vr.h +++ b/app/src/main/cpp/moz_external_vr.h @@ -47,8 +47,8 @@ namespace gfx { // and mapped files if we have both release and nightlies // running at the same time? Or...what if we have multiple // release builds running on same machine? (Bug 1563232) -#define SHMEM_VERSION "0.0.10" -static const int32_t kVRExternalVersion = 17; +#define SHMEM_VERSION "0.0.8" +static const int32_t kVRExternalVersion = 15; // We assign VR presentations to groups with a bitmask. // Currently, we will only display either content or chrome. @@ -63,6 +63,7 @@ static const uint32_t kVRGroupAll = 0xffffffff; static const int kVRDisplayNameMaxLen = 256; static const int kVRControllerNameMaxLen = 256; +static const int kProfileNameListMaxLen = 256; static const int kVRControllerMaxCount = 16; static const int kVRControllerMaxButtons = 64; static const int kVRControllerMaxAxis = 16; @@ -119,37 +120,24 @@ enum class ControllerCapabilityFlags : uint16_t { */ Cap_LinearAcceleration = 1 << 4, /** - * Cap_TargetRaySpacePosition is set if the Gamepad has a grip space position. + * Cap_GripSpacePosition is set if the Gamepad has a grip space position. */ Cap_GripSpacePosition = 1 << 5, - /** - * Cap_PositionEmulated is set if the XRInputSoruce is capable of setting a - * emulated position (e.g. neck model) even if still doesn't support 6DOF - * tracking. - */ - Cap_PositionEmulated = 1 << 6, /** * Cap_All used for validity checking during IPC serialization */ - Cap_All = (1 << 7) - 1 + Cap_All = (1 << 6) - 1 }; #endif // ifndef MOZILLA_INTERNAL_API enum class VRControllerType : uint8_t { _empty, - HTCVive, - HTCViveCosmos, - HTCViveFocus, - HTCViveFocusPlus, - MSMR, - ValveIndex, - OculusGo, + Vive, + WMR, + Knuckles, + Cosmos, OculusTouch, - OculusTouch2, - PicoGaze, - PicoG2, - PicoNeo2, _end }; @@ -229,17 +217,10 @@ enum class VRDisplayCapabilityFlags : uint16_t { * the user's environment. */ Cap_ImmersiveAR = 1 << 12, - /** - * Cap_UseDepthValues is set if the device will use the depth values of the - * submitted frames if provided. How the depth values are used is determined - * by the VR runtime. Often the depth is used for occlusion of system UI - * or to enable more effective asynchronous reprojection of frames. - */ - Cap_UseDepthValues = 1 << 13, /** * Cap_All used for validity checking during IPC serialization */ - Cap_All = (1 << 14) - 1 + Cap_All = (1 << 13) - 1 }; #ifdef MOZILLA_INTERNAL_API @@ -376,6 +357,11 @@ struct VRControllerState { // https://immersive-web.github.io/webxr/#enumdef-xrtargetraymode TargetRayMode targetRayMode; + // Space-delimited list of input profile names, in decending order + // of specificity. + // https://immersive-web.github.io/webxr/#dom-xrinputsource-profiles + char profiles[kProfileNameListMaxLen]; + // https://immersive-web.github.io/webxr-gamepads-module/#enumdef-gamepadmappingtype GamepadMappingType mappingType; @@ -416,14 +402,14 @@ struct VRControllerState { #endif // When Cap_Position is set in flags, pose corresponds - // to the controllers' pose in grip space: - // https://immersive-web.github.io/webxr/#dom-xrinputsource-gripspace - VRPose pose; - - // When Cap_TargetRaySpacePosition is set in flags, targetRayPose corresponds // to the controllers' pose in target ray space: // https://immersive-web.github.io/webxr/#dom-xrinputsource-targetrayspace - VRPose targetRayPose; + VRPose pose; + + // When Cap_GripSpacePosition is set in flags, gripPose corresponds + // to the controllers' pose in grip space: + // https://immersive-web.github.io/webxr/#dom-xrinputsource-gripspace + VRPose gripPose; bool isPositionValid; bool isOrientationValid; diff --git a/app/src/main/res/drawable/ic_icon_popup.xml b/app/src/main/res/drawable/ic_icon_popup.xml index 8289d7fd0..7da3a06aa 100644 --- a/app/src/main/res/drawable/ic_icon_popup.xml +++ b/app/src/main/res/drawable/ic_icon_popup.xml @@ -1,18 +1,12 @@ + android:pathData="M137.77,95.51A38.27,38.27 0,1 0,176 133.78,38.27 38.27,0 0,0 137.77,95.51ZM121,110.43a28.61,28.61 0,0 1,33.33 0l-39.93,39.92A28.62,28.62 0,0 1,121 110.43ZM154.49,157.13a28.59,28.59 0,0 1,-33.32 0l39.92,-39.92A28.62,28.62 0,0 1,154.51 157.13Z"/> - - + android:pathData="M147.33,28.54L51.66,28.54A28.7,28.7 0,0 0,23 57.24v76.54a28.7,28.7 0,0 0,28.7 28.7L80.37,162.48a9.57,9.57 0,0 0,0 -19.13L51.66,143.35a9.57,9.57 0,0 1,-9.56 -9.57L42.1,76.38L156.9,76.38a9.57,9.57 0,1 0,19.14 0L176.04,57.24A28.71,28.71 0,0 0,147.33 28.54ZM156.9,66.81L42.1,66.81L42.1,57.24a9.56,9.56 0,0 1,9.56 -9.56h95.67a9.56,9.56 0,0 1,9.57 9.56Z"/> diff --git a/app/src/main/res/drawable/ic_icon_popup_blocked.xml b/app/src/main/res/drawable/ic_icon_popup_blocked.xml index 7da3a06aa..8289d7fd0 100644 --- a/app/src/main/res/drawable/ic_icon_popup_blocked.xml +++ b/app/src/main/res/drawable/ic_icon_popup_blocked.xml @@ -1,12 +1,18 @@ + android:pathData="M143.74,94.49A38.27,38.27 0,1 0,182 132.8v0A38.27,38.27 0,0 0,143.74 94.49ZM127,109.41a28.61,28.61 0,0 1,33.33 0l-39.93,39.92A28.62,28.62 0,0 1,127 109.41ZM160.51,156.11h0a28.59,28.59 0,0 1,-33.32 0l39.92,-39.92A28.62,28.62 0,0 1,160.48 156.11Z"/> + android:pathData="M86.34,142.33H67.59l-18,18a29,29 0,0 0,8.06 1.15H86.34a9.57,9.57 0,0 0,0 -19.13Z"/> + + diff --git a/app/src/main/res/layout/navigation_url.xml b/app/src/main/res/layout/navigation_url.xml index ef2708a8f..d01a7c696 100644 --- a/app/src/main/res/layout/navigation_url.xml +++ b/app/src/main/res/layout/navigation_url.xml @@ -41,7 +41,7 @@ android:layout_marginStart="2dp" android:addStatesFromChildren="true" android:orientation="horizontal" - app:visibleGone="@{!viewmodel.isFocused && viewmodel.isUrlBarButtonsVisible}"> + app:visibleGone="@{!viewmodel.isLibraryVisible && !UrlUtils.isContentFeed(context, viewmodel.url.toString())}"> @@ -109,9 +107,8 @@ android:paddingStart="@{settingsViewmodel.isTrackingProtectionEnabled || (settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed) ? @dimen/navigation_bar_icon_padding_small : @dimen/navigation_bar_icon_padding_big}" android:paddingEnd="2dp" android:src="@{viewmodel.isPopUpBlocked ? @drawable/ic_icon_popup_blocked : @drawable/ic_icon_popup}" - tools:src="@drawable/ic_icon_popup_blocked" android:tint="@color/fog" - android:tooltipText="@{viewmodel.isPopUpBlocked ? @string/popup_blocked_tooltip : @string/popup_tooltip_v1}" + android:tooltipText="@string/popup_tooltip" app:privateMode="@{viewmodel.isPrivateSession}" /> @@ -138,7 +135,6 @@ android:paddingStart="@{settingsViewmodel.isTrackingProtectionEnabled || (settingsViewmodel.isPopUpBlockingEnabled && viewmodel.isPopUpBlocked) || (settingsViewmodel.isDrmEnabled && viewmodel.isDrmUsed) ? @dimen/navigation_bar_icon_padding_small : @dimen/navigation_bar_icon_padding_big}" android:paddingEnd="2dp" android:src="@{viewmodel.isWebXRBlocked ? @drawable/ic_icon_webxr_blocked : @drawable/ic_icon_webxr_allowed}" - tools:src="@drawable/ic_icon_webxr_blocked" app:privateMode="@{viewmodel.isPrivateSession}" android:tint="@color/fog" android:tooltipText="@{viewmodel.isWebXRBlocked ? @string/webxr_blocked_tooltip : @string/webxr_allowed_tooltip}" /> @@ -147,7 +143,8 @@ + app:visibleGone="@{!UrlUtils.isHomeUri(context, viewmodel.url.toString())}"/> + + app:visibleGone="@{(!settingsViewmodel.isTrackingProtectionEnabled && !viewmodel.isPopUpAvailable && !viewmodel.isWebXRUsed) || viewmodel.isLibraryVisible || UrlUtils.isHomeUri(context, viewmodel.url.toString())}"/> + app:visibleGone="@{!viewmodel.isFocused}"> diff --git a/app/src/main/res/layout/tray.xml b/app/src/main/res/layout/tray.xml index 5e5a797d1..9a6ab8df3 100644 --- a/app/src/main/res/layout/tray.xml +++ b/app/src/main/res/layout/tray.xml @@ -102,7 +102,7 @@ app:autoSizeMaxTextSize="10sp" app:autoSizeStepGranularity="2sp" android:background="@drawable/downloads_badge" - android:text="@{(traymodel.downloadsNumber < 100) ? String.valueOf(traymodel.downloadsNumber) : @string/ellipsis}" + android:text="@{(traymodel.downloadsNumber < 100) ? String.valueOf(traymodel.downloadsNumber) : '…'}" visibleGone="@{traymodel.downloadsNumber > 0}"/> diff --git a/app/src/main/res/layout/webxr_interstitial.xml b/app/src/main/res/layout/webxr_interstitial.xml index b6e7c0cad..554a7c25d 100644 --- a/app/src/main/res/layout/webxr_interstitial.xml +++ b/app/src/main/res/layout/webxr_interstitial.xml @@ -38,7 +38,7 @@ android:textAlignment="center" android:textSize="20sp" android:background="@color/black" - android:text="@string/webxr_interstitial_how_to_continue_1"/> + android:text="@string/webxr_interstitial_how_to_continue"/> \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index a651f2e29..afaa45ae2 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -108,7 +108,7 @@ - Ausnahmen für Pop-ups + Pop-up-Berechtigungen @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> User-Agent-Modus - - Standardspeicherplatz für Downloads - Desktop @@ -456,12 +452,6 @@ VR - - Intern - - - Extern - Standard @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> Zuletzt synchronisiert vor %1$d Minuten - - Websites automatisch erlauben, Ihr Gerät zu identifizieren, um DRM-kontrollierte Inhalte wiederzugeben. (<a href="%1$s">Weitere Informationen</a>) + DRM-kontrollierte Inhalte wiedergeben (<a href="http://somesite.com/">Weitere Informationen</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> Virtual-Reality-Geräte (WebXR) - - Erweitert - Sammlung und Nutzung von Daten bei %1$s @@ -879,10 +865,6 @@ bookmarks tray button then a new item is bookmarked. --> Lesezeichen hinzugefügt! - - %1$s heruntergeladen - @@ -934,50 +916,6 @@ clearing history is displayed. --> Chronik löschen - - Downloads - - - Ihre Download-Liste ist leer - - - Hier können Sie auf Ihre Downloads zugreifen - - - Downloads werden geladen - - - Alle entfernen - - - Sortieren nach - - - Nach Namen (von A bis Z) - - - Nach Namen (von Z bis A) - - - Älteste - - - Neueste - - - Kleinste - - - Größte - Synchronisieren @@ -1047,11 +985,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Aus Lesezeichen entfernen - - Löschen - Anzeigeeinstellungen zurücksetzen @@ -1065,7 +998,7 @@ Einstellungen zu Pop-up-Fenstern zurücksetzen - Die folgenden Websites haben die Erlaubnis, Pop-up-Fenster zu öffnen: + Die folgenden Websites bitten um die Erlaubnis, Pop-up-Fenster zu öffnen: @@ -1080,7 +1013,7 @@ - Erweitert + Ausnahmen Controller-Einstellungen zurücksetzen @@ -1175,24 +1108,8 @@ Leeren - Pop-ups nicht blockiert - - - Pop-ups blockiert - - - DRM erlaubt - - - DRM nicht erlaubt + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Pop-up blockiert @@ -1214,14 +1131,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR blockiert - - WebXR\nbeenden - - - Drücken Sie eine beliebige Taste, um fortzufahren - Schutz vor Aktivitätenverfolgung aktiviert @@ -1244,18 +1153,6 @@ In neuem Tab öffnen - - Link herunterladen - - - Video herunterladen - - - Audio herunterladen - - - Grafik herunterladen - Link kopieren @@ -1314,14 +1211,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Chronik schließen - - Downloads öffnen - - - Downloads schließen - Alle löschen @@ -1414,9 +1303,6 @@ Chronik - - Downloads - Löschen @@ -1568,162 +1454,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Warten - - Die Blockierung von Pop-ups ist auf dieser Website %1$s. - - - aktiviert - - - deaktiviert - - WebXR ist auf dieser Website %1$s. <a href="%2$s">Weitere Informationen</a> - - - aktiviert + '%1$s' will be replaced at runtime with the app's name. --> + „%1$s“ möchte auf die WebXR-API zugreifen - - deaktiviert - - + Verbesserter Tracking-Schutz ist für diese Website %1$s. (<a href="%2$s">Weitere Informationen</a>) - - - aktiviert - - - deaktiviert - - - Einige Audio- oder Videodateien auf dieser Seite nutzen DRM-Kopierschutz, der einschränkt, was Sie in %1$s damit tun können. <a href="%2$s">Weitere Informationen</a> - - - aktiviert - - deaktiviert - - - Diese Website enthält DRM-Inhalte. - - - Wenn Sie DRM zulassen, können Websites dieses Gerät bei jedem Besuch identifizieren. <a href="%1$s">Weitere Informationen</a> - - - Erlauben - - - Nicht erlauben + + Aktivieren Deaktivieren - - - Soll %1$s wirklich beendet werden? - - - Abbrechen - - - Beenden - - - Nichtunterstützter Dateityp - - - Die Datei kann nicht geöffnet werden. Soll sie mit einer externen Anwendung geöffnet werden? - - - Abbrechen - - - Öffnen - - - Fehler - - - Für diesen Dateityp wurde keine Anwendung gefunden. - - - Soll diese Datei heruntergeladen werden? - - - Abbrechen - - - Herunterladen - - - Datei löschen - - - Soll diese Datei wirklich gelöscht werden? - - - Diese Datei auch von der Festplatte löschen - - - Alle heruntergeladenen Dateien löschen - - - Sollen wirklich alle heruntergeladenen Dateien gelöscht werden? - - - Diese Dateien auch von der Festplatte löschen - - - Abbrechen - - - Löschen - - - Ein Fehler ist aufgetreten - - - Beim Herunterladen von %1$s ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut. - - - OK - - - Fehlgeschlagen - - - Pausiert - - - Ausstehend - - - Nicht verfügbar - - - Unbekannter Fehler - diff --git a/app/src/main/res/values-en-rGB/strings.xml b/app/src/main/res/values-en-rGB/strings.xml index ab74baca0..3ab2fe42e 100644 --- a/app/src/main/res/values-en-rGB/strings.xml +++ b/app/src/main/res/values-en-rGB/strings.xml @@ -105,7 +105,7 @@ - Exceptions for Pop-Ups + Pop-ups permissions @@ -441,10 +441,6 @@ User-Agent (UA) string of the browser. --> User-Agent Mode - - Downloads Default Storage - Desktop @@ -454,12 +450,6 @@ VR - - Internal - - - External - Standard @@ -617,9 +607,9 @@ when that the content was just synced some time ago. --> Last synchronised %1$d minutes ago - - Automatically allow sites to identify your device to play DRM-controlled content. (<a href="%1$s">Learn More</a>) + Play DRM-Controlled Content (<a href="http://somesite.com/">Learn More</a>) @@ -680,10 +670,6 @@ Devices access to websites (WebXR). --> Virtual Reality Devices (WebXR) - - Advanced - %1$s Data Collection and Use @@ -880,10 +866,6 @@ bookmarks tray button then a new item is bookmarked. --> Saved to Bookmarks! - - %1$s Downloaded - @@ -935,50 +917,6 @@ clearing history is displayed. --> Clear History - - Downloads - - - Your Downloads list is empty - - - You can access your downloads here - - - Loading Downloads - - - Delete All - - - Sort By - - - By Name (from A to Z) - - - By Name (from Z to A) - - - Oldest - - - Newest - - - Smallest - - - Largest - Synchronise @@ -1048,11 +986,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Remove from Bookmarks - - Delete - Reset Display Settings @@ -1066,7 +999,7 @@ Reset Block Pop-Ups Windows Settings - Following web sites have permission to open pop-up windows: + The following web sites have requested to open pop-up windows: @@ -1082,7 +1015,7 @@ - Advanced + Exceptions Reset Controller Settings @@ -1180,16 +1113,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> Pop-Up Blocked - - DRM Allowed - - - DRM Not Allowed - Show site info. @@ -1210,14 +1133,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR Blocked - - Exit\nWebXR - - - Press any other button to continue - Tracking Protection Enabled @@ -1240,18 +1155,6 @@ Open in a new tab - - Download Link - - - Download Video - - - Download Audio - - - Download Image - Copy link @@ -1310,14 +1213,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Close History - - Open Downloads - - - Close Downloads - Remove All @@ -1409,9 +1304,6 @@ History - - Downloads - Clear @@ -1563,162 +1455,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Wait - - Popup blocking is %1$s for this site. - - - On - - - Off - - WebXR is %1$s for this site. <a href="%2$s">Learn More</a> - - - On - - - Off + '%1$s' will be replaced at runtime with the app's name. --> + ‘%1$s’ wants to access WebXR API - + Enhanced Tracking Protection is %1$s for this site. (<a href="%2$s">Learn More</a>) - - On - - - Off - - - Some audio or video on this site uses DRM software, which may limit what %1$s can let you do with it. <a href="%2$s">Learn More</a> - - - On - - - Off - - - This site contains DRM content. - - - Allowing DRM permits sites to identify this device every time you visit. <a href="%1$s">Learn More</a> - - - Allow - - - Don’t allow + + Enable Disable - - - Are you sure you want to exit %1$s? - - - Cancel - - - Quit - - - Unsupported FIle Type - - - The file cannot be opened, Do you want to open it with an external application? - - - Cancel - - - Open - - - Error - - - No application found to handle this file type. - - - Would you like to download this file? - - - Cancel - - - Download - - - Delete file - - - Are you sure you want to delete this file? - - - Also delete the file from disk - - - Delete ALL downloaded files - - - Are you sure you want to delete all the downloaded files? - - - Also delete the files from disk - - - Cancel - - - Delete - - - There was an error - - - An error occurred while downloading %1$s. Please try again. - - - Ok - - - Failed - - - Paused - - - Pending - - - Unavailable - - - Unknown error - diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 1d144160b..21b0ea1e7 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -108,7 +108,7 @@ - Excepciones para ventanas emergentes + Permisos para ventanas emergentes @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> Modo de agente de usuario - - Almacenamiento predeterminado para descargas - Escritorio @@ -456,12 +452,6 @@ VR - - Interno - - - Externo - Estándar @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> Última sincronización hace %1$d minutos - - Permitir que los sitios identifiquen automáticamente el dispositivo para reproducir contenido controlado por DRM. (<a href="%1$s">Saber más</a>) + Reproducir contenido controlado por DRM (<a href="http://somesite.com/">Saber más</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> Dispositivos de realidad virtual (WebXR) - - Avanzado - Recopilación y uso de datos de %1$s @@ -880,10 +866,6 @@ bookmarks tray button then a new item is bookmarked. --> ¡Guardado en Marcadores! - - Se ha descargado %1$s - @@ -935,50 +917,6 @@ clearing history is displayed. --> Limpiar historial - - Descargas - - - La lista de descargas está vacía - - - Puedes acceder a tus descargas aquí - - - Cargando las descargas - - - Eliminar todo - - - Ordenar por - - - Por nombre (de A a Z) - - - Por nombre (de Z a A) - - - Más antiguos - - - Más recientes - - - Más pequeños - - - Más grandes - Sincronizar @@ -1048,11 +986,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Eliminar de Marcadores - - Eliminar - Restablecer los ajustes de visualización @@ -1066,7 +999,7 @@ Restablecer la configuración de bloqueo de ventanas emergentes - Los siguientes sitios web tienen permiso para abrir ventanas emergentes: + Los siguientes sitios web han solicitado abrir ventanas emergentes: @@ -1081,7 +1014,7 @@ - Avanzado + Excepciones Restablecer ajustes del controlador @@ -1176,24 +1109,8 @@ Limpiar - Ventanas emergentes no bloqueadas - - - Ventanas emergentes bloqueadas - - - DRM permitido - - - DRM no permitido + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Ventana emergente bloqueada @@ -1215,14 +1132,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR bloqueado - - Salir de\nWebXR - - - Pulsa cualquier botón para continuar - La protección contra rastreo está activada @@ -1245,18 +1154,6 @@ Abrir en una nueva pestaña - - Descargar enlace - - - Descargar vídeo - - - Descargar audio - - - Descargar imagen - Copiar enlace @@ -1315,14 +1212,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Cerrar Historial - - Abrir descargas - - - Cerrar descargas - Eliminar todos @@ -1415,9 +1304,6 @@ Historial - - Descargas - Limpiar @@ -1570,162 +1456,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Esperar - - El bloqueo de ventanas emergentes está %1$s para este sitio. - - - activado - - - desactivado - - WebXR está %1$s para este sitio. <a href="%2$s">Saber más</a> - - - activado + '%1$s' will be replaced at runtime with the app's name. --> + ‘%1$s’ quiere acceder a la API de WebXR - - desactivado - - + La protección mejorada contra el rastreo está %1$s para este sitio. (<a href="%2$s">Saber más</a>) - - - activado - - - desactivado - - - Parte del audio o vídeo en este sitio usa software DRM, que puede limitar lo que %1$s puede permitirte hacer con él. <a href="%2$s">Saber más</a> - - - Activado - - Desactivado - - - Este sitio tiene contenido DRM. - - - Al activar DRM los sitios podrán identificar este dispositivo cada vez que los visitas. <a href="%1$s">Saber más</a> - - - Permitir - - - No permitir + + Activar Desactivar - - - ¿Seguro que quieres salir de %1$s? - - - Cancelar - - - Salir - - - El tipo de archivo es incompatible - - - El archivo no se puede abrir. ¿Quieres abrirlo con una aplicación externa? - - - Cancelar - - - Abrir - - - Error - - - No se ha encontrado ninguna aplicación para manejar este tipo de archivo. - - - ¿Quieres descargar este archivo? - - - Cancelar - - - Descargar - - - Eliminar archivo - - - ¿Estás seguro de que deseas eliminar este archivo? - - - Eliminar también el archivo del disco - - - Eliminar todos los archivos descargados - - - ¿Estás seguro de que deseas eliminar todos los archivos descargados? - - - También eliminar los archivos del disco - - - Cancelar - - - Eliminar - - - Se ha producido un error - - - Se ha producido un error al descargar %1$s. Inténtalo de nuevo. - - - Aceptar - - - Fallido - - - Pausado - - - Pendiente - - - No disponible - - - Error desconocido - diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index ee3353296..13088cc02 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -108,7 +108,7 @@ - Exceptions pour les popups + Autorisations popups @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> Mode agent utilisateur - - Stockage par défaut pour les téléchargements - Ordinateur @@ -456,12 +452,6 @@ VR - - Interne - - - Externe - Standard @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> Dernière synchronisation : il y a %1$d minutes - - Autoriser automatiquement les sites à identifier votre appareil pour lire du contenu contrôlé par DRM. (<a href="%1$s">En savoir plus</a>) + Lire du contenu contrôlé par DRM (<a href="http://somesite.com/">En savoir plus</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> Dispositifs de réalité virtuelle (WebXR) - - Avancé - Collecte et utilisation de données par %1$s @@ -762,7 +748,7 @@ - Aidez Mozilla à améliorer %1$s en envoyant vos données de plantage. <a href="more">En savoir plus</a> + Aidez Mozilla à améliorer %1$s en envoyant vos données de plantage. @@ -878,10 +864,6 @@ bookmarks tray button then a new item is bookmarked. --> Enregistré dans les marque-pages ! - - %1$s téléchargé - @@ -933,50 +915,6 @@ clearing history is displayed. --> Effacer l’historique - - Téléchargements - - - Votre liste de téléchargements est vide - - - Vous pouvez accéder à vos téléchargements ici - - - Chargement des téléchargements - - - Tout supprimer - - - Trier par - - - Par nom (de A à Z) - - - Par nom (de Z à A) - - - Le plus ancien - - - Le plus récent - - - Le plus petit - - - Le plus grand - Synchroniser @@ -1046,11 +984,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Supprimer des marque-pages - - Supprimer - Réinitialiser les paramètres d’affichage @@ -1064,7 +997,7 @@ Réinitialiser les paramètres de blocage des fenêtres popup - Les sites web suivants sont autorisés à ouvrir des fenêtres popup : + Les sites web suivants ont demandé à ouvrir des fenêtres popup : @@ -1079,7 +1012,7 @@ - Avancé + Exceptions Réinitialiser les paramètres du contrôleur @@ -1174,24 +1107,8 @@ Effacer - Fenêtres popup non bloquées - - - Fenêtres popup bloquées - - - DRM autorisé - - - DRM non autorisé + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Fenêtre popup bloquée @@ -1213,14 +1130,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR bloqué - - Quitter\nWebXR - - - Appuyez sur n’importe quel autre bouton pour continuer - Protection contre le pistage activée @@ -1243,18 +1152,6 @@ Ouvrir dans un nouvel onglet - - Télécharger la cible du lien - - - Télécharger la vidéo - - - Télécharger l’audio - - - Télécharger l’image - Copier le lien @@ -1313,14 +1210,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Fermer l’historique - - Ouvrir les téléchargements - - - Fermer les téléchargements - Tout supprimer @@ -1411,9 +1300,6 @@ Historique - - Téléchargements - Effacer @@ -1566,162 +1452,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Patienter - - Le blocage des fenêtres popup est %1$s pour ce site. - - - activé - - - désactivé - - WebXR est %1$s pour ce site. <a href="%2$s">En savoir plus</a> - - - activé + '%1$s' will be replaced at runtime with the app's name. --> + « %1$s » souhaite accéder à l’API WebXR - - désactivé - - + La protection renforcée contre le pistage est %1$s pour ce site. (<a href="%2$s">En savoir plus</a>) - - - activée - - - désactivée - - - De l’audio ou de la vidéo sur ce site utilise des DRM, ce qui peut limiter les actions que vous permet %1$s sur ces éléments. <a href="%2$s">En savoir plus</a> - - - Activé - - Désactivé - - - Ce site contient du contenu DRM. - - - Autoriser les DRM permet aux sites d’identifier cet appareil à chaque fois que vous les visitez. <a href="%1$s">En savoir plus</a> - - - Autoriser - - - Ne pas autoriser + + Activer Désactiver - - - Voulez-vous vraiment quitter %1$s ? - - - Annuler - - - Quitter - - - Type de fichier non pris en charge - - - Impossible d’ouvrir le fichier. Voulez-vous l’ouvrir avec une application externe ? - - - Annuler - - - Ouvrir - - - Erreur - - - Aucune application n’a été trouvée pour gérer ce type de fichier. - - - Voulez-vous télécharger ce fichier ? - - - Annuler - - - Télécharger - - - Supprimer le fichier - - - Voulez-vous vraiment supprimer ce fichier ? - - - Supprimer également le fichier du disque - - - Supprimer tous les fichiers téléchargés - - - Voulez-vous vraiment supprimer tous les fichiers téléchargés ? - - - Supprimer également les fichiers du disque - - - Annuler - - - Supprimer - - - Une erreur est survenue - - - Une erreur s’est produite lors du téléchargement de %1$s. Veuillez réessayer. - - - OK - - - Échec - - - En pause - - - En attente - - - Indisponible - - - Erreur inconnue - diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 320923516..b261b1a8f 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -108,7 +108,7 @@ - Eccezioni per i pop-up + Permessi per i pop-up @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> User-Agent: - - Archiviazione predefinita per i download - Desktop @@ -456,12 +452,6 @@ VR - - Interna - - - Esterna - Normale @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> Ultima sincronizzazione: %1$d minuti fa - - Consenti automaticamente ai siti di identificare il tuo dispositivo per riprodurre contenuti gestiti con DRM (<a href="%1$s">ulteriori informazioni</a>). + Riproduci contenuti protetti da DRM (<a href="http://somesite.com/">Scopri di più</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> Dispositivi per realtà virtuale (WebXR) - - Avanzate... - Raccolta e utilizzo dati di %1$s @@ -878,10 +864,6 @@ bookmarks tray button then a new item is bookmarked. --> Salvato nei segnalibri. - - %1$s scaricato - @@ -933,50 +915,6 @@ clearing history is displayed. --> Cancella cronologia - - Download - - - L’elenco dei download è vuoto - - - Puoi accedere ai file scaricati qui - - - Caricamento dei download… - - - Elimina tutto - - - Ordina per - - - Per nome (dalla A alla Z) - - - Per nome (dalla Z alla A) - - - Meno recente - - - Più recente - - - Più piccolo - - - Più grande - Sincronizza @@ -1046,11 +984,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Rimuovi dai segnalibri - - Elimina - Ripristina impostazioni di visualizzazione @@ -1064,7 +997,7 @@ Ripristina le impostazioni di blocco pop-up di Windows - I seguenti siti web hanno il permesso di aprire finestre pop-up: + I seguenti siti web hanno richiesto l’apertura di finestre pop-up: @@ -1079,7 +1012,7 @@ - Avanzate... + Eccezioni Ripristina impostazioni controller @@ -1174,24 +1107,8 @@ Cancella - Pop-up non bloccati - - - Pop-up bloccati - - - DRM consentito - - - DRM non consentito + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Pop-up bloccato @@ -1213,14 +1130,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR bloccato - - Esci da\nWebXR - - - Premi un pulsante qualsiasi per continuare - Protezione antitracciamento attivata @@ -1243,18 +1152,6 @@ Apri in una nuova scheda - - Scarica link - - - Scarica video - - - Scarica audio - - - Scarica immagine - Copia link @@ -1313,14 +1210,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Chiudi cronologia - - Apri l’elenco dei download - - - Chiudi l’elenco dei download - Rimuovi tutto @@ -1416,9 +1305,6 @@ Cronologia - - Download - Cancella @@ -1571,162 +1457,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Attendi - - Il blocco pop-up per questo sito è %1$s. - - - Attivato - - - Disattivato - - WebXR è %1$s per questo sito. <a href="%2$s">Ulteriori informazioni</a> - - - Attivato + '%1$s' will be replaced at runtime with the app's name. --> + ‘%1$s’ sta tentando di accedere all’API WebXR - - Disattivato - - + La protezione antitracciamento avanzata è %1$s per questo sito. (<a href="%2$s">Ulteriori informazioni</a>) - - - Attivata - - - Disattivata - - - Alcuni contenuti audio o video in questo sito utilizzano software DRM. Questo potrebbe limitare le azioni dell’utente in %1$s. <a href="%2$s">Ulteriori informazioni</a> - - - Attivato - - Disattivato - - - Questo sito presenta contenuti DRM. - - - Se si consente la riproduzione di contenuti DRM, i siti identificheranno il dispositivo in uso a ogni futura visita. <a href="%1$s">Ulteriori informazioni</a> - - - Consenti - - - Non consentire + + Attiva Disattiva - - - Uscire da %1$s? - - - Annulla - - - Esci - - - Tipo di file non supportato - - - Impossibile aprire il file. Vuoi aprirlo con un’applicazione esterna? - - - Annulla - - - Apri - - - Errore - - - Nessuna applicazione trovata per gestire questo tipo di file. - - - Scaricare questo file? - - - Annulla - - - Scarica - - - Elimina file - - - Eliminare questo file? - - - Elimina il file anche dal disco - - - Elimina tutti i file scaricati - - - Eliminare tutti i file scaricati? - - - Elimina i file anche dal disco - - - Annulla - - - Elimina - - - Si è verificato un errore - - - Si è verificato un errore durante il download di %1$s. Riprovare. - - - OK - - - Non riuscito - - - In pausa - - - In sospeso - - - Non disponibile - - - Errore sconosciuto - diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 1a929e96f..f4cdec4dc 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -108,7 +108,7 @@ - ポップアップの例外 + ポップアップの許可設定 @@ -427,10 +427,6 @@ User-Agent (UA) string of the browser. --> ユーザーエージェントモード - - ダウンロード先の既定のストレージ - デスクトップ @@ -440,12 +436,6 @@ VR - - 内部 - - - 外部 - 標準 @@ -599,7 +589,11 @@ when that the content was just synced some time ago. --> 最終同期日時: %1$d 分前 - + DRM 制御のコンテンツを再生 (<a href="http://somesite.com/">詳細</a>) + + 再起動後にタブとウィンドウを復元する @@ -984,6 +978,9 @@ ポップアップウィンドウのブロック設定をリセット + + 次のウェブサイトがポップアップウィンドウの表示を要求しています: + ポップアップウィンドウが表示されるウェブサイトを開くと、ポップアップのブロックを選択するダイアログが表示されます。 @@ -995,6 +992,10 @@ 強化型トラッキング防止。 (<a href="%1$s">詳細情報</a>) + + 例外 + コントローラーの設定をリセット @@ -1427,12 +1428,12 @@ the Select` button. When clicked it closes all the previously selected tabs --> 待機 - + このサイトでの強化型トラッキング防止は %1$s です。 (<a href="%2$s">詳細情報</a>) - + + + 有効化 + 無効化 - - + diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index c92e9d4a2..553af9e5f 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -108,7 +108,7 @@ - 팝업 예외 + 팝업 권한 @@ -141,7 +141,7 @@ 향상된 추적 방지 기능에 대한 예외 초기화 - 허용 + 허가 차단 @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> 사용자 에이전트 모드 - - 기본 다운로드 저장소 - 바탕화면 @@ -456,12 +452,6 @@ VR - - 내부 - - - 외부 - 표준 @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> 마지막 동기화: %1$d분 전 - - 사이트에서 사용자의 기기를 식별하여 DRM 제어 콘텐츠를 재생하도록 자동으로 허용합니다. (<a href="%1$s">더 알아보기</a>) + DRM 제어 콘텐츠 재생 (<a href="http://somesite.com/">더 알아보기</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> 가상 현실 기기 (WebXR) - - 고급 - %1$s 데이터 수집과 사용 @@ -704,10 +690,10 @@ - 켜짐 + 켜기 - 꺼짐 + 끄기 @@ -735,7 +721,7 @@ - 다시 시도하세요. + 다시 시도해 주세요. @@ -880,10 +866,6 @@ bookmarks tray button then a new item is bookmarked. --> 북마크에 저장되었습니다! - - %1$s 다운로드 완료 - @@ -935,50 +917,6 @@ clearing history is displayed. --> 기록 삭제 - - 다운로드 - - - 다운로드 목록이 비어 있습니다 - - - 여기에서 다운로드에 액세스 할 수 있습니다 - - - 다운로드 로딩 중 - - - 모두 삭제 - - - 정렬 기준 - - - 이름순 (A에서 Z로) - - - 이름순 (Z에서 A로) - - - 오래된 항목순 - - - 최신 항목순 - - - 작은 항목순 - - - 큰 항목순 - 동기화 @@ -1048,11 +986,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> 북마크 삭제 - - 삭제 - 디스플레이 설정 초기화 @@ -1066,7 +999,7 @@ 팝업 차단 창 설정 초기화 - 다음 웹 사이트는 팝업 창을 열 수 있는 권한이 있음: + 다음 웹 사이트는 팝업 창을 열도록 요청됨: @@ -1081,7 +1014,7 @@ - 고급 + 예외 컨트롤러 설정 초기화 @@ -1176,24 +1109,8 @@ 지우기 - 팝업 차단 안 됨 - - - 팝업 차단됨 - - - DRM 허용됨 - - - DRM 허용 안 됨 + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + 팝업 차단 @@ -1215,14 +1132,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR 차단됨 - - 종료\nWebXR - - - 계속하려면 다른 버튼을 누르세요 - 추적 방지 기능 사용함 @@ -1245,18 +1154,6 @@ 새 탭에 열기 - - 링크 다운로드 - - - 동영상 다운로드 - - - 오디오 다운로드 - - - 이미지 다운로드 - 링크 복사 @@ -1315,14 +1212,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> 기록 닫기 - - 다운로드 열기 - - - 다운로드 닫기 - 모두 삭제 @@ -1415,9 +1304,6 @@ 기록 - - 다운로드 - 지우기 @@ -1428,7 +1314,7 @@ %1$s가 이 사이트에서 팝업을 차단했습니다 - 어쨌든 보시겠습니까? + 어쨌든 볼까요? @@ -1571,162 +1457,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> 대기 - - 이 사이트의 팝업 차단은 %1$s입니다. - - - 켜짐 - - - 꺼짐 - - 이 사이트의 WebXR은 %1$s입니다. <a href="%2$s">더 알아보기</a> - - - 켜짐 + '%1$s' will be replaced at runtime with the app's name. --> + ‘%1$s’가 WebXR API에 액세스하려고 합니다 - - 꺼짐 - - + 이 사이트의 향상된 추적 방지 기능은 %1$s입니다. (<a href="%2$s">더 알아보기</a>) - - - 켜짐 - - - 꺼짐 - - - 이 사이트의 일부 오디오 또는 비디오는 DRM 소프트웨어를 사용하므로 %1$s으로 할 수 있는 일을 제한 할 수 있습니다. <a href="%2$s">더 알아보기</a> - - - 켜짐 - - 꺼짐 - - - 이 사이트에는 DRM 콘텐츠가 포함되어 있습니다. - - - DRM을 허용하면 사이트에서 사용자가 방문할 때마다 이 기기를 식별 할 수 있습니다. <a href="%1$s">더 알아보기</a> - - - 허용 - - - 허용 안 함 + + 사용함 사용 안 함 - - - %1$s를 종료하시겠습니까? - - - 취소 - - - 종료 - - - 지원되지 않는 파일 형식 - - - 파일을 열 수 없습니다. 외부 응용 프로그램으로 파일을 여시겠습니까? - - - 취소 - - - 열기 - - - 오류 - - - 이 파일 형식을 처리하는 응용 프로그램이 없습니다. - - - 이 파일을 다운로드 하시겠습니까? - - - 취소 - - - 다운로드 - - - 파일 삭제 - - - 이 파일을 삭제하시겠습니까? - - - 디스크에서도 파일 삭제 - - - 다운로드한 파일 모두 삭제 - - - 다운로드한 파일을 모두 삭제하시겠습니까? - - - 디스크에서도 파일 삭제 - - - 취소 - - - 삭제 - - - 오류 발생 - - - %1$s 파일을 다운로드하는 동안 오류가 발생했습니다. 다시 시도하세요. - - - 확인 - - - 실패 - - - 일시 중지 - - - 보류 중 - - - 유효하지 않음 - - - 알 수 없는 오류 - diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index ef3d4fbf9..ba1aefbfe 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -109,38 +109,12 @@ - Unntak for sprettopp-vinduer + Tillatelser for sprettoppvinduer Du kan spesifisere hvilke nettsteder som kan åpne sprettoppvinduer - - Tillatelser for virtuell virkelighet - - - Følgende nettsteder er blokkert fra å la WebXR API få tilgang til VR-enheten din. - - - Når du åpner et nettsted som bruker WebXR, kan du åpne en dialog som lar deg blokkere WebXR på det nettstedet. - - - Tilbakestill nettstedene som ikke har tilgang til virtuell virkelighet-enheter. - - - Unntak for utvidet sporingsbeskyttelse - - - Du har slått av beskyttelsen på disse nettstedene. - - - Når du lar et nettsted spore aktiviteten din, vil de vises her. - - - Tilbakestill unntakene for utvidet sporingsbeskyttelse. - Tillat @@ -385,12 +359,6 @@ --> Aktiver forbigåing av hurtigbuffer ved omlasting - - Aktiver Multi-e10s - Slå på Servo @@ -444,10 +412,6 @@ User-Agent (UA) string of the browser. --> Brukeragent-modus - - Standard lagringplass for nedlastinger - Datamaskin @@ -457,30 +421,15 @@ VR - - Intern - - - Ekstern - Standard - - Balansert for beskyttelse og ytelse. Sider lastes normalt. - Streng - - Sterkere beskyttelse, men kan føre til at noen nettsteder eller innhold ikke vil fungere. - Av - - Tillat hver side å følge deg rundt på nettet for å samle inn informasjon om dine vaner og interesser. - Sist synkronisert for %1$d minutt siden - - La nettsteder automatisk identifisere enheten din for å spille av DRM-kontrollert innhold. (<a href="%1$s">Les mer</a>) + Spill av DRM-kontrollert innhold (<a href="http://somesite.com/">les mer</a>) @@ -678,14 +627,6 @@ pop-up blocked sites. --> Avansert - - Virtuell virkelighet-enheter (WebXR) - - - Avansert - %1$s datainnsamling og bruk @@ -881,10 +822,6 @@ bookmarks tray button then a new item is bookmarked. --> Lagret til bokmerker! - - %1$s lastet ned - @@ -936,50 +873,6 @@ clearing history is displayed. --> Tøm historikk - - Nedlastinger - - - Nedlastingslisten din er tom - - - Du får tilgang til nedlastningene dine her - - - Laster nedlastinger - - - Slett alle - - - Sorter etter - - - Etter navn (fra A til Å) - - - Etter navn (fra Å til A) - - - Eldst - - - Nyest - - - Minst - - - Størst - Synkroniser @@ -1049,11 +942,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Fjern fra bokmerker - - Slett - Tilbakestill skjerminnstillinger @@ -1067,7 +955,7 @@ Tilbakestill blokker sprettoppvinduer-innstillinger - Følgende nettsteder har tillatelse til å åpne sprettoppvinduer: + Følgende nettsteder har bedt om å åpne sprettoppvinduer: @@ -1077,12 +965,9 @@ when there are no exceptions. --> En liste over nettsteder med tillatelser vises her. - - Utvidet sporingsbeskyttelse. (<a href="%1$s">Les mer</a>) - - Avansert + Unntak Tilbakestill kontrollerinnstillinger @@ -1177,24 +1062,8 @@ Tøm - Sprettoppvindu ikke blokkert - - - Sprettoppvindu blokkert - - - DRM tillatt - - - DRM ikke tillatt + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Sprettoppvindu blokkert @@ -1216,22 +1085,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR blokkert - - Avslutt\nWebXR - - - Trykk på en hvilken som helst annen knapp for å fortsette - - - Sporbeskyttelse er aktivert - - - Sporingsbeskyttelse er deaktivert - Start privat nettlesing @@ -1246,18 +1099,6 @@ Åpne i en ny fane - - Last ned lenke - - - Last ned video - - - Last ned lyd - - - Last ned bilde - Kopier lenke @@ -1316,14 +1157,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Lukk historikk - - Åpne nedlastinger - - - Lukk nedlastinger - Fjern alle @@ -1417,9 +1250,6 @@ Historikk - - Nedlastinger - Tøm @@ -1569,163 +1399,11 @@ the Select` button. When clicked it closes all the previously selected tabs --> Vent - - - Blokkering av sprettoppvinduer er %1$s for dette nettstedet. - - - - - - Av - - - WebXR er %1$s for dette nettstedet. <a href="%2$s">Les mer</a> - - - - - - Av - - - Utvidet sporingsbeskyttelse er %1$s for dette nettstedet. <a href="%2$s">Les mer</a> - - - - Av - - - Noe lyd eller video på denne siden bruker DRM-programvare, som kan begrense hva %1$s lar deg gjøre med den. <a href="%2$s">Les mer</a> - - - - - - Av - - - Dette nettstedet inneholder DRM-innhold. - - - Hvis du tillater DRM, tillater nettsteder å identifisere denne enheten hver gang du besøker. <a href="%1$s">Les mer</a> - - - Tillat - - - Ikke tillat + + Slå på Slå av - - - Er du sikker på at du vil avslutte %1$s? - - - Avbryt - - - Avslutt - - - Ustøttet filtype - - - Filen kan ikke åpnes. Vil du åpne den med en ekstern applikasjon? - - - Avbryt - - - Åpne - - - Feil - - - Fant ingen applikasjoner for å håndtere denne filtypen. - - - Vil du laste ned denne filen? - - - Avbryt - - - Last ned - - - Slett fil - - - Er du sikker på at du vil slette denne filen? - - - Slett også filen fra disken - - - Slett alle nedlastede filer - - - Er du sikker på at du vil slette alle nedlastede filer? - - - Slett også filene fra disken - - - Avbryt - - - Slett - - - En feil oppstod - - - Det oppstod en feil under nedlasting av %1$s. Prøv på nytt. - - - Ok - - - Feilet - - - Pauset - - - Ventende - - - Utilgjengelig - - - Ukjent feil - diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 664d0aa48..4c7f054d6 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -109,7 +109,7 @@ - Uitzonderingen voor pop-ups + Pop-uptoestemmingen @@ -444,10 +444,6 @@ User-Agent (UA) string of the browser. --> Useragent-modus: - - Standaard opslaglocatie voor downloads - Desktop @@ -457,12 +453,6 @@ VR - - Intern - - - Extern - Standaard @@ -621,9 +611,9 @@ when that the content was just synced some time ago. --> Laatst gesynchroniseerd: %1$d minuten geleden - - Websites toestaan uw apparaat automatisch te identificeren om DRM-gecontroleerde inhoud af te kunnen spelen. (<a href="%1$s">Meer info</a>) + DRM-gecontroleerde inhoud afspelen (<a href="http://somesite.com/">Meer info</a>) @@ -684,10 +674,6 @@ Devices access to websites (WebXR). --> Virtual Reality-apparaten (WebXR) - - Geavanceerd - Verzamelen en gebruik van gegevens door %1$s @@ -883,10 +869,6 @@ bookmarks tray button then a new item is bookmarked. --> Opgeslagen als bladwijzer! - - %1$s gedownload - @@ -939,50 +921,6 @@ clearing history is displayed. --> Geschiedenis wissen - - Downloads - - - Uw lijst met downloads is leeg - - - U kunt uw downloads hier vinden - - - Downloads laden - - - Alles verwijderen - - - Sorteren op - - - Op naam (van A tot Z) - - - Op naam (van Z tot A) - - - Oudste - - - Nieuwste - - - Kleinste - - - Grootste - Sync @@ -1052,11 +990,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Verwijderen uit bladwijzers - - Verwijderen - Weergave-instellingen herinitialiseren @@ -1070,7 +1003,7 @@ Instellingen voor blokkeren van pop-upvensters herinitialiseren - De volgende websites mogen pop-upvensters openen: + De volgende websites hebben het openen van pop-upvensters aangevraagd: @@ -1085,7 +1018,7 @@ - Geavanceerd + Uitzonderingen Controllerinstellingen herinitialiseren @@ -1180,24 +1113,8 @@ Wissen - Pop-ups niet geblokkeerd - - - Pop-ups geblokkeerd - - - DRM toegestaan - - - DRM niet toegestaan + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Pop-up geblokkeerd @@ -1219,14 +1136,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR geblokkeerd - - WebXR\nafsluiten - - - Druk een andere toets om door te gaan - Bescherming tegen volgen ingeschakeld @@ -1249,18 +1158,6 @@ Openen in een nieuw tabblad - - Koppeling downloaden - - - Video downloaden - - - Audio downloaden - - - Afbeelding downloaden - Koppeling kopiëren @@ -1319,14 +1216,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Geschiedenis sluiten - - Downloads openen - - - Downloads sluiten - Alles verwijderen @@ -1424,9 +1313,6 @@ Geschiedenis - - Downloads - Wissen @@ -1578,162 +1464,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Wachten - - Pop-upblokkering staat %1$s voor deze website. - - - Aan - - - Uit - - WebXR staat %1$s voor deze website. <a href="%2$s">Meer info</a> - - - Aan + '%1$s' will be replaced at runtime with the app's name. --> + ‘%1$s’ wil toegang tot de WebXR-API - - Uit - - + Verbeterde bescherming tegen volgen is %1$s voor deze website. (<a href="%2$s">Meer info</a>) - - Aan - - - Uit - - - Sommige audio- of videobestanden op deze pagina gebruiken DRM-software die %1$s kan beperken in wat u ermee wilt doen. <a href="%2$s">Meer info</a> - - - Aan - - - Uit - - - Deze website bevat DRM-inhoud. - - - Door DRM toe te staan kunnen websites dit apparaat bij elk bezoek identificeren. <a href="%1$s">Meer info</a> - - - Toestaan - - - Niet toestaan + + Inschakelen Uitschakelen - - - Weet u zeker dat u %1$s wilt afsluiten? - - - Annuleren - - - Afsluiten - - - Niet-ondersteund bestandstype - - - Het bestand kan niet worden geopend. Wilt u het openen met een externe toepassing? - - - Annuleren - - - Openen - - - Fout - - - Geen toepassing gevonden voor dit bestandstype. - - - Wilt u dit bestand downloaden? - - - Annuleren - - - Downloaden - - - Bestand verwijderen - - - Weet u zeker dat u dit bestand wilt verwijderen? - - - Bestand ook van schijf verwijderen - - - Alle gedownloade bestanden verwijderen - - - Weet u zeker dat u alle gedownloade bestanden wilt verwijderen? - - - De bestanden ook van schijf verwijderen - - - Annuleren - - - Verwijderen - - - Er is een fout opgetreden - - - Er is een fout opgetreden bij het downloaden van %1$s. Probeer het opnieuw. - - - OK - - - Mislukt - - - Gepauzeerd - - - In behandeling - - - Niet beschikbaar - - - Onbekende fout - diff --git a/app/src/main/res/values-nn-rNO/strings.xml b/app/src/main/res/values-nn-rNO/strings.xml index 5d925e9bb..cf669d8ec 100644 --- a/app/src/main/res/values-nn-rNO/strings.xml +++ b/app/src/main/res/values-nn-rNO/strings.xml @@ -106,6 +106,10 @@ describes Mozilla's Privacy Policy. --> Personvernpraksis + + Løyve for sprettoppvindauge + Du kan spesifisere kva for nettstadar som kan opne sprettoppvindauge @@ -330,6 +334,13 @@ and is used to customize background environments of the app. --> Aktiver overstyring av miljøet + + Aktiver multiprosess + +--> Aktiver UI-maskinvareakselerasjon @@ -445,7 +456,7 @@ - Bruk standard utviklarinnstillingar + Tilbakestill utviklerinnstillingar Tilbakestill @@ -548,7 +559,11 @@ when that the content was just synced some time ago. --> Sist synkronisert for %1$d minutt sidan - + Spel av DRM-kontrollert innhald (<a href="http://somesite.com/">les meir</a>) + + Rett oppatt faner og vindauge etter omstart @@ -918,10 +933,10 @@ Fjern frå bokmerke - Bruk standard skjerminnstillingar + Tilbakestill skjerminnstillingar - Bruk standard innstillingar for personvern og sikkerheit + Tilbakestill innstillingar for personvern og sikkerheit Fjern alle @@ -929,6 +944,9 @@ Tilbakestill innstillingane for Blokker sprettoppvindauge + + Følgjande nettstadar har bedt om å opne sprettoppvindauge: + Når du opnar ein nettstad med sprettoppvindauge, vil du sjå ein dialog som lar deg velje å blokkere sprettoppvindauge. @@ -938,19 +956,19 @@ Ei liste over nettstadar med løyve vert viste her. - Bruk standard kontrollinnstillingar + Tilbakestill kontrollerinnstillingar - Bruk standard miljøinnstillingar + Tilbakestill miljøinnstillingar - Bruk standard for språkinnstillingar for stemmesøk + Tilbakestill språkinnstillingar for stemmesøk - Bruk standard visingsspråk + Tilbakestill visingsspråk - Bruk standard føretrekte språk for nettstadar + Tilbakestill føretrekte språk for nettstadar Tilbakestill alle språkinnstillingar @@ -1356,8 +1374,4 @@ the Select` button. When clicked it closes all the previously selected tabs --> Vent - - - Er du sikker på at du vil slette alle nedlasta filer? - - + diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 7053651a9..765fe8c2d 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -109,7 +109,7 @@ - Исключения для всплывающих окон + Настройки всплывающих окон @@ -444,10 +444,6 @@ User-Agent (UA) string of the browser. --> User-Agent - - Хранилище загрузок по умолчанию - Компьютер @@ -457,12 +453,6 @@ VR-шлем - - Встроенное - - - Внешнее - Стандартная @@ -473,7 +463,7 @@ Строгая - Усиленная защита может вызывать проблемы с некоторыми сайтами и их содержимым. + Усиленная защита может вызывать проблемы с некоторыми веб-сайтами и их содержимым. Отключена @@ -619,9 +609,9 @@ when that the content was just synced some time ago. --> Последняя синхронизация: %1$d минут назад - - Разрешать сайтам идентифицировать ваше устройство для воспроизведения DRM-управляемого содержимого автоматически. (<a href="%1$s">Узнать больше</a>) + Воспроизводить контролируемое DRM содержимое (<a href="http://somesite.com/">Узнать больше</a>) @@ -682,10 +672,6 @@ Devices access to websites (WebXR). --> Устройства виртуальной реальности (WebXR) - - Дополнительно - Сбор и использование данных %1$s @@ -880,10 +866,6 @@ bookmarks tray button then a new item is bookmarked. --> Сохранено в закладках! - - %1$s загружен - @@ -935,50 +917,6 @@ clearing history is displayed. --> Удалить историю - - Загрузки - - - Ваш список загрузок пуст - - - Вы можете получить доступ к загрузкам здесь - - - Обработка загрузок - - - Удалить все - - - Сортировать по - - - Имени (от А до Я) - - - Имени (от Я до А) - - - От старых к новым - - - От новых к старым - - - От мелких к крупным - - - От крупных к мелким - Синхронизировать @@ -1048,11 +986,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Удалить из закладок - - Удалить - Сбросить настройки отображения @@ -1066,7 +999,7 @@ Сброс настроек блокировки всплывающих окон - Следующие сайты могут открывать всплывающие окна: + Следующие сайты хотят открывать всплывающие окна: @@ -1081,7 +1014,7 @@ - Дополнительно + Исключения Сбросить настройки контроллера @@ -1177,24 +1110,8 @@ Очистить - Всплывающие окна не блокируются - - - Всплывающие окна блокируются - - - DRM разрешён - - - DRM запрещён + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Всплывающее окно заблокировано @@ -1216,14 +1133,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR запрещён - - Выйти из\nWebXR - - - Чтобы продолжить, нажмите любую кнопку - Защита от отслеживания включена @@ -1246,18 +1155,6 @@ Открыть в новой вкладке - - Загрузить ссылку - - - Загрузить видео - - - Загрузить аудио - - - Загрузить изображение - Копировать ссылку @@ -1316,14 +1213,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Закрыть историю - - Открыть загрузки - - - Закрыть загрузки - Удалить всё @@ -1415,9 +1304,6 @@ История - - Загрузки - Удалить @@ -1569,162 +1455,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Подождать - - Блокировка всплывающих окон %1$s для этого сайта. - - - включена - - - отключена - - WebXR %1$s для этого сайта. <a href="%2$s">Узнать больше</a> - - - включён + '%1$s' will be replaced at runtime with the app's name. --> + «%1$s» хочет получить доступ к WebXR API - - отключён - - + Улучшенная защита от отслеживания %1$s для этого веб-сайта. (<a href="%2$s">Подробнее</a>) - - - Включена - - - Отключена - - - Некоторое аудио или видео на этом сайте использует программу DRM, что может ограничить возможности, предоставляемые вам %1$s. <a href="%2$s">Узнать больше</a> - - - Включён - - Отключён - - - Этот сайт содержит содержимое DRM. - - - Разрешение DRM позволяет сайтам идентифицировать это устройство каждый раз, когда вы на них заходите. <a href="%1$s">Узнать больше</a> - - - Разрешить - - - Не разрешать + + Включить Отключить - - - Вы уверены, что хотите выйти из %1$s? - - - Отмена - - - Выйти - - - Неподдерживаемый тип файла - - - Этот файл не может быть открыт. Хотели бы вы открыть его с помощью стороннего приложения? - - - Отмена - - - Открыть - - - Ошибка - - - Для данного типа файла ни одного приложения не найдено. - - - Вы хотите загрузить этот файл? - - - Отмена - - - Загрузить - - - Удалить файл - - - Вы действительно хотите удалить этот файл? - - - Также удалить файл с диска - - - Удалить все загруженные файлы - - - Вы уверены, что хотите удалить все загруженные файлы? - - - Также удалить файлы с диска - - - Отмена - - - Удалить - - - Произошла ошибка - - - При загрузке %1$s произошла ошибка. Пожалуйста, попробуйте ещё раз. - - - Ок - - - Неудача - - - Приостановлено - - - В ожидании - - - Недоступно - - - Неизвестная ошибка - diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index 337b6d760..155cdfc06 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -108,7 +108,7 @@ - Undantag för pop-ups + Popup-behörigheter @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> Användaragentläge - - Standardlagring för hämtningar - Dator @@ -456,12 +452,6 @@ VR - - Intern - - - Extern - Standard @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> Senast synkroniserad %1$d minuter sedan - - Tillåt webbplatser automatiskt identifiera din enhet för att spela DRM-kontrollerat innehåll. (<a href="%1$s">Läs mer</a>) + Spela DRM-kontrollerat innehåll (<a href="http://somesite.com/">Läs mer</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> Virtual Reality Enheter (WebXR) - - Avancerat - %1$s datainsamling och användning @@ -879,10 +865,6 @@ bookmarks tray button then a new item is bookmarked. --> Sparat i bokmärken! - - %1$s hämtad - @@ -934,50 +916,6 @@ clearing history is displayed. --> Rensa historik - - Hämtningar - - - Din nedladdningslista är tom - - - Du kan komma åt dina hämtningar här - - - Laddar hämtningar - - - Ta bort alla - - - Sortera efter - - - Efter namn (från A till Ö) - - - Efter namn (från Ö till A) - - - Äldst - - - Nyast - - - Minst - - - Störst - Synkronisera @@ -1047,11 +985,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> Ta bort från bokmärken - - Ta bort - Återställ skärminställningar @@ -1065,7 +998,7 @@ Återställ blockeringsinställningar för popup-fönster - Följande webbplatser har tillåtelse att öppna popup-fönster: + Följande webbplatser har begärt att få öppna popup-fönster: @@ -1080,7 +1013,7 @@ - Avancerat + Undantag Återställ kontrollinställningar @@ -1175,24 +1108,8 @@ Rensa - Pop-ups är inte blockerade - - - Pop-ups är blockerade - - - DRM tillåtet - - - DRM inte tillåtet + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Pop-up blockerad @@ -1214,14 +1131,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> WebXR blockerat - - Avsluta \nWebXR - - - Tryck på någon annan knapp för att fortsätta - Spårningsskydd aktiverat @@ -1244,18 +1153,6 @@ Öppna i en ny flik - - Ladda ner länk - - - Ladda ner video - - - Ladda ner ljud - - - Ladda ner bild - Kopiera länk @@ -1314,14 +1211,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> Stäng historik - - Öppna hämtningar - - - Stäng hämtningar - Ta bort alla @@ -1414,9 +1303,6 @@ Historik - - Hämtningar - Rensa @@ -1568,162 +1454,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> Vänta - - Popup-blockering är %1$s för den här webbplatsen. - - - - - - Av - - WebXR är %1$s för den här webbplatsen. <a href="%2$s">Läs mer</a> - - - + '%1$s' will be replaced at runtime with the app's name. --> + ‘%1$s’ vill komma åt WebXR API - - Av - - + Förbättrat spårningsskydd är %1$s för den här webbplatsen. (<a href="%2$s">Läs mer</a>) - - - - - - Av - - - En del ljud eller video på denna webbplats använder DRM-programvara, vilket kan begränsa vad %1$s kan låta dig göra med den. <a href="%2$s">Läs mer</a> - - - - - Av - - - Denna webbplats innehåller DRM-innehåll. - - - Genom att tillåta DRM tillåter denna webbplats att identifiera den här enheten varje gång du besöker. <a href="%1$s">Läs mer</a> - - - Tillåt - - - Tillåt inte + + Aktivera Inaktivera - - - Är du säker på att du vill avsluta %1$s? - - - Avbryt - - - Avsluta - - - Filtypen stöds inte - - - Filen kan inte öppnas. Vill du öppna den med en extern applikation? - - - Avbryt - - - Öppna - - - Fel - - - Ingen applikation hittades för att hantera den här filtypen. - - - Vill du hämta den här filen? - - - Avbryt - - - Hämta - - - Ta bort fil - - - Är du säker på att du vill ta bort den här filen? - - - Ta också bort filen från disken - - - Ta bort alla nedladdade filer - - - Är du säker på att du vill ta bort alla nedladdade filer? - - - Ta också bort filerna från disken - - - Avbryt - - - Ta bort - - - Det uppstod ett fel - - - Ett fel inträffade vid nedladdning av %1$s. Var god försök igen. - - - Ok - - - Misslyckades - - - Pausad - - - Väntande - - - Otillgänglig - - - Okänt fel - diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 5632891c4..74e901895 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -108,7 +108,7 @@ - 例外 - 弹出窗口 + 弹出窗口权限 @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> 用户代理模式 - - 下载默认存储位置 - 桌面 @@ -456,12 +452,6 @@ VR - - 内部(卸载时不保留数据) - - - 外部 - 标准 @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> 上次同步于 %1$d 分钟前 - - 自动允许网站识别您的设备,播放受 DRM 控制的内容。(<a href="%1$s">详细了解</a>) + 播放 DRM 控制内容(<a href="http://somesite.com/">详细了解</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> 虚拟现实设备(WebXR) - - 高级 - %1$s 数据收集与使用 @@ -878,10 +864,6 @@ bookmarks tray button then a new item is bookmarked. --> 已保存至书签! - - %1$s 下载完成 - @@ -933,50 +915,6 @@ clearing history is displayed. --> 清除历史记录 - - 下载项 - - - 您的下载列表为空 - - - 您可以在此处访问下载项 - - - 正在加载下载项 - - - 全部删除 - - - 排序依据 - - - 按名称(从 A 到 Z) - - - 按名称(从 Z 到 A) - - - 最早 - - - 最新 - - - 最小 - - - 最大 - 同步 @@ -1046,11 +984,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> 移除书签 - - 删除 - 重置显示设置 @@ -1064,7 +997,7 @@ 重置弹出窗口阻止设置 - 下列网站有权限打开弹出窗口: + 下列网站请求打开弹出窗口: @@ -1079,7 +1012,7 @@ - 高级 + 例外 重置控制器设置 @@ -1174,24 +1107,8 @@ 清除 - 不阻止弹出窗口 - - - 已阻止弹出窗口 - - - 允许 DRM - - - 不允许 DRM + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + 已阻止弹出窗口 @@ -1213,14 +1130,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> 已阻止 WebXR - - 退出\nWebXR - - - 按下任意键继续 - 已启用跟踪保护 @@ -1243,18 +1152,6 @@ 新建标签页打开 - - 下载链接 - - - 下载视频 - - - 下载音频 - - - 下载图像 - 复制链接 @@ -1313,14 +1210,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> 关闭历史记录 - - 打开下载项 - - - 关闭下载项 - 全部移除 @@ -1412,9 +1301,6 @@ 历史记录 - - 下载项 - 清除 @@ -1566,162 +1452,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> 等待 - - 已%1$s此网站弹出窗口。 - - - 允许 - - - 阻止 - - 此网站的 WebXR 功能已%1$s。<a href="%2$s">详细了解</a> - - - 开启 + '%1$s' will be replaced at runtime with the app's name. --> + “%1$s”想要访问 WebXR API - - 关闭 - - + 对此网站已%1$s增强型跟踪保护。(<a href="%2$s">详细了解</a>) - - - 开启 - - - 关闭 - - - 此网站的部分音视频内容需使用数字版权管理(DRM)软件,这可能会限制 %1$s 能让您使用的功能。<a href="%2$s">详细了解</a> - - - 开启 - - 关闭 - - - 此网站包含数字版权管理(DRM)内容。 - - - 允许 DRM 会让网站在您每次访问时识别该设备。<a href="%1$s">详细了解</a> - - - 允许 - - - 不允许 + + 启用 禁用 - - - 您确定要退出“%1$s”吗? - - - 取消 - - - 退出 - - - 不支持的文件类型 - - - 无法打开此文件,您要使用外部应用程序打开吗? - - - 取消 - - - 打开 - - - 错误 - - - 找不到处理此类型文件的应用程序 - - - 您确定要下载此文件吗? - - - 取消 - - - 下载 - - - 删除文件 - - - 您确定要删除这个文件吗? - - - 同时将文件从磁盘删除 - - - 删除所有已下载的文件 - - - 您确定要删除所有已下载的文件吗? - - - 同时将文件从磁盘删除 - - - 取消 - - - 删除 - - - 发生了一个错误 - - - 下载 %1$s 时出错,请重试。 - - - 确定 - - - 失败 - - - 已暂停 - - - 等待中 - - - 不可用 - - - 未知错误 - diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index a197ec869..2c7c31060 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -108,7 +108,7 @@ - 彈出型視窗的例外規則 + 彈出視窗權限 @@ -443,10 +443,6 @@ User-Agent (UA) string of the browser. --> 使用者代理模式 - - 預設下載項目儲存空間 - 桌面版 @@ -456,12 +452,6 @@ VR - - 內部 - - - 外部 - 標準 @@ -618,9 +608,9 @@ when that the content was just synced some time ago. --> 最近同步: %1$d 分鐘前 - - 自動允許網站偵測您的設備,播放 DRM 保護內容。(<a href="%1$s">了解更多</a>) + 播放 DRM 控制內容(<a href="http://somesite.com/">了解更多</a>) @@ -681,10 +671,6 @@ Devices access to websites (WebXR). --> 虛擬實境裝置(WebXR) - - 進階 - %1$s 資料收集與使用 @@ -878,10 +864,6 @@ bookmarks tray button then a new item is bookmarked. --> 已加入書籤! - - 已下載 %1$s - @@ -933,50 +915,6 @@ clearing history is displayed. --> 清除瀏覽記錄 - - 下載項目 - - - 您的下載項目清單是空白的 - - - 您可以在此處尋找下載過的項目 - - - 正在載入下載項目 - - - 全部刪除 - - - 排序方式 - - - 依照名稱(A-Z 排序) - - - 依照名稱(Z-A 排序) - - - 最舊 - - - 最新 - - - 最小 - - - 最大 - Sync @@ -1046,11 +984,6 @@ the more button is pressed in a history item. It removes the selected item from favorites. --> 移除書籤 - - 刪除 - 重設顯示選項 @@ -1064,7 +997,7 @@ 重設彈出視窗封鎖設定 - 允許下列網站開啟彈出型視窗: + 下列網站要求開啟彈出視窗: @@ -1079,7 +1012,7 @@ - 進階 + 例外網站 重設控制器設定 @@ -1174,24 +1107,8 @@ 清除 - 不封鎖彈出視窗 - - - 封鎖彈出視窗 - - - 允許 DRM 內容 - - - 不允許 DRM 內容 + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + 已封鎖彈出視窗 @@ -1213,14 +1130,6 @@ browser's navigation bar. The button it labels, when pressed, Shows the WebXR permission dialog. --> 封鎖 WebXR - - 結束\nWebXR - - - 按任何其他按鈕繼續 - 已開啟追蹤保護 @@ -1243,18 +1152,6 @@ 用新分頁開啟 - - 下載鏈結 - - - 下載影片 - - - 下載音訊 - - - 下載圖片 - 複製鏈結 @@ -1313,14 +1210,6 @@ tray and the History view is closed. The button it labels, when pressed, closes the History view. --> 關閉瀏覽紀錄 - - 開啟下載項目 - - - 關閉下載項目 - 移除全部 @@ -1413,9 +1302,6 @@ 瀏覽紀錄 - - 下載項目 - 清除 @@ -1567,162 +1453,16 @@ the Select` button. When clicked it closes all the previously selected tabs --> 稍候 - - 已%1$s此網站開啟彈出型視窗。 - - - 允許 - - - 封鎖 - - 此網站的 WebXR 功能已%1$s。<a href="%2$s">了解更多</a> - - - 開啟 + '%1$s' will be replaced at runtime with the app's name. --> + 「%1$s」想要存取 WebXR API - - 關閉 - - + 已%1$s此網站的加強型追蹤保護。(<a href="%2$s">了解更多</a>) - - 開啟 - - - 關閉 - - - 此網站的某些影音內容需要使用 DRM 軟體,可能會影響 %1$s 能讓您使用的功能。<a href="%2$s">了解更多</a> - - - 開啟 - - - 關閉 - - - 此網站包含 DRM 保護內容。 - - - 允許 DRM 會讓網站在您每次造訪時偵測此裝置。<a href="%1$s">了解更多</a> - - - 允許 - - - 不允許 + + 開啟 關閉 - - - 您確定要結束 %1$s 嗎? - - - 取消 - - - 離開 - - - 檔案類型不支援 - - - 無法開啟此檔案,您要使用外部應用程式開啟嗎? - - - 取消 - - - 開啟 - - - 錯誤 - - - 找不到與此檔案類型相關聯的應用程式。 - - - 您確定要下載此檔案嗎? - - - 取消 - - - 下載 - - - 刪除檔案 - - - 您確定要刪除此檔案嗎? - - - 也將檔案從磁碟刪除 - - - 刪除所有已下載的檔案 - - - 您確定要刪除所有已下載的檔案嗎? - - - 也將檔案從磁碟刪除 - - - 取消 - - - 刪除 - - - 發生錯誤 - - - 下載 %1$s 時發生錯誤,請再試一次。 - - - 確定 - - - 失敗 - - - 已暫停 - - - 等待中 - - - 無法使用 - - - 未知錯誤 - diff --git a/app/src/main/res/values/non_L10n.xml b/app/src/main/res/values/non_L10n.xml index 909f5b459..1a4165afa 100644 --- a/app/src/main/res/values/non_L10n.xml +++ b/app/src/main/res/values/non_L10n.xml @@ -24,7 +24,7 @@ settings_env settings_pointer_color settings_scroll_direction - settings_gfx_msaa_v2 + settings_gfx_msaa settings_audio settings_voice_search_language settings_display_language @@ -81,7 +81,6 @@ fxr ABC %&= - 选定 空格 @@ -189,6 +188,22 @@ uúüûùūůų ìíiïîįī + + + q=%1$s&client=firefox-b-o + q=%1$s&client=firefox-b-1-o + https://www.google.com/search + https://www.google.com/search + + wd=%1$s&tn=monline_dg&ie=utf-8 + https://www.baidu.com/baidu + + searchbar=2186618&keyword=2186621&contextmenu=2186623&homepage=2186617&newtab=2186620&text=%1$s + https://yandex.ru/search + https://yandex.by/search + https://yandex.com.tr/search + https://yandex.kz/search + https://qsurvey.mozilla.com/s3/FxR diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c22ba2994..229d05fd4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1172,14 +1172,8 @@ Clear - Pop-Ups Not Blocked - - - Pop-Ups Blocked + browser's navigation bar. The button it labels, when pressed, Shows the pop-up blocked dialog. --> + Pop-Up Blocked - Exit\nWebXR + has to be used to exit from WebXR. It's preferred to separate it in two lines if possible. --> + Exit\nWebXR" - Press any other button to continue + Press any button to continue @@ -1614,7 +1607,7 @@ the Select` button. When clicked it closes all the previously selected tabs --> - Allowing DRM permits sites to identify this device every time you visit. <a href="%1$s">Learn More</a> + Allowing DRM permits this site to identify this device every time you visit. <a href="%1$s">Learn More</a> diff --git a/app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp b/app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp index 9657fff58..46dd0f151 100644 --- a/app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp +++ b/app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp @@ -148,11 +148,6 @@ struct DeviceDelegateOculusVR::State { } initialized = true; - std::string version = vrapi_GetVersionString(); - std::string notes = "Oculus Driver Version: "; - notes += version; - VRBrowser::AppendAppNotesToCrashLog(notes); - layersEnabled = VRBrowser::AreLayersEnabled(); SetRenderSize(device::RenderMode::StandAlone); @@ -371,10 +366,10 @@ struct DeviceDelegateOculusVR::State { controllerState.enabled = true; if (!controllerState.created) { - vrb::Matrix beamTransform(vrb::Matrix::Identity()); if (controllerState.capabilities.ControllerCapabilities & ovrControllerCaps_ModelOculusTouch) { std::string controllerName; + vrb::Matrix beamTransform(vrb::Matrix::Identity()); if (controllerState.hand == ElbowModel::HandEnum::Left) { beamTransform.TranslateInPlace(vrb::Vector(-0.011f, -0.007f, 0.0f)); controllerName = "Oculus Touch (Left)"; @@ -384,30 +379,15 @@ struct DeviceDelegateOculusVR::State { } controller->CreateController(controllerState.index, int32_t(controllerState.hand), controllerName, beamTransform); - controller->SetButtonCount(controllerState.index, 7); + controller->SetButtonCount(controllerState.index, 6); controller->SetHapticCount(controllerState.index, 1); - controller->SetControllerType(controllerState.index, device::OculusQuest); - - const vrb::Matrix trans = vrb::Matrix::Position(vrb::Vector(0.0f, 0.02f, -0.03f)); - vrb::Matrix transform = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), -0.77f); - transform = transform.PostMultiply(trans); - controller->SetImmersiveBeamTransform(controllerState.index, beamTransform.PostMultiply(transform)); } else { // Oculus Go only has one kind of controller model. controller->CreateController(controllerState.index, 0, "Oculus Go Controller"); - // Although Go only has two buttons, in order to match WebXR input profile (squeeze placeholder), - // we make Go has three buttons. - controller->SetButtonCount(controllerState.index, 3); + controller->SetButtonCount(controllerState.index, 2); // Oculus Go has no haptic feedback. controller->SetHapticCount(controllerState.index, 0); - controller->SetControllerType(controllerState.index, device::OculusGo); - - const vrb::Matrix trans = vrb::Matrix::Position(vrb::Vector(0.0f, 0.028f, -0.072f)); - vrb::Matrix transform = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), -0.55f); - transform = transform.PostMultiply(trans); - controller->SetImmersiveBeamTransform(controllerState.index, beamTransform.PostMultiply(transform)); } - controller->SetTargetRayMode(controllerState.index, device::TargetRayMode::TrackedPointer); controllerState.created = true; } } @@ -457,32 +437,19 @@ struct DeviceDelegateOculusVR::State { flags |= device::Position; } else { controllerState.transform = elbow->GetTransform(controllerState.hand, head, controllerState.transform); - flags |= device::PositionEmulated; } - flags |= device::GripSpacePosition; controller->SetCapabilityFlags(controllerState.index, flags); - if (renderMode == device::RenderMode::Immersive) { - static vrb::Matrix transform(vrb::Matrix::Identity()); - if (transform.IsIdentity()) { - if (controllerState.Is6DOF()) { - transform = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), 0.77f); - const vrb::Matrix trans = vrb::Matrix::Position(vrb::Vector(0.0f, 0.0f, 0.025f)); - transform = transform.PostMultiply(trans); - } else { - transform = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), 0.60f); - } - } - controllerState.transform = controllerState.transform.PostMultiply(transform); - } controller->SetTransform(controllerState.index, controllerState.transform); controllerState.inputState.Header.ControllerType = ovrControllerType_TrackedRemote; vrapi_GetCurrentInputState(ovr, controllerState.deviceId, &controllerState.inputState.Header); reorientCount = controllerState.inputState.RecenterCount; + const int32_t kNumAxes = 2; bool triggerPressed = false, triggerTouched = false; bool trackpadPressed = false, trackpadTouched = false; + float axes[kNumAxes]; float trackpadX = 0.0f, trackpadY = 0.0f; if (controllerState.Is6DOF()) { triggerPressed = (controllerState.inputState.Buttons & ovrButton_Trigger) != 0; @@ -491,16 +458,13 @@ struct DeviceDelegateOculusVR::State { trackpadTouched = (controllerState.inputState.Touches & ovrTouch_Joystick) != 0; trackpadX = controllerState.inputState.Joystick.x; trackpadY = controllerState.inputState.Joystick.y; - const int32_t kNumAxes = 4; - float axes[kNumAxes]; - axes[device::kImmersiveAxisTouchpadX] = axes[device::kImmersiveAxisTouchpadY] = 0.0f; - axes[device::kImmersiveAxisThumbstickX] = trackpadX; - axes[device::kImmersiveAxisThumbstickY] = -trackpadY; // We did y axis intentionally inverted in FF desktop as well. + axes[0] = trackpadX; + axes[1] = -trackpadY; // We did y axis intentionally inverted in FF desktop as well. controller->SetScrolledDelta(controllerState.index, -trackpadX, trackpadY); const bool gripPressed = (controllerState.inputState.Buttons & ovrButton_GripTrigger) != 0; - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_SQUEEZE, device::kImmersiveButtonSqueeze, - gripPressed, gripPressed, controllerState.inputState.GripTrigger); + controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_OTHERS, 2, gripPressed, gripPressed, + controllerState.inputState.GripTrigger); if (controllerState.hand == ElbowModel::HandEnum::Left) { const bool xPressed = (controllerState.inputState.Buttons & ovrButton_X) != 0; const bool xTouched = (controllerState.inputState.Touches & ovrTouch_X) != 0; @@ -508,8 +472,8 @@ struct DeviceDelegateOculusVR::State { const bool yTouched = (controllerState.inputState.Touches & ovrTouch_Y) != 0; const bool menuPressed = (controllerState.inputState.Buttons & ovrButton_Enter) != 0; - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_X, device::kImmersiveButtonA, xPressed, xTouched); - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_Y, device::kImmersiveButtonB, yPressed, yTouched); + controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_X, 3, xPressed, xTouched); + controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_Y, 4, yPressed, yTouched); if (renderMode != device::RenderMode::Immersive) { controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_APP, -1, yPressed, yTouched); @@ -522,8 +486,8 @@ struct DeviceDelegateOculusVR::State { const bool bPressed = (controllerState.inputState.Buttons & ovrButton_B) != 0; const bool bTouched = (controllerState.inputState.Touches & ovrTouch_B) != 0; - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_A, device::kImmersiveButtonA, aPressed, aTouched); - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_B, device::kImmersiveButtonB, bPressed, bTouched); + controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_A, 3, aPressed, aTouched); + controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_B, 4, bPressed, bTouched); if (renderMode != device::RenderMode::Immersive) { controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_APP, -1, bPressed, bTouched); @@ -531,18 +495,6 @@ struct DeviceDelegateOculusVR::State { } else { VRB_WARN("Undefined hand type in DeviceDelegateOculusVR."); } - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_TOUCHPAD, - device::kImmersiveButtonThumbstick, trackpadPressed, trackpadTouched); - // This is always false in Oculus Browser. - const bool thumbRest = false; - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_OTHERS, device::kImmersiveButtonThumbrest, thumbRest, thumbRest); - - if (gripPressed && renderMode == device::RenderMode::Immersive) { - controller->SetSqueezeActionStart(controllerState.index); - } else { - controller->SetSqueezeActionStop(controllerState.index); - } - controller->SetAxes(controllerState.index, axes, kNumAxes); } else { triggerPressed = (controllerState.inputState.Buttons & ovrButton_A) != 0; triggerTouched = triggerPressed; @@ -558,29 +510,20 @@ struct DeviceDelegateOculusVR::State { trackpadX = controllerState.inputState.TrackpadPosition.x / (float)controllerState.capabilities.TrackpadMaxX; trackpadY = controllerState.inputState.TrackpadPosition.y / (float)controllerState.capabilities.TrackpadMaxY; - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_TOUCHPAD, - device::kImmersiveButtonTouchpad, trackpadPressed, trackpadTouched); if (trackpadTouched && !trackpadPressed) { controller->SetTouchPosition(controllerState.index, trackpadX, trackpadY); } else { controller->SetTouchPosition(controllerState.index, trackpadX, trackpadY); controller->EndTouch(controllerState.index); } - const int32_t kNumAxes = 2; - float axes[kNumAxes]; - axes[device::kImmersiveAxisTouchpadX] = trackpadTouched ? trackpadX * 2.0f - 1.0f : 0.0f; - axes[device::kImmersiveAxisTouchpadY] = trackpadTouched ? trackpadY * 2.0f - 1.0f : 0.0f; - controller->SetAxes(controllerState.index, axes, kNumAxes); + axes[0] = trackpadTouched ? trackpadX * 2.0f - 1.0f : 0.0f; + axes[1] = trackpadTouched ? trackpadY * 2.0f - 1.0f : 0.0f; } - controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_TRIGGER, - device::kImmersiveButtonTrigger, triggerPressed, triggerTouched, + controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_TRIGGER, 1, triggerPressed, triggerTouched, controllerState.inputState.IndexTrigger); + controller->SetButtonState(controllerState.index, ControllerDelegate::BUTTON_TOUCHPAD, 0, trackpadPressed, trackpadTouched); - if (triggerPressed && renderMode == device::RenderMode::Immersive) { - controller->SetSelectActionStart(controllerState.index); - } else { - controller->SetSelectActionStop(controllerState.index); - } + controller->SetAxes(controllerState.index, axes, kNumAxes); if (controller->GetHapticCount(controllerState.index)) { UpdateHaptics(controllerState); } @@ -978,10 +921,10 @@ DeviceDelegateOculusVR::StartFrame(const FramePrediction aPrediction) { if (m.immersiveDisplay) { m.immersiveDisplay->SetEyeOffset(device::Eye::Left, -ipd * 0.5f, 0.f, 0.f); m.immersiveDisplay->SetEyeOffset(device::Eye::Right, ipd * 0.5f, 0.f, 0.f); - device::CapabilityFlags caps = device::Orientation | device::Present | + device::CapabilityFlags caps = device::Orientation | device::Present | device::StageParameters | device::InlineSession | device::ImmersiveVRSession; if (m.predictedTracking.Status & VRAPI_TRACKING_STATUS_POSITION_TRACKED) { - caps |= device::Position | device::StageParameters; + caps |= device::Position; auto standing = vrapi_LocateTrackingSpace(m.ovr, VRAPI_TRACKING_SPACE_LOCAL_FLOOR); vrb::Vector translation(-standing.Position.x, -standing.Position.y, -standing.Position.z); m.immersiveDisplay->SetSittingToStandingTransform(vrb::Matrix::Translation(translation)); diff --git a/app/src/oculusvr/cpp/OculusVRLayers.h b/app/src/oculusvr/cpp/OculusVRLayers.h index 33b5496fb..109cad001 100644 --- a/app/src/oculusvr/cpp/OculusVRLayers.h +++ b/app/src/oculusvr/cpp/OculusVRLayers.h @@ -77,11 +77,9 @@ class OculusLayerBase : public OculusLayer { virtual void Update(const ovrTracking2 &aTracking, ovrTextureSwapChain *aClearSwapChain) override { vrb::Color tintColor = layer->GetTintColor(); - if (!IsComposited() && (layer->GetClearColor().Alpha() > 0.0f)) { + if (!IsComposited() && layer->GetClearColor().Alpha()) { tintColor = layer->GetClearColor(); - tintColor.SetRGBA(convertColor(tintColor.Red()), convertColor(tintColor.Green()), convertColor(tintColor.Blue()), tintColor.Alpha()); } - ovrLayer.Header.ColorScale.x = tintColor.Red(); ovrLayer.Header.ColorScale.y = tintColor.Green(); ovrLayer.Header.ColorScale.z = tintColor.Blue(); @@ -160,17 +158,7 @@ class OculusLayerBase : public OculusLayer { return (IsComposited() || layer->GetClearColor().Alpha() == 0) ? swapChain : aClearSwapChain; } -protected: virtual ~OculusLayerBase() {} - - // Convert sRGB to linear RGB. Used to work around bug in Oculus compositor. - float convertColor(const float color) { - if (color > 0.04045f) { - return powf(color + 0.055f, 2.4f) / 1.055f; - } else { - return color / 12.92f; - } - } }; diff --git a/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp b/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp index 54c946ac9..dc8db40b6 100644 --- a/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp +++ b/app/src/picovr/cpp/DeviceDelegatePicoVR.cpp @@ -32,9 +32,10 @@ static const vrb::Vector kAverageHeight(0.0f, 1.7f, 0.0f); static const vrb::Vector kAverageSittingToStanding(0.0f, 1.2f, 0.0f); // TODO: support different controllers & buttons static const int32_t kMaxControllerCount = 3; -static const int32_t kNumButtons = 7; -static const int32_t kNumG2Buttons = 3; -static const int32_t kNumGazeButtons = 1; +static const int32_t kNumButtons = 6; +static const int32_t kNumG2Buttons = 2; +static const int32_t kNumGazeButtons = 2; +static const int32_t kNumAxes = 2; static const int32_t k6DofHeadSet = 1; static const int32_t kButtonApp = 1; static const int32_t kButtonTrigger = 1 << 1; @@ -170,10 +171,7 @@ struct DeviceDelegatePicoVR::State { device::CapabilityFlags flags = device::Orientation; if (controller.is6DoF) { flags |= device::Position; - } else { - flags |= device::PositionEmulated; } - flags |= device::GripSpacePosition; controllerDelegate->SetCapabilityFlags(i, flags); const bool appPressed = (controller.buttonsState & kButtonApp) > 0; const bool triggerPressed = (controller.buttonsState & kButtonTrigger) > 0; @@ -184,48 +182,33 @@ struct DeviceDelegatePicoVR::State { controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_APP, -1, appPressed, appPressed); - controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_TOUCHPAD, type == k6DofHeadSet ? - device::kImmersiveButtonThumbstick : device::kImmersiveButtonTouchpad, touchPadPressed, touchPadPressed); - controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_TRIGGER, device::kImmersiveButtonTrigger, triggerPressed, + controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_TOUCHPAD, 0, touchPadPressed, + touchPadPressed); + controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_TRIGGER, 1, triggerPressed, triggerPressed); - if (triggerPressed && renderMode == device::RenderMode::Immersive) { - controllerDelegate->SetSelectActionStart(i); - } else { - controllerDelegate->SetSelectActionStop(i); - } if (type == k6DofHeadSet) { - controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_SQUEEZE, device::kImmersiveButtonSqueeze, gripPressed, + controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_OTHERS, 2, gripPressed, gripPressed, gripPressed ? 20.0f : 0.0f); - if (gripPressed && renderMode == device::RenderMode::Immersive) { - controllerDelegate->SetSqueezeActionStart(i); - } else { - controllerDelegate->SetSqueezeActionStop(i); - } controllerDelegate->SetButtonState(i, (controller.IsRightHand() ? ControllerDelegate::BUTTON_A : ControllerDelegate::BUTTON_X), - device::kImmersiveButtonA, axPressed, axPressed); + 3, axPressed, axPressed); controllerDelegate->SetButtonState(i, (controller.IsRightHand() ? ControllerDelegate::BUTTON_B : ControllerDelegate::BUTTON_Y), - device::kImmersiveButtonB, byPressed, byPressed); - controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_OTHERS, device::kImmersiveButtonThumbrest, false, false); + 4, byPressed, byPressed); + controllerDelegate->SetButtonState(i, ControllerDelegate::BUTTON_OTHERS, 5, false, false); + } + + float axes[kNumAxes] = { controller.axisX , -controller.axisY }; + controllerDelegate->SetAxes(i, axes, kNumAxes); - const int32_t kNumAxes = 4; - float axes[kNumAxes]; - axes[device::kImmersiveAxisTouchpadX] = axes[device::kImmersiveAxisTouchpadY] = 0.0f; - axes[device::kImmersiveAxisThumbstickX] = controller.axisX; - axes[device::kImmersiveAxisThumbstickY] = -controller.axisY; - controllerDelegate->SetAxes(i, axes, controller.index != GazeModeIndex() ? kNumAxes : 0); + if (type == k6DofHeadSet) { if (!triggerPressed) { controllerDelegate->SetScrolledDelta(i, -controller.axisX, controller.axisY); } } else { - const int32_t kNumAxes = 2; - float axes[kNumAxes] = { controller.axisX , -controller.axisY }; - controllerDelegate->SetAxes(i, axes, controller.index != GazeModeIndex() ? kNumAxes : 0); - if (controller.touched) { controllerDelegate->SetTouchPosition(i, controller.axisX, controller.axisY); } else { @@ -234,20 +217,14 @@ struct DeviceDelegatePicoVR::State { } vrb::Matrix transform = controller.transform; - if (i != gazeIndex) { - if (renderMode == device::RenderMode::StandAlone) { - if (type == k6DofHeadSet) { - transform.TranslateInPlace(headOffset); - } else { - vrb::Matrix head = vrb::Matrix::Rotation(orientation); - head.PreMultiplyInPlace(vrb::Matrix::Position(headOffset)); - transform = elbow->GetTransform(controller.hand, head, transform); - } - } - else if (type != k6DofHeadSet) { - vrb::Matrix head = vrb::Matrix::Rotation(orientation); - transform = elbow->GetTransform(controller.hand, head, transform); - } + if ((renderMode == device::RenderMode::StandAlone) && (i != gazeIndex)) { + if (type == k6DofHeadSet) { + transform.TranslateInPlace(headOffset); + } else { + vrb::Matrix head = vrb::Matrix::Rotation(orientation); + head.PreMultiplyInPlace(vrb::Matrix::Position(headOffset)); + transform = elbow->GetTransform(controller.hand, head, transform); + } } controllerDelegate->SetTransform(i, transform); @@ -302,14 +279,10 @@ DeviceDelegatePicoVR::RegisterImmersiveDisplay(ImmersiveDisplayPtr aDisplay) { device::ImmersiveVRSession | device::InlineSession; if (m.type == k6DofHeadSet) { flags |= device::Position | device::StageParameters; - m.immersiveDisplay->SetSittingToStandingTransform(vrb::Matrix::Translation(kAverageSittingToStanding)); - } else { - flags |= device::PositionEmulated; - m.immersiveDisplay->SetSittingToStandingTransform(vrb::Matrix::Translation(kAverageHeight)); } + m.immersiveDisplay->SetSittingToStandingTransform(vrb::Matrix::Translation(kAverageSittingToStanding)); m.immersiveDisplay->SetCapabilityFlags(flags); - const float scale = 1.0f; - m.immersiveDisplay->SetEyeResolution(int(m.renderWidth * scale), int(m.renderHeight * scale)); + m.immersiveDisplay->SetEyeResolution(m.renderWidth / 2, m.renderHeight / 2); m.immersiveDisplay->CompleteEnumeration(); } @@ -358,8 +331,7 @@ DeviceDelegatePicoVR::SetControllerDelegate(ControllerDelegatePtr& aController) m.controllerDelegate->CreateController(index, 0, "Pico Gaze Controller", beam); m.controllerDelegate->SetButtonCount(index, kNumGazeButtons); m.controllerDelegate->SetHapticCount(index, 0); - m.controllerDelegate->SetControllerType(index, device::PicoGaze); - m.controllerDelegate->SetTargetRayMode(index, device::TargetRayMode::Gaze); + } else { if (m.type == k6DofHeadSet) { vrb::Matrix beam = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), -vrb::PI_FLOAT / 11.5f); @@ -367,15 +339,11 @@ DeviceDelegatePicoVR::SetControllerDelegate(ControllerDelegatePtr& aController) m.controllerDelegate->CreateController(index, int32_t(controller.hand), controller.IsRightHand() ? "Pico Neo 2 (Right)" : "Pico Neo 2 (LEFT)", beam); m.controllerDelegate->SetButtonCount(index, kNumButtons); m.controllerDelegate->SetHapticCount(index, 1); - m.controllerDelegate->SetControllerType(index, device::PicoNeo2); - m.controllerDelegate->SetTargetRayMode(index, device::TargetRayMode::TrackedPointer); } else { vrb::Matrix beam = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), -vrb::PI_FLOAT / 11.5f); m.controllerDelegate->CreateController(index, 0, "Pico G2 Controller", beam); m.controllerDelegate->SetButtonCount(index, kNumG2Buttons); m.controllerDelegate->SetHapticCount(index, 0); - m.controllerDelegate->SetControllerType(index, device::PicoG2); - m.controllerDelegate->SetTargetRayMode(index, device::TargetRayMode::TrackedPointer); } } controller.created = true; diff --git a/app/src/picovr/cpp/VRBrowserPico.cpp b/app/src/picovr/cpp/VRBrowserPico.cpp index f9bade028..47db149a9 100644 --- a/app/src/picovr/cpp/VRBrowserPico.cpp +++ b/app/src/picovr/cpp/VRBrowserPico.cpp @@ -10,19 +10,16 @@ namespace { -const char* const sUpdateHapticsName = "updateHaptics"; -const char* const sUpdateHapticsSignature = "(IFF)V"; -const char* const sCancelAllHapticsName = "cancelAllHaptics"; -const char* const sCancelAllHapticsSignature = "()V"; -const char* const kGetGazeIndex = "getGazeIndex"; -const char* const kGetGazeIndexSignature = "()I"; +const char* sUpdateHapticsName = "updateHaptics"; +const char* sUpdateHapticsSignature = "(IFF)V"; +const char* sCancelAllHapticsName = "cancelAllHaptics"; +const char* sCancelAllHapticsSignature = "()V"; JNIEnv* sEnv = nullptr; jclass sBrowserClass = nullptr; jobject sActivity = nullptr; jmethodID sUpdateHaptics = nullptr; jmethodID sCancelAllHaptics = nullptr; -jmethodID sGetGazeIndex = nullptr; } namespace crow { diff --git a/app/src/picovr/cpp/VRBrowserPico.h b/app/src/picovr/cpp/VRBrowserPico.h index 8c556d840..b24b82bf2 100644 --- a/app/src/picovr/cpp/VRBrowserPico.h +++ b/app/src/picovr/cpp/VRBrowserPico.h @@ -3,21 +3,29 @@ * 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/. */ -#ifndef VRBROWSER_PICO_H -#define VRBROWSER_PICO_H +#pragma once +#include "vrb/MacroUtils.h" +#include +#include #include +#include + +namespace { +const char *kGetGazeIndex = "getGazeIndex"; +const char *kGetGazeIndexSignature = "()I"; + +jmethodID sGetGazeIndex = nullptr; +} namespace crow { -namespace VRBrowserPico { -void InitializeJava(JNIEnv* aEnv, jobject aActivity); -void ShutdownJava(); -void UpdateHaptics(jint aControllerIndex, jfloat aIntensity, jfloat aDuration); -void CancelAllHaptics(); -int32_t GetGazeIndex(); -} // namespace VRBrowser; + namespace VRBrowserPico { + void InitializeJava(JNIEnv* aEnv, jobject aActivity); + void ShutdownJava(); + void UpdateHaptics(jint aControllerIndex, jfloat aIntensity, jfloat aDuration); + void CancelAllHaptics(); + int32_t GetGazeIndex(); + } // namespace VRBrowser; } // namespace crow - -#endif // VRBROWSER_PICO_H diff --git a/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp b/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp index 2351b98aa..3c54b11f4 100644 --- a/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp +++ b/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp @@ -90,7 +90,6 @@ struct DeviceDelegateWaveVR::State { GestureDelegatePtr gestures; std::array controllers; ImmersiveDisplayPtr immersiveDisplay; - device::DeviceType deviceType; bool lastSubmitDiscarded; bool recentered; vrb::Matrix reorientMatrix; @@ -111,7 +110,6 @@ struct DeviceDelegateWaveVR::State { , renderHeight(0) , devicePairs {} , controllers {} - , deviceType(device::UnknownType) , lastSubmitDiscarded(false) , recentered(false) , ignoreNextRecenter(false) @@ -134,11 +132,6 @@ struct DeviceDelegateWaveVR::State { sixDoFControllerCount++; } } - if (sixDoFControllerCount) { - deviceType = device::ViveFocusPlus; - } else { - deviceType = device::ViveFocus; - } reorientMatrix = vrb::Matrix::Identity(); } @@ -252,26 +245,13 @@ struct DeviceDelegateWaveVR::State { VRB_ERROR("Failed to create controller. No ControllerDelegate has been set."); return; } - vrb::Matrix beamTransform(vrb::Matrix::Identity()); + vrb::Matrix transform(vrb::Matrix::Identity()); if (aController.is6DoF) { - beamTransform.TranslateInPlace(vrb::Vector(0.0f, 0.01f, -0.05f)); + transform.TranslateInPlace(vrb::Vector(0.0f, 0.01f, -0.05f)); } - delegate->CreateController(aController.index, aController.is6DoF ? 1 : 0, - aController.is6DoF ? "HTC Vive Focus Plus Controller" : "HTC Vive Focus Controller", - beamTransform); + delegate->CreateController(aController.index, aController.is6DoF ? 1 : 0, aController.is6DoF ? "HTC Vive Focus Plus Controller" : "HTC Vive Focus Controller", transform); delegate->SetLeftHanded(aController.index, aController.hand == ElbowModel::HandEnum::Left); delegate->SetHapticCount(aController.index, 1); - delegate->SetControllerType(aController.index, aController.is6DoF ? device::ViveFocusPlus : - device::ViveFocus); - delegate->SetTargetRayMode(aController.index, device::TargetRayMode::TrackedPointer); - - if (aController.is6DoF) { - const vrb::Matrix trans = vrb::Matrix::Position(vrb::Vector(0.0f, -0.021f, -0.03f)); - vrb::Matrix transform = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), -0.70f); - transform = transform.PostMultiply(trans); - - delegate->SetImmersiveBeamTransform(aController.index, beamTransform.PostMultiply(transform)); - } aController.created = true; aController.enabled = false; } @@ -304,11 +284,9 @@ struct DeviceDelegateWaveVR::State { } continue; } else if (!controller.enabled) { - device::CapabilityFlags flags = device::Orientation | device::GripSpacePosition; + device::CapabilityFlags flags = device::Orientation; if (controller.is6DoF) { flags |= device::Position; - } else { - flags |= device::PositionEmulated; } controller.enabled = true; delegate->SetEnabled(controller.index, true); @@ -318,17 +296,15 @@ struct DeviceDelegateWaveVR::State { delegate->SetVisible(controller.index, !WVR_IsInputFocusCapturedBySystem()); - const bool bumperPressed = (controller.is6DoF) ? WVR_GetInputButtonState(controller.type, WVR_InputId_Alias1_Trigger) + const bool bumperPressed = (controller.is6DoF) ? WVR_GetInputButtonState(controller.type, WVR_InputId_Alias1_Trigger) : WVR_GetInputButtonState(controller.type, WVR_InputId_Alias1_Digital_Trigger); const bool touchpadPressed = WVR_GetInputButtonState(controller.type, WVR_InputId_Alias1_Touchpad); const bool touchpadTouched = WVR_GetInputTouchState(controller.type, WVR_InputId_Alias1_Touchpad); const bool menuPressed = WVR_GetInputButtonState(controller.type, WVR_InputId_Alias1_Menu); - // Although Focus only has two buttons, in order to match WebXR input profile (squeeze placeholder), - // we make Focus has three buttons. - delegate->SetButtonCount(controller.index, 3); - delegate->SetButtonState(controller.index, ControllerDelegate::BUTTON_TOUCHPAD, device::kImmersiveButtonTouchpad, touchpadPressed, touchpadTouched); - delegate->SetButtonState(controller.index, ControllerDelegate::BUTTON_TRIGGER, device::kImmersiveButtonTrigger, bumperPressed, bumperPressed); + delegate->SetButtonCount(controller.index, controller.is6DoF ? 3 : 2); // For immersive mode + delegate->SetButtonState(controller.index, ControllerDelegate::BUTTON_TOUCHPAD, 0, touchpadPressed, touchpadTouched); + delegate->SetButtonState(controller.index, ControllerDelegate::BUTTON_TRIGGER, 1, bumperPressed, bumperPressed); if (controller.is6DoF) { const bool gripPressed = WVR_GetInputButtonState(controller.type, WVR_InputId_Alias1_Grip); if (renderMode == device::RenderMode::StandAlone) { @@ -344,22 +320,12 @@ struct DeviceDelegateWaveVR::State { controller.gripPressedCount = -1; } } else { - delegate->SetButtonState(controller.index, ControllerDelegate::BUTTON_SQUEEZE, device::kImmersiveButtonSqueeze, - gripPressed, gripPressed); + delegate->SetButtonState(controller.index, ControllerDelegate::BUTTON_OTHERS, 2, gripPressed, + gripPressed); controller.gripPressedCount = 0; } - if (gripPressed && renderMode == device::RenderMode::Immersive) { - delegate->SetSqueezeActionStart(controller.index); - } else { - delegate->SetSqueezeActionStop(controller.index); - } } - if (bumperPressed && renderMode == device::RenderMode::Immersive) { - delegate->SetSelectActionStart(controller.index); - } else { - delegate->SetSelectActionStop(controller.index); - } delegate->SetButtonState(controller.index, ControllerDelegate::BUTTON_APP, -1, menuPressed, menuPressed); const int32_t kNumAxes = 2; @@ -369,8 +335,8 @@ struct DeviceDelegateWaveVR::State { WVR_Axis_t axis = WVR_GetInputAnalogAxis(controller.type, WVR_InputId_Alias1_Touchpad); // We are matching touch pad range from {-1, 1} to the Oculus {0, 1}. delegate->SetTouchPosition(controller.index, (axis.x + 1) * 0.5, (-axis.y + 1) * 0.5); - immersiveAxes[device::kImmersiveAxisTouchpadX] = axis.x; - immersiveAxes[device::kImmersiveAxisTouchpadY] = -axis.y; + immersiveAxes[0] = axis.x; + immersiveAxes[1] = -axis.y; controller.touched = true; } else if (controller.touched) { controller.touched = false; @@ -461,11 +427,6 @@ DeviceDelegateWaveVR::Create(vrb::RenderContextPtr& aContext) { return result; } -device::DeviceType -DeviceDelegateWaveVR::GetDeviceType() { - return m.deviceType; -} - void DeviceDelegateWaveVR::SetRenderMode(const device::RenderMode aMode) { if (aMode == m.renderMode) { @@ -502,11 +463,11 @@ DeviceDelegateWaveVR::RegisterImmersiveDisplay(ImmersiveDisplayPtr aDisplay) { } m.immersiveDisplay->SetDeviceName("Wave"); - device::CapabilityFlags flags = device::Orientation | device::Present | + device::CapabilityFlags flags = device::Orientation | device::Present | device::StageParameters | device::InlineSession | device::ImmersiveVRSession; if (WVR_GetDegreeOfFreedom(WVR_DeviceType_HMD) == WVR_NumDoF_6DoF) { - flags |= device::Position | device::StageParameters; + flags |= device::Position; } else { flags |= device::PositionEmulated; } @@ -817,15 +778,6 @@ DeviceDelegateWaveVR::StartFrame(const FramePrediction aPrediction) { } else if (m.renderMode == device::RenderMode::StandAlone) { controller.transform.TranslateInPlace(kAverageHeight); } - if (m.renderMode == device::RenderMode::Immersive && pose.is6DoFPose) { - static vrb::Matrix transform(vrb::Matrix::Identity()); - if (transform.IsIdentity()) { - transform = vrb::Matrix::Rotation(vrb::Vector(1.0f, 0.0f, 0.0f), 0.70f); - const vrb::Matrix trans = vrb::Matrix::Position(vrb::Vector(0.0f, 0.0f, -0.01f)); - transform = transform.PostMultiply(trans); - } - controller.transform = controller.transform.PostMultiply(transform); - } m.delegate->SetTransform(controller.index, controller.transform); } diff --git a/app/src/wavevr/cpp/DeviceDelegateWaveVR.h b/app/src/wavevr/cpp/DeviceDelegateWaveVR.h index f4e32e93b..9fd86bff1 100644 --- a/app/src/wavevr/cpp/DeviceDelegateWaveVR.h +++ b/app/src/wavevr/cpp/DeviceDelegateWaveVR.h @@ -15,7 +15,6 @@ class DeviceDelegateWaveVR : public DeviceDelegate { public: static DeviceDelegateWaveVRPtr Create(vrb::RenderContextPtr& aContext); // DeviceDelegate interface - device::DeviceType GetDeviceType() override; void SetRenderMode(const device::RenderMode aMode) override; device::RenderMode GetRenderMode() override; void RegisterImmersiveDisplay(ImmersiveDisplayPtr aDisplay) override; diff --git a/app/src/wavevr/java/org/mozilla/vrbrowser/PlatformActivity.java b/app/src/wavevr/java/org/mozilla/vrbrowser/PlatformActivity.java index 6f27e0033..ea353f3f4 100644 --- a/app/src/wavevr/java/org/mozilla/vrbrowser/PlatformActivity.java +++ b/app/src/wavevr/java/org/mozilla/vrbrowser/PlatformActivity.java @@ -36,6 +36,7 @@ public PlatformActivity() { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + DeviceType.setType(DeviceType.ViveFocusPlus); queueRunnable(new Runnable() { @Override diff --git a/app/src/wavevr/res/drawable/controller_focus.png b/app/src/wavevr/res/drawable/controller_focus.png deleted file mode 100644 index 2f005a538c8a48afe180195be70fbfbd9475696d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24642 zcmd?R1yEc|_b)oQ1}C^{@WGwn5Hx6T28ZD8?!f{f!Ciur;O_1Y!6CT2!zVn?^ z|9fw}y7j6ayY@^^_xi21dUdbWvU?MzC@=X85g!o%06deH5>o#gVF3ULskG8b z@DFHHVL4#{;7c^pJqQN;o77NBNe%#Trv?Cg0|9_raF*{j0N}&|0PN}m0K5qR0FG@+ z{cC=3!GiG{X%jg)03A3D4}gP!1wesQ5CBN<2gYw{2yhx7@Pjir1u%dh_#|zJK6O1xbcWsczrn%31jx-C z9c_7;nO$65m|WPHZ0t>$fjm4s%q*w%l^mH^g`BRd$!*A6BSCIKf2{Vw1h54Ug;L6I${h{H1 z;9NnrKVeo@|A=&OR5Jb-iN7NqRNQQhnU#zkY@F;3jltv;|D=M0qqsA;QokALA658I zM&i!K){g(k%GlNXUsU>0@~=iPGWchUbo$YgRISY&1zCTC{Vn_ND8(Pjg1f!FxuLYRqp`iMJ=g_)F!_VQzf=63 zmx#IJ54C?);4k$8*Y2m&C>z`TXYTI>mga)o{LDZ4KRER#*Wax2TmJts#V^kPDf~C% z{F}zVEGlgUGBs8=H*z!+1hTTQ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 b/build.gradle @@ -4,8 +4,8 @@ buildscript { apply from: 'versions.gradle' addRepos(repositories) dependencies { - classpath 'com.android.tools.build:gradle:3.6.3' - classpath "org.mozilla.components:tooling-glean-gradle:$versions.android_components" + classpath 'com.android.tools.build:gradle:3.6.1' + classpath "org.mozilla.telemetry:glean-gradle-plugin:$versions.telemetry" classpath "$deps.kotlin.plugin" // NOTE: Do not place your application dependencies here; they belong diff --git a/docs/metrics.md b/docs/metrics.md index 8a5354014..fe734c8dd 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -14,75 +14,54 @@ This means you might have to go searching through the dependency tree to get a f ## baseline - This is a built-in ping that is assembled out of the box by the Glean SDK. - See the Glean SDK documentation for the [`baseline` ping](https://mozilla.github.io/glean/book/user/pings/baseline.html). - The following metrics are added to the ping: | Name | Type | Description | Data reviews | Extras | Expiration | | --- | --- | --- | --- | --- | --- | -| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | +| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568)||2020-05-01 | ## events - This is a built-in ping that is assembled out of the box by the Glean SDK. - See the Glean SDK documentation for the [`events` ping](https://mozilla.github.io/glean/book/user/pings/events.html). - The following metrics are added to the ping: | Name | Type | Description | Data reviews | Extras | Expiration | | --- | --- | --- | --- | --- | --- | -| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| firefox_account.sign_in |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user starts the sign in flow |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| firefox_account.sign_in_result |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user finishes the sign in flow |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)|
  • state: The result of the sign in flow. True in case of success, false in case of error
|2020-11-01 | -| firefox_account.sign_out |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the sign out button on the sync account page and was successfully signed out of FxA |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | +| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568)||2020-05-01 | +| firefox_account.sign_in |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user starts the sign in flow |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)||2020-05-01 | +| firefox_account.sign_in_result |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user finishes the sign in flow |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)|
  • state: The result of the sign in flow. True in case of success, false in case of error
|2020-05-01 | +| firefox_account.sign_out |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the sign out button on the sync account page and was successfully signed out of FxA |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)||2020-05-01 | ## metrics - This is a built-in ping that is assembled out of the box by the Glean SDK. - See the Glean SDK documentation for the [`metrics` ping](https://mozilla.github.io/glean/book/user/pings/metrics.html). - The following metrics are added to the ping: | Name | Type | Description | Data reviews | Extras | Expiration | | --- | --- | --- | --- | --- | --- | -| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| firefox_account.bookmarks_sync_status |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |Bookmarks sync engine status. True means that the bookmarks sync status is enabled, false otherwise. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| firefox_account.history_sync_status |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |History sync engine status. True means that the history sync status is enabled, false otherwise. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| firefox_account.received_tab |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Number of received tabs per day |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)|
  • desktop
  • mobile
  • tablet
  • tv
  • vr
  • unknown
|2020-11-01 | -| firefox_account.tab_sent |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Number of tabs successfully sent per day |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| searches.counts |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counting how many searches are queried in a specific search engine. The search engine `identifier`s are used as keys for this metric. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| url.query_type |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counting how many URLs are visited in a day, by input method. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)|
  • type_link
  • type_query
  • voice_query
|2020-11-01 | +| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568)||2020-05-01 | +| firefox_account.bookmarks_sync_status |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |Bookmarks sync engine status. True means that the bookmarks sync status is enabled, false otherwise. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)||2020-05-01 | +| firefox_account.history_sync_status |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |History sync engine status. True means that the history sync status is enabled, false otherwise. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)||2020-05-01 | +| firefox_account.received_tab |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Number of received tabs per day |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)|
  • desktop
  • mobile
  • tablet
  • tv
  • vr
  • unknown
|2020-05-01 | +| firefox_account.tab_sent |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Number of tabs successfully sent per day |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)||2020-05-01 | +| searches.counts |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counting how many searches are queried in a specific search engine. The search engine `identifier`s are used as keys for this metric. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258)||2020-05-01 | +| url.query_type |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counting how many URLs are visited in a day, by input method. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258)|
  • type_link
  • type_query
  • voice_query
|2020-05-01 | ## session-end - This ping is sent at the end of a session (when Firefox Reality switches to the background). We usually send search and UI control metrics at the end of a session. - -This ping includes the [client id](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section). - -**Data reviews for this ping:** - -- - -**Bugs related to this ping:** - -- - The following metrics are added to the ping: | Name | Type | Description | Data reviews | Extras | Expiration | | --- | --- | --- | --- | --- | --- | -| control.open_new_window |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Counting how many general windows are opened in a session. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2348#issuecomment-564736919), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| tabs.activated |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Number of tabs activated during a session |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| tabs.opened |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Number of tabs opened during a session |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)|
  • context_menu
  • tabs_dialog
  • bookmarks
  • history
  • fxa_login
  • received
  • pre_existing
  • browser
  • downloads
|2020-11-01 | -| url.domains |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Counting how many domains are visited in a session. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | -| url.visits |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Counting how many URL links are visited in a session. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258), [2](https://github.com/MozillaReality/FirefoxReality/pull/3199#issuecomment-617938749)||2020-11-01 | +| control.open_new_window |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Counting how many general windows are opened in a session. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2348#issuecomment-564736919)||2020-05-01 | +| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568)||2020-05-01 | +| tabs.activated |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Number of tabs activated during a session |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)||2020-05-01 | +| tabs.opened |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Number of tabs opened during a session |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)|
  • context_menu
  • tabs_dialog
  • bookmarks
  • history
  • fxa_login
  • received
  • pre_existing
  • browser
  • downloads
|2020-05-01 | +| url.domains |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Counting how many domains are visited in a session. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258)||2020-05-01 | +| url.visits |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Counting how many URL links are visited in a session. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2241#issuecomment-557740258)||2020-05-01 | diff --git a/versions.gradle b/versions.gradle index 69b28b5f3..46e9573bc 100644 --- a/versions.gradle +++ b/versions.gradle @@ -24,14 +24,14 @@ ext.deps = [:] def versions = [:] // GeckoView versions can be found here: // https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/ -versions.gecko_view = "78.0.20200516093457" -versions.android_components = "40.0.0" +versions.gecko_view = "76.0.20200330094747" +versions.android_components = "28.0.1" // Note that android-components also depends on application-services, // and in fact is our main source of appservices-related functionality. // The version number below tracks the application-services version // that we depend on directly for its rustlog package, and it's important // that it be kept insync with the version used by android-components above. -versions.mozilla_appservices = "0.58.2" +versions.mozilla_appservices = "0.48.2" versions.mozilla_speech = "1.0.11" versions.openwnn = "1.3.7" versions.room = "2.2.0" @@ -51,6 +51,7 @@ versions.snakeyaml = "1.24" versions.gson = "2.8.5" versions.robolectric = "4.2.1" versions.work = "2.2.0" +versions.telemetry = "24.1.0" ext.versions = versions def deps = [:] @@ -147,6 +148,7 @@ kotlin.coroutines_jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$version deps.kotlin = kotlin def telemetry = [:] +telemetry.glean_unittests = "org.mozilla.telemetry:glean-forUnitTests:$versions.telemetry" deps.telemetry = telemetry deps.constraint_layout = "androidx.constraintlayout:constraintlayout:$versions.constraint_layout"