mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge f-t to m-c, a=merge
This commit is contained in:
commit
49ba55bccb
@ -29,9 +29,8 @@ FINAL_TARGET_FILES.defaults.profile += ['profile/prefs.js']
|
||||
|
||||
DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
|
||||
for var in ('MOZILLA_OFFICIAL', 'LIBXUL_SDK'):
|
||||
if CONFIG[var]:
|
||||
DEFINES[var] = True
|
||||
if CONFIG['LIBXUL_SDK']:
|
||||
DEFINES['LIBXUL_SDK'] = True
|
||||
|
||||
GENERATED_INCLUDES += [
|
||||
'/build',
|
||||
|
@ -32,6 +32,8 @@ var gContentPane = {
|
||||
|
||||
setEventListener("font.language.group", "change",
|
||||
gContentPane._rebuildFonts);
|
||||
setEventListener("notificationsPolicyButton", "command",
|
||||
gContentPane.showNotificationExceptions);
|
||||
setEventListener("popupPolicyButton", "command",
|
||||
gContentPane.showPopupExceptions);
|
||||
setEventListener("advancedFonts", "command",
|
||||
@ -83,6 +85,28 @@ var gContentPane = {
|
||||
* - true if popups are blocked by default, false otherwise
|
||||
*/
|
||||
|
||||
// NOTIFICATIONS
|
||||
|
||||
/**
|
||||
* Displays the notifications exceptions dialog where specific site notification
|
||||
* preferences can be set.
|
||||
*/
|
||||
showNotificationExceptions()
|
||||
{
|
||||
let bundlePreferences = document.getElementById("bundlePreferences");
|
||||
let params = { blockVisible: true,
|
||||
sessionVisible: false,
|
||||
allowVisible: true,
|
||||
prefilledHost: "",
|
||||
permissionType: "desktop-notification" };
|
||||
params.windowTitle = bundlePreferences.getString("notificationspermissionstitle");
|
||||
params.introText = bundlePreferences.getString("notificationspermissionstext");
|
||||
|
||||
gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
|
||||
"resizable=yes", params);
|
||||
},
|
||||
|
||||
|
||||
// POP-UPS
|
||||
|
||||
/**
|
||||
|
@ -60,6 +60,27 @@
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="notificationsGroup" data-category="paneContent" hidden="true">
|
||||
<caption><label>¬ificationsPolicy.label;</label></caption>
|
||||
<grid>
|
||||
<columns>
|
||||
<column flex="1"/>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row id="notificationsPolicyRow">
|
||||
<vbox align="start">
|
||||
<label id="notificationsPolicy">¬ificationsPolicyDesc.label;</label>
|
||||
</vbox>
|
||||
<hbox pack="end">
|
||||
<button id="notificationsPolicyButton" label="¬ificationsPolicyButton.label;"
|
||||
accesskey="¬ificationsPolicyButton.accesskey;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="miscGroup" data-category="paneContent" hidden="true">
|
||||
<caption><label>&popups.label;</label></caption>
|
||||
<grid id="contentGrid">
|
||||
|
@ -6,6 +6,12 @@
|
||||
|
||||
<!ENTITY blockPopups.label "Block pop-up windows">
|
||||
<!ENTITY blockPopups.accesskey "B">
|
||||
|
||||
<!ENTITY notificationsPolicy.label "Notifications">
|
||||
<!ENTITY notificationsPolicyDesc.label "Choose which sites are allowed to show notifications">
|
||||
<!ENTITY notificationsPolicyButton.accesskey "h">
|
||||
<!ENTITY notificationsPolicyButton.label "Choose…">
|
||||
|
||||
<!ENTITY popupExceptions.label "Exceptions…">
|
||||
<!ENTITY popupExceptions.accesskey "E">
|
||||
|
||||
|
@ -25,6 +25,8 @@ addonspermissionstext=You can specify which websites are allowed to install add-
|
||||
addons_permissions_title=Allowed Sites - Add-ons Installation
|
||||
popuppermissionstext=You can specify which websites are allowed to open pop-up windows. Type the exact address of the site you want to allow and then click Allow.
|
||||
popuppermissionstitle=Allowed Sites - Pop-ups
|
||||
notificationspermissionstext=You can specify which websites are always or never allowed to show notifications. Type the exact address of the site you want to manage and then click Block or Allow.
|
||||
notificationspermissionstitle=Notification Permissions
|
||||
invalidURI=Please enter a valid hostname
|
||||
invalidURITitle=Invalid Hostname Entered
|
||||
|
||||
|
@ -62,6 +62,3 @@ if CONFIG['NIGHTLY_BUILD']:
|
||||
EXTRA_PP_COMPONENTS += [
|
||||
'browsermodules.manifest',
|
||||
]
|
||||
|
||||
if CONFIG['MOZILLA_OFFICIAL']:
|
||||
DEFINES['MOZILLA_OFFICIAL'] = 1
|
||||
|
@ -8816,9 +8816,9 @@ AC_SUBST(MOZ_PKG_SPECIAL)
|
||||
AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
|
||||
|
||||
AC_SUBST(MOZILLA_OFFICIAL)
|
||||
|
||||
# Build revisions should always be present in official builds
|
||||
if test "$MOZILLA_OFFICIAL"; then
|
||||
AC_DEFINE(MOZILLA_OFFICIAL)
|
||||
# Build revisions should always be present in official builds
|
||||
MOZ_INCLUDE_SOURCE_INFO=1
|
||||
fi
|
||||
|
||||
|
@ -425,6 +425,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
}
|
||||
else {
|
||||
if (!IsOpen()) {
|
||||
menuParent->ChangeMenuItem(this, false, false);
|
||||
OpenMenu(false);
|
||||
}
|
||||
}
|
||||
|
@ -22,5 +22,6 @@ skip-if = os == 'linux' # No native mousedown event on Linux
|
||||
[test_popupZoom.xul]
|
||||
[test_resizer.xul]
|
||||
[test_stack.xul]
|
||||
[test_submenuClose.xul]
|
||||
[test_windowminmaxsize.xul]
|
||||
skip-if = buildapp == 'mulet'
|
||||
|
91
layout/xul/test/test_submenuClose.xul
Normal file
91
layout/xul/test/test_submenuClose.xul
Normal file
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1181560
|
||||
-->
|
||||
<window title="Mozilla Bug 1181560"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="SimpleTest.waitForFocus(nextTest, window)">
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
|
||||
|
||||
|
||||
<!-- test results are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1181560"
|
||||
target="_blank">Mozilla Bug 1181560</a>
|
||||
</body>
|
||||
|
||||
<vbox>
|
||||
<menubar>
|
||||
<menu id="menu" label="MyMenu">
|
||||
<menupopup>
|
||||
<menuitem label="A"/>
|
||||
<menu id="b" label="B">
|
||||
<menupopup>
|
||||
<menuitem label="B1"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="c" label="C">
|
||||
<menupopup>
|
||||
<menuitem label="C1"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
</vbox>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
/** Test for Bug 1181560 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
let menuB, menuC, mainMenu, menuBOpen, menuCOpen;
|
||||
let menuBOpenCount = 0;
|
||||
|
||||
function handleBOpens() {
|
||||
menuBOpenCount++;
|
||||
menuBOpen = true;
|
||||
ok(!menuCOpen, "Menu C should not be open when menu B has opened");
|
||||
if (menuBOpenCount >= 2) {
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
sendKey("LEFT", window);
|
||||
sendKey("DOWN", window);
|
||||
sendKey("RIGHT", window);
|
||||
}
|
||||
|
||||
function handleBCloses() {
|
||||
menuBOpen = false;
|
||||
}
|
||||
|
||||
function handleCOpens() {
|
||||
menuCOpen = true;
|
||||
ok(!menuBOpen, "Menu B should not be open when menu C has opened");
|
||||
synthesizeMouseAtCenter(menuB, {}, window);
|
||||
}
|
||||
|
||||
function handleCCloses() {
|
||||
menuCOpen = false;
|
||||
}
|
||||
|
||||
function nextTest(e) {
|
||||
mainMenu = document.getElementById("menu");
|
||||
menuB = document.getElementById("b");
|
||||
menuC = document.getElementById("c");
|
||||
menuB.firstChild.addEventListener("popupshown", handleBOpens, false);
|
||||
menuB.firstChild.addEventListener("popuphidden", handleBCloses, false);
|
||||
menuC.firstChild.addEventListener("popupshown", handleCOpens, false);
|
||||
menuC.firstChild.addEventListener("popuphidden", handleCCloses, false);
|
||||
mainMenu.addEventListener("popupshown", ev => {
|
||||
synthesizeMouseAtCenter(menuB, {}, window);
|
||||
});
|
||||
mainMenu.open = true;
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
@ -990,7 +990,7 @@ public class BrowserApp extends GeckoApp
|
||||
|
||||
@Override
|
||||
protected void processTabQueue() {
|
||||
if (AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized) {
|
||||
if (TabQueueHelper.TAB_QUEUE_ENABLED && mInitialized) {
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -3647,7 +3647,7 @@ public class BrowserApp extends GeckoApp
|
||||
}
|
||||
|
||||
// If the user has clicked the tab queue notification then load the tabs.
|
||||
if (AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized && isTabQueueAction) {
|
||||
if (TabQueueHelper.TAB_QUEUE_ENABLED && mInitialized && isTabQueueAction) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.NOTIFICATION, "tabqueue");
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
@ -3689,9 +3689,9 @@ public class BrowserApp extends GeckoApp
|
||||
@Override
|
||||
public void run() {
|
||||
// We only want to show the prompt if the browser has been opened from an external url
|
||||
if (AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized
|
||||
&& Intent.ACTION_VIEW.equals(intent.getAction())
|
||||
&& TabQueueHelper.shouldShowTabQueuePrompt(BrowserApp.this)) {
|
||||
if (TabQueueHelper.TAB_QUEUE_ENABLED && mInitialized
|
||||
&& Intent.ACTION_VIEW.equals(intent.getAction())
|
||||
&& TabQueueHelper.shouldShowTabQueuePrompt(BrowserApp.this)) {
|
||||
Intent promptIntent = new Intent(BrowserApp.this, TabQueuePrompt.class);
|
||||
startActivityForResult(promptIntent, ACTIVITY_REQUEST_TAB_QUEUE);
|
||||
}
|
||||
|
@ -1651,7 +1651,7 @@ public abstract class GeckoApp
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (AppConstants.MOZ_ANDROID_TAB_QUEUE && TabQueueHelper.shouldOpenTabQueueUrls(GeckoApp.this)) {
|
||||
if (TabQueueHelper.TAB_QUEUE_ENABLED && TabQueueHelper.shouldOpenTabQueueUrls(GeckoApp.this)) {
|
||||
|
||||
EventDispatcher.getInstance().registerGeckoThreadListener(new NativeEventListener() {
|
||||
@Override
|
||||
|
@ -49,8 +49,20 @@ public interface TelemetryContract {
|
||||
LOCALE_BROWSER_SELECTED("locale.browser.selected.1"),
|
||||
LOCALE_BROWSER_UNSELECTED("locale.browser.unselected.1"),
|
||||
|
||||
// Set default panel.
|
||||
PANEL_SET_DEFAULT("setdefault.1"),
|
||||
// Hide a built-in home panel.
|
||||
PANEL_HIDE("panel.hide.1"),
|
||||
|
||||
// Move a home panel up or down.
|
||||
PANEL_MOVE("panel.move.1"),
|
||||
|
||||
// Remove a custom home panel.
|
||||
PANEL_REMOVE("panel.remove.1"),
|
||||
|
||||
// Set default home panel.
|
||||
PANEL_SET_DEFAULT("panel.setdefault.1"),
|
||||
|
||||
// Show a hidden built-in home panel.
|
||||
PANEL_SHOW("panel.show.1"),
|
||||
|
||||
// Pinning an item.
|
||||
PIN("pin.1"),
|
||||
|
@ -123,6 +123,21 @@ Events
|
||||
``neterror.1``
|
||||
When the user performs actions on the in-content network error page. This should probably be a ``Session``, but it's difficult to start and stop the session reliably.
|
||||
|
||||
``panel.hide.1``
|
||||
Hide a built-in home panel.
|
||||
|
||||
``panel.move.1``
|
||||
Move a home panel up or down.
|
||||
|
||||
``panel.remove.1``
|
||||
Remove a custom home panel.
|
||||
|
||||
``panel.setdefault.1``
|
||||
Set default home panel.
|
||||
|
||||
``panel.show.1``
|
||||
Show a hidden built-in home panel.
|
||||
|
||||
``pin.1``, ``unpin.1``
|
||||
Sent when the user pinned or unpinned a top site.
|
||||
|
||||
@ -149,9 +164,6 @@ Events
|
||||
``search.setdefault.1``
|
||||
Sent when the user sets a search engine to be the default.
|
||||
|
||||
``setdefault.1``
|
||||
Set default home panel.
|
||||
|
||||
``share.1``
|
||||
Sharing content.
|
||||
|
||||
|
@ -11,7 +11,8 @@ import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import com.nineoldandroids.animation.Animator;
|
||||
import com.nineoldandroids.animation.AnimatorSet;
|
||||
import com.nineoldandroids.animation.ObjectAnimator;
|
||||
@ -21,6 +22,8 @@ import org.mozilla.gecko.RestrictedProfiles;
|
||||
import org.mozilla.gecko.Telemetry;
|
||||
import org.mozilla.gecko.TelemetryContract;
|
||||
import org.mozilla.gecko.animation.TransitionsTracker;
|
||||
import org.mozilla.gecko.home.HomePager.Decor;
|
||||
import org.mozilla.gecko.home.TabMenuStrip;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -28,6 +31,8 @@ public class FirstrunPager extends ViewPager {
|
||||
|
||||
private Context context;
|
||||
protected FirstrunPanel.PagerNavigation pagerNavigation;
|
||||
private Decor mDecor;
|
||||
private View mTabStrip;
|
||||
|
||||
public FirstrunPager(Context context) {
|
||||
this(context, null);
|
||||
@ -38,6 +43,24 @@ public class FirstrunPager extends ViewPager {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addView(View child, int index, ViewGroup.LayoutParams params) {
|
||||
if (child instanceof Decor) {
|
||||
((ViewPager.LayoutParams) params).isDecor = true;
|
||||
mDecor = (Decor) child;
|
||||
mTabStrip = child;
|
||||
|
||||
mDecor.setOnTitleClickListener(new TabMenuStrip.OnTitleClickListener() {
|
||||
@Override
|
||||
public void onTitleClicked(int index) {
|
||||
setCurrentItem(index, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
super.addView(child, index, params);
|
||||
}
|
||||
|
||||
public void load(Context appContext, FragmentManager fm, final FirstrunPane.OnFinishListener onFinishListener) {
|
||||
final List<FirstrunPagerConfig.FirstrunPanelConfig> panels;
|
||||
|
||||
@ -66,10 +89,13 @@ public class FirstrunPager extends ViewPager {
|
||||
};
|
||||
addOnPageChangeListener(new OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int i, float v, int i1) {}
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
mDecor.onPageScrolled(position, positionOffset, positionOffsetPixels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int i) {
|
||||
mDecor.onPageSelected(i);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.SHOW, TelemetryContract.Method.PANEL, "onboarding." + i);
|
||||
}
|
||||
|
||||
@ -111,6 +137,13 @@ public class FirstrunPager extends ViewPager {
|
||||
super(fm);
|
||||
this.panels = panels;
|
||||
this.fragments = new Fragment[panels.size()];
|
||||
for (FirstrunPagerConfig.FirstrunPanelConfig panel : panels) {
|
||||
mDecor.onAddPagerView(context.getString(panel.getTitleRes()));
|
||||
}
|
||||
|
||||
if (panels.size() > 0) {
|
||||
mDecor.onPageSelected(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,6 +164,7 @@ public class FirstrunPager extends ViewPager {
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int i) {
|
||||
// Unused now that we use TabMenuStrip.
|
||||
return context.getString(panels.get(i).getTitleRes()).toUpperCase();
|
||||
}
|
||||
}
|
||||
|
@ -237,6 +237,14 @@ public class HistoryPanel extends HomeFragment {
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
// Discard any additional item clicks on the list as the
|
||||
// panel is getting destroyed (bug 1210243).
|
||||
if (mRangeList != null) {
|
||||
mRangeList.setOnItemClickListener(null);
|
||||
}
|
||||
mList.setOnItemClickListener(null);
|
||||
|
||||
mRangeList = null;
|
||||
mList = null;
|
||||
mEmptyView = null;
|
||||
|
@ -19,7 +19,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
class HomeAdapter extends FragmentStatePagerAdapter {
|
||||
public class HomeAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private final Context mContext;
|
||||
private final ArrayList<PanelInfo> mPanelInfos;
|
||||
@ -29,8 +29,8 @@ class HomeAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private OnAddPanelListener mAddPanelListener;
|
||||
|
||||
interface OnAddPanelListener {
|
||||
public void onAddPanel(String title);
|
||||
public interface OnAddPanelListener {
|
||||
void onAddPanel(String title);
|
||||
}
|
||||
|
||||
public HomeAdapter(Context context, FragmentManager fm) {
|
||||
|
@ -114,19 +114,15 @@ public class HomePager extends ViewPager {
|
||||
public void onPanelSelected(String panelId);
|
||||
}
|
||||
|
||||
interface OnTitleClickListener {
|
||||
public void onTitleClicked(int index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Special type of child views that could be added as pager decorations by default.
|
||||
*/
|
||||
interface Decor {
|
||||
public void onAddPagerView(String title);
|
||||
public void removeAllPagerViews();
|
||||
public void onPageSelected(int position);
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels);
|
||||
public void setOnTitleClickListener(OnTitleClickListener onTitleClickListener);
|
||||
public interface Decor {
|
||||
void onAddPagerView(String title);
|
||||
void removeAllPagerViews();
|
||||
void onPageSelected(int position);
|
||||
void onPageScrolled(int position, float positionOffset, int positionOffsetPixels);
|
||||
void setOnTitleClickListener(TabMenuStrip.OnTitleClickListener onTitleClickListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,7 +181,7 @@ public class HomePager extends ViewPager {
|
||||
mDecor = (Decor) child;
|
||||
mTabStrip = child;
|
||||
|
||||
mDecor.setOnTitleClickListener(new OnTitleClickListener() {
|
||||
mDecor.setOnTitleClickListener(new TabMenuStrip.OnTitleClickListener() {
|
||||
@Override
|
||||
public void onTitleClicked(int index) {
|
||||
setCurrentItem(index, true);
|
||||
|
@ -1,146 +0,0 @@
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; 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.gecko.home;
|
||||
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.animation.BounceAnimatorBuilder;
|
||||
import org.mozilla.gecko.animation.BounceAnimatorBuilder.Attributes;
|
||||
import org.mozilla.gecko.animation.TransitionsTracker;
|
||||
import org.mozilla.gecko.util.ColorUtils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.support.v4.view.PagerTabStrip;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
import com.nineoldandroids.animation.AnimatorSet;
|
||||
import com.nineoldandroids.animation.ObjectAnimator;
|
||||
import com.nineoldandroids.animation.ValueAnimator;
|
||||
import com.nineoldandroids.view.ViewHelper;
|
||||
|
||||
/**
|
||||
* HomePagerTabStrip is a custom implementation of PagerTabStrip
|
||||
* that exposes XML attributes for the public methods.
|
||||
*/
|
||||
|
||||
class HomePagerTabStrip extends PagerTabStrip {
|
||||
|
||||
private static final String LOGTAG = "PagerTabStrip";
|
||||
private static final int ANIMATION_DELAY_MS = 50;
|
||||
private static final int ALPHA_MS = 10;
|
||||
private static final int BOUNCE1_MS = 350;
|
||||
private static final int BOUNCE2_MS = 200;
|
||||
private static final int BOUNCE3_MS = 100;
|
||||
private static final int INIT_OFFSET = 100;
|
||||
|
||||
private final Paint shadowPaint;
|
||||
private final int shadowSize;
|
||||
|
||||
public HomePagerTabStrip(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public HomePagerTabStrip(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.HomePagerTabStrip);
|
||||
int color = a.getColor(R.styleable.HomePagerTabStrip_tabIndicatorColor, 0x00);
|
||||
a.recycle();
|
||||
|
||||
setTabIndicatorColor(color);
|
||||
|
||||
final Resources res = getResources();
|
||||
shadowSize = res.getDimensionPixelSize(R.dimen.tabs_strip_shadow_size);
|
||||
|
||||
shadowPaint = new Paint();
|
||||
shadowPaint.setColor(ColorUtils.getColor(context, R.color.url_bar_shadow));
|
||||
shadowPaint.setStrokeWidth(0.0f);
|
||||
|
||||
getViewTreeObserver().addOnPreDrawListener(new PreDrawListener());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPaddingBottom() {
|
||||
// PagerTabStrip enforces a minimum bottom padding of 6dp which causes
|
||||
// misalignments when using 'center_vertical' gravity. Force padding bottom
|
||||
// to 0dp so that children are properly centered.
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
super.draw(canvas);
|
||||
|
||||
final int height = getHeight();
|
||||
canvas.drawRect(0, height - shadowSize, getWidth(), height, shadowPaint);
|
||||
}
|
||||
|
||||
private void animateTitles() {
|
||||
final View prevTextView = getChildAt(0);
|
||||
final View nextTextView = getChildAt(getChildCount() - 1);
|
||||
|
||||
if (prevTextView == null || nextTextView == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set up initial values for the views that will be animated.
|
||||
ViewHelper.setTranslationX(prevTextView, -INIT_OFFSET);
|
||||
ViewHelper.setAlpha(prevTextView, 0);
|
||||
ViewHelper.setTranslationX(nextTextView, INIT_OFFSET);
|
||||
ViewHelper.setAlpha(nextTextView, 0);
|
||||
|
||||
// Alpha animations.
|
||||
final ValueAnimator alpha1 = ObjectAnimator.ofFloat(prevTextView, "alpha", 1);
|
||||
final ValueAnimator alpha2 = ObjectAnimator.ofFloat(nextTextView, "alpha", 1);
|
||||
|
||||
final AnimatorSet alphaAnimatorSet = new AnimatorSet();
|
||||
alphaAnimatorSet.playTogether(alpha1, alpha2);
|
||||
alphaAnimatorSet.setDuration(ALPHA_MS);
|
||||
alphaAnimatorSet.setStartDelay(ANIMATION_DELAY_MS);
|
||||
|
||||
// Bounce animation.
|
||||
final float bounceDistance = getWidth()/100f; // Hack: TextFields still have 0 width here.
|
||||
|
||||
final BounceAnimatorBuilder prevBounceAnimatorBuilder = new BounceAnimatorBuilder(prevTextView, "translationX");
|
||||
prevBounceAnimatorBuilder.queue(new Attributes(bounceDistance, BOUNCE1_MS));
|
||||
prevBounceAnimatorBuilder.queue(new Attributes(-bounceDistance/4, BOUNCE2_MS));
|
||||
prevBounceAnimatorBuilder.queue(new Attributes(0, BOUNCE3_MS));
|
||||
|
||||
final BounceAnimatorBuilder nextBounceAnimatorBuilder = new BounceAnimatorBuilder(nextTextView, "translationX");
|
||||
nextBounceAnimatorBuilder.queue(new Attributes(-bounceDistance, BOUNCE1_MS));
|
||||
nextBounceAnimatorBuilder.queue(new Attributes(bounceDistance/4, BOUNCE2_MS));
|
||||
nextBounceAnimatorBuilder.queue(new Attributes(0, BOUNCE3_MS));
|
||||
|
||||
final AnimatorSet bounceAnimatorSet = new AnimatorSet();
|
||||
bounceAnimatorSet.playTogether(prevBounceAnimatorBuilder.build(), nextBounceAnimatorBuilder.build());
|
||||
|
||||
TransitionsTracker.track(nextBounceAnimatorBuilder);
|
||||
|
||||
final AnimatorSet titlesAnimatorSet = new AnimatorSet();
|
||||
titlesAnimatorSet.playTogether(alphaAnimatorSet, bounceAnimatorSet);
|
||||
titlesAnimatorSet.setStartDelay(ANIMATION_DELAY_MS);
|
||||
|
||||
// Start animations.
|
||||
titlesAnimatorSet.start();
|
||||
}
|
||||
|
||||
private class PreDrawListener implements ViewTreeObserver.OnPreDrawListener {
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
if (!TransitionsTracker.areTransitionsRunning()) {
|
||||
// Don't show the title bounce animation if other animations are running.
|
||||
animateTitles();
|
||||
}
|
||||
getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -78,6 +78,11 @@ public class ReadingListPanel extends HomeFragment {
|
||||
mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
final Context context = getActivity();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Cursor c = mAdapter.getCursor();
|
||||
if (c == null || !c.moveToPosition(position)) {
|
||||
return;
|
||||
@ -91,7 +96,7 @@ public class ReadingListPanel extends HomeFragment {
|
||||
// This item is a TwoLinePageRow, so we allow switch-to-tab.
|
||||
mUrlOpenListener.onUrlOpen(url, EnumSet.of(OnUrlOpenListener.Flags.ALLOW_SWITCH_TO_TAB));
|
||||
|
||||
markAsRead(id);
|
||||
markAsRead(context, id);
|
||||
}
|
||||
});
|
||||
|
||||
@ -110,9 +115,7 @@ public class ReadingListPanel extends HomeFragment {
|
||||
registerForContextMenu(mList);
|
||||
}
|
||||
|
||||
private void markAsRead(long id) {
|
||||
final Context context = getActivity();
|
||||
|
||||
private void markAsRead(final Context context, final long id) {
|
||||
GeckoProfile.get(context).getDB().getReadingListAccessor().markAsRead(
|
||||
context.getContentResolver(),
|
||||
id
|
||||
@ -122,6 +125,11 @@ public class ReadingListPanel extends HomeFragment {
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
// Discard any additional item clicks on the list as the
|
||||
// panel is getting destroyed (bug 1210243).
|
||||
mList.setOnItemClickListener(null);
|
||||
|
||||
mList = null;
|
||||
mTopView = null;
|
||||
mEmptyView = null;
|
||||
|
@ -166,6 +166,11 @@ public class RecentTabsPanel extends HomeFragment
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
// Discard any additional item clicks on the list as the
|
||||
// panel is getting destroyed (bug 1210243).
|
||||
mList.setOnItemClickListener(null);
|
||||
|
||||
mList = null;
|
||||
mEmptyView = null;
|
||||
|
||||
|
@ -125,6 +125,12 @@ public class RemoteTabsExpandableListFragment extends RemoteTabsBaseFragment {
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
// Discard any additional item clicks on the list as the
|
||||
// panel is getting destroyed (bug 1210243).
|
||||
mList.setOnChildClickListener(null);
|
||||
mList.setOnGroupClickListener(null);
|
||||
|
||||
mList = null;
|
||||
mEmptyView = null;
|
||||
}
|
||||
|
@ -140,6 +140,12 @@ public class RemoteTabsSplitPlaneFragment extends RemoteTabsBaseFragment {
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
// Discard any additional item clicks on the list as the
|
||||
// panel is getting destroyed (bug 1210243).
|
||||
mClientList.setOnItemClickListener(null);
|
||||
mTabList.setOnItemClickListener(null);
|
||||
|
||||
mClientList = null;
|
||||
mTabList = null;
|
||||
mEmptyView = null;
|
||||
|
@ -41,6 +41,10 @@ public class TabMenuStrip extends HorizontalScrollView
|
||||
private final Paint shadowPaint;
|
||||
private final int shadowSize;
|
||||
|
||||
public interface OnTitleClickListener {
|
||||
void onTitleClicked(int index);
|
||||
}
|
||||
|
||||
public TabMenuStrip(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
@ -117,7 +121,7 @@ public class TabMenuStrip extends HorizontalScrollView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnTitleClickListener(HomePager.OnTitleClickListener onTitleClickListener) {
|
||||
public void setOnTitleClickListener(OnTitleClickListener onTitleClickListener) {
|
||||
layout.setOnTitleClickListener(onTitleClickListener);
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,10 @@
|
||||
|
||||
package org.mozilla.gecko.home;
|
||||
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.util.ColorUtils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
@ -17,7 +19,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
@ -27,7 +28,7 @@ import android.widget.TextView;
|
||||
class TabMenuStripLayout extends LinearLayout
|
||||
implements View.OnFocusChangeListener {
|
||||
|
||||
private HomePager.OnTitleClickListener onTitleClickListener;
|
||||
private TabMenuStrip.OnTitleClickListener onTitleClickListener;
|
||||
private Drawable strip;
|
||||
private TextView selectedView;
|
||||
|
||||
@ -41,6 +42,8 @@ class TabMenuStripLayout extends LinearLayout
|
||||
// This variable is used to predict the direction of scroll.
|
||||
private float prevProgress;
|
||||
private int tabContentStart;
|
||||
private int activeTextColor;
|
||||
private ColorStateList inactiveTextColor;
|
||||
|
||||
TabMenuStripLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@ -48,6 +51,8 @@ class TabMenuStripLayout extends LinearLayout
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TabMenuStrip);
|
||||
final int stripResId = a.getResourceId(R.styleable.TabMenuStrip_strip, -1);
|
||||
tabContentStart = a.getDimensionPixelSize(R.styleable.TabMenuStrip_tabContentStart, 0);
|
||||
activeTextColor = a.getColor(R.styleable.TabMenuStrip_activeTextColor, R.color.text_and_tabs_tray_grey);
|
||||
inactiveTextColor = a.getColorStateList(R.styleable.TabMenuStrip_inactiveTextColor);
|
||||
a.recycle();
|
||||
|
||||
if (stripResId != -1) {
|
||||
@ -60,7 +65,7 @@ class TabMenuStripLayout extends LinearLayout
|
||||
void onAddPagerView(String title) {
|
||||
final TextView button = (TextView) LayoutInflater.from(getContext()).inflate(R.layout.tab_menu_strip, this, false);
|
||||
button.setText(title.toUpperCase());
|
||||
button.setTextColor(getResources().getColorStateList(R.color.tab_text_color));
|
||||
button.setTextColor(inactiveTextColor);
|
||||
|
||||
if (getChildCount() == 0) {
|
||||
button.setPadding(button.getPaddingLeft() + tabContentStart,
|
||||
@ -76,11 +81,11 @@ class TabMenuStripLayout extends LinearLayout
|
||||
|
||||
void onPageSelected(final int position) {
|
||||
if (selectedView != null) {
|
||||
selectedView.setTextColor(getResources().getColorStateList(R.color.tab_text_color));
|
||||
selectedView.setTextColor(inactiveTextColor);
|
||||
}
|
||||
|
||||
selectedView = (TextView) getChildAt(position);
|
||||
selectedView.setTextColor(ColorUtils.getColor(getContext(), R.color.placeholder_grey));
|
||||
selectedView.setTextColor(activeTextColor);
|
||||
|
||||
// Callback to measure and draw the strip after the view is visible.
|
||||
ViewTreeObserver vto = selectedView.getViewTreeObserver();
|
||||
@ -209,7 +214,7 @@ class TabMenuStripLayout extends LinearLayout
|
||||
}
|
||||
}
|
||||
|
||||
void setOnTitleClickListener(HomePager.OnTitleClickListener onTitleClickListener) {
|
||||
void setOnTitleClickListener(TabMenuStrip.OnTitleClickListener onTitleClickListener) {
|
||||
this.onTitleClickListener = onTitleClickListener;
|
||||
}
|
||||
|
||||
|
@ -340,7 +340,6 @@ gbjar.sources += [
|
||||
'home/HomeFragment.java',
|
||||
'home/HomeListView.java',
|
||||
'home/HomePager.java',
|
||||
'home/HomePagerTabStrip.java',
|
||||
'home/HomePanelsManager.java',
|
||||
'home/ImageLoader.java',
|
||||
'home/MultiTypeCursorAdapter.java',
|
||||
@ -822,7 +821,7 @@ ANDROID_ASSETS_DIRS += [
|
||||
# We do not expose MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN here because that
|
||||
# would leak the value to build logs. Instead we expose the token quietly where
|
||||
# appropriate in Makefile.in.
|
||||
for var in ('MOZ_ANDROID_ANR_REPORTER', 'MOZ_LINKER_EXTRACT', 'MOZILLA_OFFICIAL', 'MOZ_DEBUG',
|
||||
for var in ('MOZ_ANDROID_ANR_REPORTER', 'MOZ_LINKER_EXTRACT', 'MOZ_DEBUG',
|
||||
'MOZ_ANDROID_SEARCH_ACTIVITY', 'MOZ_NATIVE_DEVICES', 'MOZ_ANDROID_MLS_STUMBLER',
|
||||
'MOZ_ANDROID_SHARE_OVERLAY', 'MOZ_ANDROID_DOWNLOADS_INTEGRATION', 'MOZ_INSTALL_TRACKING',
|
||||
'MOZ_ANDROID_TAB_QUEUE', 'MOZ_ANDROID_FIREFOX_ACCOUNT_PROFILES'):
|
||||
|
@ -30,6 +30,7 @@ import org.mozilla.gecko.background.common.GlobalConstants;
|
||||
import org.mozilla.gecko.background.healthreport.HealthReportConstants;
|
||||
import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
|
||||
import org.mozilla.gecko.restrictions.Restriction;
|
||||
import org.mozilla.gecko.tabqueue.TabQueueHelper;
|
||||
import org.mozilla.gecko.updater.UpdateService;
|
||||
import org.mozilla.gecko.updater.UpdateServiceHelper;
|
||||
import org.mozilla.gecko.util.GeckoEventListener;
|
||||
@ -697,8 +698,7 @@ OnSharedPreferenceChangeListener
|
||||
} else if (pref instanceof PanelsPreferenceCategory) {
|
||||
mPanelsPreferenceCategory = (PanelsPreferenceCategory) pref;
|
||||
}
|
||||
if(AppConstants.MOZ_ANDROID_TAB_QUEUE && PREFS_CUSTOMIZE_SCREEN.equals(key)) {
|
||||
// Only change the customize pref screen summary on nightly builds with the tab queue build flag.
|
||||
if(TabQueueHelper.TAB_QUEUE_ENABLED && PREFS_CUSTOMIZE_SCREEN.equals(key)) {
|
||||
pref.setSummary(getString(R.string.pref_category_customize_alt_summary));
|
||||
}
|
||||
if (getResources().getString(R.string.pref_category_input_options).equals(key)) {
|
||||
@ -858,7 +858,7 @@ OnSharedPreferenceChangeListener
|
||||
}
|
||||
} else if (PREFS_TAB_QUEUE.equals(key)) {
|
||||
// Only show tab queue pref on nightly builds with the tab queue build flag.
|
||||
if (!AppConstants.MOZ_ANDROID_TAB_QUEUE) {
|
||||
if (!TabQueueHelper.TAB_QUEUE_ENABLED) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
|
@ -165,7 +165,7 @@ public class PanelsPreferenceCategory extends CustomListCategory {
|
||||
mConfigEditor.setDefault(id);
|
||||
mConfigEditor.apply();
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_SET_DEFAULT, Method.NONE, id);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_SET_DEFAULT, Method.DIALOG, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -177,9 +177,12 @@ public class PanelsPreferenceCategory extends CustomListCategory {
|
||||
|
||||
@Override
|
||||
public void uninstall(CustomListPreference pref) {
|
||||
mConfigEditor.uninstall(pref.getKey());
|
||||
final String id = pref.getKey();
|
||||
mConfigEditor.uninstall(id);
|
||||
mConfigEditor.apply();
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_REMOVE, Method.DIALOG, id);
|
||||
|
||||
super.uninstall(pref);
|
||||
}
|
||||
|
||||
@ -189,6 +192,9 @@ public class PanelsPreferenceCategory extends CustomListCategory {
|
||||
final String panelKey = pref.getKey();
|
||||
mConfigEditor.moveTo(panelKey, panelIndex - 1);
|
||||
final State state = mConfigEditor.apply();
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_MOVE, Method.DIALOG, panelKey);
|
||||
|
||||
refresh(state, panelKey);
|
||||
}
|
||||
}
|
||||
@ -199,6 +205,9 @@ public class PanelsPreferenceCategory extends CustomListCategory {
|
||||
final String panelKey = pref.getKey();
|
||||
mConfigEditor.moveTo(panelKey, panelIndex + 1);
|
||||
final State state = mConfigEditor.apply();
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_MOVE, Method.DIALOG, panelKey);
|
||||
|
||||
refresh(state, panelKey);
|
||||
}
|
||||
}
|
||||
@ -211,9 +220,16 @@ public class PanelsPreferenceCategory extends CustomListCategory {
|
||||
* @param toHide New hidden state of the preference
|
||||
*/
|
||||
protected void setHidden(PanelsPreference pref, boolean toHide) {
|
||||
mConfigEditor.setDisabled(pref.getKey(), toHide);
|
||||
final String id = pref.getKey();
|
||||
mConfigEditor.setDisabled(id, toHide);
|
||||
mConfigEditor.apply();
|
||||
|
||||
if (toHide) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_HIDE, Method.DIALOG, id);
|
||||
} else {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.PANEL_SHOW, Method.DIALOG, id);
|
||||
}
|
||||
|
||||
pref.setHidden(toHide);
|
||||
setDefaultFromConfig();
|
||||
}
|
||||
|
@ -5,10 +5,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<gradient android:angle="90"
|
||||
android:startColor="@color/action_orange"
|
||||
android:endColor="@color/fennec_ui_orange"
|
||||
android:type="linear"/>
|
||||
<solid android:color="@color/toolbar_grey_pressed"/>
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<solid android:color="@color/toolbar_grey_pressed"/>
|
||||
<corners android:radius="@dimen/doorhanger_rounded_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/toolbar_menu_dark_grey"/>
|
||||
<corners android:radius="@dimen/doorhanger_rounded_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<solid android:color="@color/link_blue_pressed"/>
|
||||
<corners android:radius="@dimen/doorhanger_rounded_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/link_blue"/>
|
||||
<corners android:radius="@dimen/doorhanger_rounded_corner_radius"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<gradient android:angle="90"
|
||||
android:startColor="@color/action_orange"
|
||||
android:endColor="@color/fennec_ui_orange"
|
||||
android:type="linear"/>
|
||||
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_focused="true"
|
||||
android:state_enabled="true">
|
||||
<shape>
|
||||
<gradient android:angle="90"
|
||||
android:startColor="#D2DAE2"
|
||||
android:endColor="#E3E8ED"
|
||||
android:type="linear"/>
|
||||
|
||||
<stroke android:width="2dp"
|
||||
android:color="@color/action_orange" />
|
||||
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_enabled="true">
|
||||
<shape>
|
||||
<gradient android:angle="90"
|
||||
android:startColor="#D2DAE2"
|
||||
android:endColor="#E3E8ED"
|
||||
android:type="linear"/>
|
||||
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -16,13 +16,14 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/firstrun_pager_background">
|
||||
|
||||
<org.mozilla.gecko.home.HomePagerTabStrip android:id="@+id/firstrun_tab_strip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="top"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@color/firstrun_tabstrip"
|
||||
gecko:tabIndicatorColor="@color/fennec_ui_orange"
|
||||
android:textColor="@color/android:white"/>
|
||||
<org.mozilla.gecko.home.TabMenuStrip android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/tabs_strip_height"
|
||||
android:background="@color/firstrun_tabstrip"
|
||||
android:visibility="visible"
|
||||
android:layout_gravity="top"
|
||||
gecko:strip="@drawable/home_tab_menu_strip"
|
||||
gecko:activeTextColor="@android:color/white"
|
||||
gecko:inactiveTextColor="@color/divider_light" />
|
||||
|
||||
</org.mozilla.gecko.firstrun.FirstrunPager>
|
||||
</org.mozilla.gecko.firstrun.FirstrunPane>
|
||||
|
@ -18,6 +18,8 @@
|
||||
android:background="@color/about_page_header_grey"
|
||||
android:layout_gravity="top"
|
||||
gecko:strip="@drawable/home_tab_menu_strip"
|
||||
gecko:activeTextColor="@color/placeholder_grey"
|
||||
gecko:inactiveTextColor="@color/tab_text_color"
|
||||
gecko:tabContentStart="@dimen/tab_strip_content_start" />
|
||||
|
||||
</org.mozilla.gecko.home.HomePager>
|
||||
|
@ -11,45 +11,45 @@
|
||||
<LinearLayout android:id="@+id/prompt"
|
||||
android:focusable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:minHeight="48dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:minHeight="@dimen/search_row_height"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="10dip">
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:textSize="12sp">
|
||||
|
||||
<TextView android:id="@+id/suggestions_prompt_title"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/TextAppearance.Widget.SuggestionsPrompt"/>
|
||||
|
||||
<TextView android:id="@+id/suggestions_prompt_yes"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:textAppearance="@style/TextAppearance.Widget.SuggestionsPrompt"
|
||||
android:background="@drawable/suggestion_selector"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="7dp"
|
||||
android:focusable="true"
|
||||
android:text="@string/button_yes" />
|
||||
android:fontFamily="sans-serif"
|
||||
android:textColor="@color/text_and_tabs_tray_grey"
|
||||
android:layout_marginRight="10dp"/>
|
||||
|
||||
<TextView android:id="@+id/suggestions_prompt_no"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:minWidth="72dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:textAppearance="@style/TextAppearance.Widget.SuggestionsPrompt"
|
||||
android:background="@drawable/suggestion_selector"
|
||||
android:nextFocusRight="@+id/suggestions_prompt_no"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="7dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:textColor="@color/text_and_tabs_tray_grey"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/search_suggestion_prompt_no"
|
||||
android:nextFocusRight="@+id/suggestions_prompt_yes"
|
||||
android:focusable="true"
|
||||
android:text="@string/button_no" />
|
||||
android:text="@string/button_no"/>
|
||||
|
||||
<TextView android:id="@+id/suggestions_prompt_yes"
|
||||
android:layout_height="32dp"
|
||||
android:minWidth="72dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/swipe_refresh_white"
|
||||
android:background="@drawable/search_suggestion_prompt_yes"
|
||||
android:focusable="true"
|
||||
android:text="@string/button_yes"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -4,8 +4,9 @@
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:minWidth="@dimen/tabs_strip_button_width"
|
||||
android:background="@drawable/tabs_strip_indicator"
|
||||
android:paddingLeft="@dimen/tabs_strip_button_padding"
|
||||
|
@ -126,10 +126,6 @@
|
||||
<attr name="topDivider" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="HomePagerTabStrip">
|
||||
<attr name="tabIndicatorColor" format="color"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="FadedTextView">
|
||||
<attr name="fadeWidth" format="dimension"/>
|
||||
</declare-styleable>
|
||||
@ -167,6 +163,8 @@
|
||||
<declare-styleable name="TabMenuStrip">
|
||||
<attr name="strip" format="reference"/>
|
||||
<attr name="tabContentStart" format="dimension" />
|
||||
<attr name="activeTextColor" format="color" />
|
||||
<attr name="inactiveTextColor" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TabPanelBackButton">
|
||||
|
@ -390,19 +390,11 @@
|
||||
<item name="android:textColor">@color/primary_text</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Widget.HomePagerTabStrip" parent="TextAppearance.Small">
|
||||
<item name="android:textColor">?android:attr/textColorHint</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Widget.HomePagerTabMenuStrip" parent="TextAppearance.Small">
|
||||
<item name="android:textColor">?android:attr/textColorHint</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Widget.SuggestionsPrompt" parent="TextAppearance.Small">
|
||||
<item name="android:textColor">@color/url_bar_title</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Widget.Home" />
|
||||
|
||||
<style name="TextAppearance.Widget.Home.Header" parent="TextAppearance.Small">
|
||||
|
@ -46,7 +46,7 @@ public class TabQueueDispatcher extends Locales.LocaleAwareActivity {
|
||||
|
||||
// For the moment lets exit early and start fennec as normal if we're not in nightly with
|
||||
// the tab queue build flag.
|
||||
if (!AppConstants.MOZ_ANDROID_TAB_QUEUE) {
|
||||
if (!TabQueueHelper.TAB_QUEUE_ENABLED) {
|
||||
loadNormally(safeIntent.getUnsafe());
|
||||
return;
|
||||
}
|
||||
|
@ -30,6 +30,9 @@ import org.json.JSONObject;
|
||||
public class TabQueueHelper {
|
||||
private static final String LOGTAG = "Gecko" + TabQueueHelper.class.getSimpleName();
|
||||
|
||||
// Disable Tab Queue for API level 10 (GB) - Bug 1206055
|
||||
public static final boolean TAB_QUEUE_ENABLED = AppConstants.Versions.feature11Plus && AppConstants.MOZ_ANDROID_TAB_QUEUE;
|
||||
|
||||
public static final String FILE_NAME = "tab_queue_url_list.json";
|
||||
public static final String LOAD_URLS_ACTION = "TAB_QUEUE_LOAD_URLS_ACTION";
|
||||
public static final int TAB_QUEUE_NOTIFICATION_ID = R.id.tabQueueNotification;
|
||||
|
@ -262,12 +262,12 @@ public class TabsPanel extends LinearLayout
|
||||
|
||||
// This allows us to accommodate varying height tab previews across different devices.
|
||||
// We should be able to remove once we remove the list view and remove the chrome again
|
||||
return resources.getDimensionPixelSize(R.dimen.tab_thumbnail_height
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_title_height)
|
||||
+ 2 * (resources.getDimensionPixelSize(R.dimen.tab_highlight_stroke_width)
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_vertical_padding)
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_thumbnail_padding)
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_thumbnail_margin)));
|
||||
return resources.getDimensionPixelSize(R.dimen.tab_thumbnail_height)
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_title_height)
|
||||
+ 2 * (resources.getDimensionPixelSize(R.dimen.tab_highlight_stroke_width)
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_vertical_padding)
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_thumbnail_padding)
|
||||
+ resources.getDimensionPixelSize(R.dimen.tab_thumbnail_margin));
|
||||
}
|
||||
|
||||
Rect windowRect = new Rect();
|
||||
|
@ -58,22 +58,70 @@ function show(id) {
|
||||
}
|
||||
}
|
||||
|
||||
// Each time we try to load the remote <iframe>, loadedDeferred is replaced. It
|
||||
// is resolved by a LOADED message, and rejected by a failure to load.
|
||||
var loadedDeferred = null;
|
||||
|
||||
// We have a new load starting. Replace the existing promise with a new one,
|
||||
// and queue up the transition to remote content.
|
||||
function deferTransitionToRemoteAfterLoaded() {
|
||||
function deferTransitionToRemoteAfterLoaded(url) {
|
||||
log.d('Waiting for LOADED message.');
|
||||
|
||||
// We are collecting data to understand the experience when using
|
||||
// about:accounts to connect to the specific fxa-content-server hosted by
|
||||
// Mozilla at accounts.firefox.com. However, we don't want to observe what
|
||||
// alternate servers users might be using, so we can't collect the whole URL.
|
||||
// Here, we filter the data based on whether the user is /not/ using
|
||||
// accounts.firefox.com, and then record just the endpoint path. Other
|
||||
// collected data could expose that the user is using Firefox Accounts, and
|
||||
// together, that leaks the number of users not using accounts.firefox.com.
|
||||
// We accept this leak: Mozilla already collects data about whether Sync (both
|
||||
// legacy and FxA) is using a custom server in various situations: see the
|
||||
// WEAVE_CUSTOM_* Telemetry histograms.
|
||||
let recordResultTelemetry; // Defined only when not customized.
|
||||
let isCustomized = Services.prefs.prefHasUserValue("identity.fxaccounts.remote.webchannel.uri");
|
||||
if (!isCustomized) {
|
||||
// Turn "https://accounts.firefox.com/settings?context=fx_fennec_v1&email=EMAIL" into "/settings".
|
||||
let key = Services.io.newURI(url, null, null).path.split("?")[0];
|
||||
|
||||
let startTime = Cu.now();
|
||||
|
||||
let start = Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_LOAD_STARTED_COUNT');
|
||||
start.add(key);
|
||||
|
||||
recordResultTelemetry = function(success) {
|
||||
let rate = Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_RATE');
|
||||
rate.add(key, success);
|
||||
|
||||
// We would prefer to use TelemetryStopwatch, but it doesn't yet support
|
||||
// keyed histograms (see Bug 1205898). So we measure and store ourselves.
|
||||
let delta = Cu.now() - startTime; // Floating point milliseconds, microsecond precision.
|
||||
let time = success ?
|
||||
Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_TIME_MS') :
|
||||
Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_FAILURE_TIME_MS');
|
||||
time.add(key, Math.round(delta));
|
||||
};
|
||||
}
|
||||
|
||||
loadedDeferred = PromiseUtils.defer();
|
||||
loadedDeferred.promise.then(() => {
|
||||
log.d('Got LOADED message!');
|
||||
document.getElementById("remote").style.opacity = 0;
|
||||
show("remote");
|
||||
document.getElementById("remote").style.opacity = 1;
|
||||
if (!isCustomized) {
|
||||
recordResultTelemetry(true);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
log.w('Did not get LOADED message: ' + e.toString());
|
||||
if (!isCustomized) {
|
||||
recordResultTelemetry(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleLoadedMessage(message) {
|
||||
log.d('Got LOADED message!');
|
||||
loadedDeferred.resolve();
|
||||
};
|
||||
|
||||
@ -83,7 +131,8 @@ let wrapper = {
|
||||
url: null,
|
||||
|
||||
init: function (url) {
|
||||
deferTransitionToRemoteAfterLoaded();
|
||||
this.url = url;
|
||||
deferTransitionToRemoteAfterLoaded(this.url);
|
||||
|
||||
let iframe = document.getElementById("remote");
|
||||
this.iframe = iframe;
|
||||
@ -92,7 +141,6 @@ let wrapper = {
|
||||
docShell.QueryInterface(Ci.nsIWebProgress);
|
||||
docShell.addProgressListener(this.iframeListener, Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
|
||||
|
||||
this.url = url;
|
||||
// Set the iframe's location with loadURI/LOAD_FLAGS_BYPASS_HISTORY to
|
||||
// avoid having a new history entry being added.
|
||||
let webNav = iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
@ -100,7 +148,7 @@ let wrapper = {
|
||||
},
|
||||
|
||||
retry: function () {
|
||||
deferTransitionToRemoteAfterLoaded();
|
||||
deferTransitionToRemoteAfterLoaded(this.url);
|
||||
|
||||
let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
|
||||
@ -131,6 +179,12 @@ let wrapper = {
|
||||
// so avoid doing that more than once
|
||||
if (failure && aStatus != Components.results.NS_BINDING_ABORTED) {
|
||||
aRequest.cancel(Components.results.NS_BINDING_ABORTED);
|
||||
// Since after a promise is fulfilled, subsequent fulfillments are
|
||||
// treated as no-ops, we don't care that we might see multiple failures
|
||||
// due to multiple listener callbacks. (It's not easy to extract this
|
||||
// from the Promises spec, but it is widely quoted. Start with
|
||||
// http://stackoverflow.com/a/18218542.)
|
||||
loadedDeferred.reject(new Error("Failed in onStateChange!"));
|
||||
show("networkError");
|
||||
}
|
||||
},
|
||||
@ -138,6 +192,8 @@ let wrapper = {
|
||||
onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
|
||||
if (aRequest && aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
|
||||
aRequest.cancel(Components.results.NS_BINDING_ABORTED);
|
||||
// As above, we're not concerned by multiple listener callbacks.
|
||||
loadedDeferred.reject(new Error("Failed in onLocationChange!"));
|
||||
show("networkError");
|
||||
}
|
||||
},
|
||||
|
@ -10,6 +10,7 @@ import java.util.Map.Entry;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.Actions;
|
||||
import org.mozilla.gecko.AppConstants;
|
||||
import org.mozilla.gecko.tabqueue.TabQueueHelper;
|
||||
import org.mozilla.gecko.util.HardwareUtils;
|
||||
import org.mozilla.gecko.util.InputOptionsUtils;
|
||||
|
||||
@ -197,7 +198,7 @@ public class testSettingsMenuItems extends PixelTest {
|
||||
}
|
||||
|
||||
// Tab Queue
|
||||
if (AppConstants.MOZ_ANDROID_TAB_QUEUE) {
|
||||
if (TabQueueHelper.TAB_QUEUE_ENABLED) {
|
||||
final String[] tabQueue = { mStringHelper.TAB_QUEUE_LABEL, mStringHelper.TAB_QUEUE_SUMMARY };
|
||||
settingsMap.get(PATH_CUSTOMIZE).add(tabQueue);
|
||||
}
|
||||
|
@ -8874,6 +8874,38 @@
|
||||
"kind": "count",
|
||||
"description": "Counts the number of times that a sync has failed because of trying to sync before server backoff interval has passed."
|
||||
},
|
||||
"ABOUT_ACCOUNTS_CONTENT_SERVER_LOAD_STARTED_COUNT": {
|
||||
"alert_emails": ["mobile-frontend@mozilla.com"],
|
||||
"expires_in_version": "50",
|
||||
"kind": "count",
|
||||
"keyed": true,
|
||||
"description": "The number of remote content loads started. Keyed on fxa-content-server endpoint, like '/signin' or '/settings'."
|
||||
},
|
||||
"ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_RATE": {
|
||||
"alert_emails": ["mobile-frontend@mozilla.com"],
|
||||
"expires_in_version": "50",
|
||||
"kind": "boolean",
|
||||
"keyed": true,
|
||||
"description": "The number of remote content loads that fail (0) vs. receive the remote 'LOADED' message (1). Keyed on fxa-content-server endpoint path, like '/signin' or '/settings'."
|
||||
},
|
||||
"ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_TIME_MS": {
|
||||
"alert_emails": ["mobile-frontend@mozilla.com"],
|
||||
"expires_in_version": "50",
|
||||
"keyed": true,
|
||||
"kind": "exponential",
|
||||
"high": "60000",
|
||||
"n_buckets": 50,
|
||||
"description": "The length of time (in milliseconds) between starting remote content load and receiving the remote 'LOADED' message. Keyed on fxa-content-server endpoint path, like '/signin' or '/settings'."
|
||||
},
|
||||
"ABOUT_ACCOUNTS_CONTENT_SERVER_FAILURE_TIME_MS": {
|
||||
"alert_emails": ["mobile-frontend@mozilla.com"],
|
||||
"expires_in_version": "50",
|
||||
"keyed": true,
|
||||
"kind": "exponential",
|
||||
"high": "60000",
|
||||
"n_buckets": 50,
|
||||
"description": "The length of time (in milliseconds) between starting remote content load and failing with a connection error. Keyed on fxa-content-server endpoint path, like '/signin' or '/settings'."
|
||||
},
|
||||
"SLOW_SCRIPT_NOTICE_COUNT": {
|
||||
"alert_emails": ["perf-telemetry-alerts@mozilla.com"],
|
||||
"expires_in_version": "never",
|
||||
|
@ -74,9 +74,6 @@ enums = GENERATED_FILES['TelemetryHistogramEnums.h']
|
||||
enums.script = 'gen-histogram-enum.py'
|
||||
enums.inputs = histogram_files
|
||||
|
||||
if CONFIG['MOZILLA_OFFICIAL']:
|
||||
DEFINES['MOZILLA_OFFICIAL'] = True
|
||||
|
||||
DEFINES['MOZ_APP_VERSION'] = '"%s"' % CONFIG['MOZ_APP_VERSION']
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
@ -109,8 +109,7 @@ for var in ('ANDROID_PACKAGE_NAME',
|
||||
'DEBUG_JS_MODULES'):
|
||||
DEFINES[var] = CONFIG[var]
|
||||
|
||||
for var in ('MOZILLA_OFFICIAL',
|
||||
'MOZ_TOOLKIT_SEARCH',
|
||||
for var in ('MOZ_TOOLKIT_SEARCH',
|
||||
'MOZ_UPDATER'):
|
||||
if CONFIG[var]:
|
||||
DEFINES[var] = True
|
||||
|
@ -7,10 +7,8 @@
|
||||
toolbarbutton {
|
||||
-moz-box-align: center;
|
||||
-moz-box-pack: center;
|
||||
margin: 0px 2px 0px 2px;
|
||||
padding: 3px 1px 3px 1px;
|
||||
border-right: 1px solid transparent;
|
||||
border-left: 1px solid transparent;
|
||||
margin: 0 2px;
|
||||
padding: 3px 2px;
|
||||
background-color: transparent;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
@ -145,9 +145,6 @@ DEFINES['GRE_MILESTONE'] = CONFIG['GRE_MILESTONE']
|
||||
for var in ('APP_VERSION', 'APP_ID'):
|
||||
DEFINES[var] = CONFIG['MOZ_%s' % var]
|
||||
|
||||
if CONFIG['MOZILLA_OFFICIAL']:
|
||||
DEFINES['MOZILLA_OFFICIAL'] = True
|
||||
|
||||
if CONFIG['MOZ_BUILD_APP'] == 'browser':
|
||||
DEFINES['MOZ_BUILD_APP_IS_BROWSER'] = True
|
||||
|
||||
|
@ -46,9 +46,6 @@ MOCHITEST_WEBAPPRT_CONTENT_MANIFESTS += ['test/content/webapprt.ini']
|
||||
DIST_SUBDIR = 'webapprt'
|
||||
export('DIST_SUBDIR')
|
||||
|
||||
if CONFIG['MOZILLA_OFFICIAL']:
|
||||
DEFINES['MOZILLA_OFFICIAL'] = True
|
||||
|
||||
DEFINES['GRE_MILESTONE'] = CONFIG['GRE_MILESTONE']
|
||||
DEFINES['MOZ_APP_BASENAME'] = CONFIG['MOZ_APP_BASENAME']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user