Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- | 1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- |
2 * This Source Code Form is subject to the terms of the Mozilla Public | 2 * This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 package org.mozilla.gecko; | 6 package org.mozilla.gecko; |
7 | 7 |
8 import java.io.File; | 8 import java.io.File; |
9 import java.io.FileNotFoundException; | 9 import java.io.FileNotFoundException; |
10 import java.lang.reflect.Method; | 10 import java.lang.reflect.Method; |
(...skipping 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2567 String urlFromReader = ReaderModeUtils.getUrlFromAboutReader(url); | 2567 String urlFromReader = ReaderModeUtils.getUrlFromAboutReader(url); |
2568 if (urlFromReader != null) { | 2568 if (urlFromReader != null) { |
2569 url = urlFromReader; | 2569 url = urlFromReader; |
2570 } | 2570 } |
2571 } | 2571 } |
2572 | 2572 |
2573 // Disable share menuitem for about:, chrome:, file:, and resource: URIs | 2573 // Disable share menuitem for about:, chrome:, file:, and resource: URIs |
2574 final boolean inGuestMode = GeckoProfile.get(this).inGuestMode(); | 2574 final boolean inGuestMode = GeckoProfile.get(this).inGuestMode(); |
2575 share.setVisible(!inGuestMode); | 2575 share.setVisible(!inGuestMode); |
2576 share.setEnabled(StringUtils.isShareableUrl(url) && !inGuestMode); | 2576 share.setEnabled(StringUtils.isShareableUrl(url) && !inGuestMode); |
2577 MenuUtils.safeSetEnabled(aMenu, R.id.apps, !inGuestMode); | 2577 // Removed R.id.apps and R.id.addons as of issue #2350 |
Felix Dahlke
2015/04/22 13:29:59
As in that other review - how about s/as of/as par
| |
2578 MenuUtils.safeSetEnabled(aMenu, R.id.addons, !inGuestMode); | |
2579 MenuUtils.safeSetEnabled(aMenu, R.id.downloads, !inGuestMode); | 2578 MenuUtils.safeSetEnabled(aMenu, R.id.downloads, !inGuestMode); |
2580 | 2579 |
2581 // NOTE: Use MenuUtils.safeSetEnabled because some actions might | 2580 // NOTE: Use MenuUtils.safeSetEnabled because some actions might |
2582 // be on the BrowserToolbar context menu | 2581 // be on the BrowserToolbar context menu |
2583 MenuUtils.safeSetEnabled(aMenu, R.id.page, !isAboutHome(tab)); | 2582 MenuUtils.safeSetEnabled(aMenu, R.id.page, !isAboutHome(tab)); |
2584 MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, tab.hasFeeds()); | 2583 MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, tab.hasFeeds()); |
2585 MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, tab.hasOpenSearc h()); | 2584 MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, tab.hasOpenSearc h()); |
2586 MenuUtils.safeSetEnabled(aMenu, R.id.site_settings, !isAboutHome(tab)); | 2585 MenuUtils.safeSetEnabled(aMenu, R.id.site_settings, !isAboutHome(tab)); |
2587 MenuUtils.safeSetEnabled(aMenu, R.id.add_to_launcher, !isAboutHome(tab)) ; | 2586 MenuUtils.safeSetEnabled(aMenu, R.id.add_to_launcher, !isAboutHome(tab)) ; |
2588 | 2587 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2736 if (itemId == R.id.help) { | 2735 if (itemId == R.id.help) { |
2737 final String VERSION = AppConstants.MOZ_APP_VERSION; | 2736 final String VERSION = AppConstants.MOZ_APP_VERSION; |
2738 final String OS = AppConstants.OS_TARGET; | 2737 final String OS = AppConstants.OS_TARGET; |
2739 final String LOCALE = BrowserLocaleManager.getLanguageTag(Locale.get Default()); | 2738 final String LOCALE = BrowserLocaleManager.getLanguageTag(Locale.get Default()); |
2740 | 2739 |
2741 final String URL = getResources().getString(R.string.help_link, VERS ION, OS, LOCALE); | 2740 final String URL = getResources().getString(R.string.help_link, VERS ION, OS, LOCALE); |
2742 Tabs.getInstance().loadUrlInTab(URL); | 2741 Tabs.getInstance().loadUrlInTab(URL); |
2743 return true; | 2742 return true; |
2744 } | 2743 } |
2745 | 2744 |
2746 if (itemId == R.id.addons) { | 2745 » // Removed ADDONS and APPS as of issue #2350 |
Felix Dahlke
2015/04/22 13:29:59
Tab, not spaces?
| |
2747 Tabs.getInstance().loadUrlInTab(AboutPages.ADDONS); | |
2748 return true; | |
2749 } | |
2750 | |
2751 if (itemId == R.id.apps) { | |
2752 Tabs.getInstance().loadUrlInTab(AboutPages.APPS); | |
2753 return true; | |
2754 } | |
2755 | 2746 |
2756 if (itemId == R.id.downloads) { | 2747 if (itemId == R.id.downloads) { |
2757 Tabs.getInstance().loadUrlInTab(AboutPages.DOWNLOADS); | 2748 Tabs.getInstance().loadUrlInTab(AboutPages.DOWNLOADS); |
2758 return true; | 2749 return true; |
2759 } | 2750 } |
2760 | 2751 |
2761 if (itemId == R.id.char_encoding) { | 2752 if (itemId == R.id.char_encoding) { |
2762 GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Char Encoding:Get", null)); | 2753 GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Char Encoding:Get", null)); |
2763 return true; | 2754 return true; |
2764 } | 2755 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3164 final SessionInformation previ ousSession) { | 3155 final SessionInformation previ ousSession) { |
3165 return new BrowserHealthRecorder(context, | 3156 return new BrowserHealthRecorder(context, |
3166 GeckoSharedPrefs.forApp(context), | 3157 GeckoSharedPrefs.forApp(context), |
3167 profilePath, | 3158 profilePath, |
3168 dispatcher, | 3159 dispatcher, |
3169 osLocale, | 3160 osLocale, |
3170 appLocale, | 3161 appLocale, |
3171 previousSession); | 3162 previousSession); |
3172 } | 3163 } |
3173 } | 3164 } |
OLD | NEW |