Bug 1063753 - Remove Remote Tabs tray from Fennec entirely. r=mcomella

This mops up the bits of the Remote Tabs tray not already deleted by Bug
1014994.
This commit is contained in:
Nick Alexander 2014-11-06 08:11:06 -08:00
Родитель b5b99e684e
Коммит 61eeb953f5
24 изменённых файлов: 11 добавлений и 358 удалений

Просмотреть файл

@ -393,7 +393,6 @@ gbjar.sources += [
'Tab.java',
'Tabs.java',
'tabs/PrivateTabsPanel.java',
'tabs/RemoteTabsPanel.java',
'tabs/TabCurve.java',
'tabs/TabHistoryController.java',
'tabs/TabHistoryFragment.java',

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 661 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 518 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 737 B

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:height="1dp"/>
<solid android:color="#FF313131"/>
</shape>

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="30"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="30" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="60"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="60" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="90"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="90" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="120"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="120" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="150"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="150" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="180"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="180" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="210"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="210" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="240"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="240" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="270"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="270" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="300"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="300" />

Просмотреть файл

@ -1,6 +0,0 @@
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/tabs_synced"
android:fromDegrees="330"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="330" />

Просмотреть файл

@ -1,44 +0,0 @@
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false" >
<!-- Forgive me, but this is actually a reasonable way to get a
frame-by-frame rotation animation without adding lots of small
resources. The inner drawables rotate the master drawable. -->
<item
android:drawable="@drawable/tabs_synced"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_030"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_060"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_090"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_120"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_150"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_180"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_210"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_240"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_270"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_300"
android:duration="100"/>
<item
android:drawable="@drawable/tabs_synced_330"
android:duration="100"/>
</animation-list>

Просмотреть файл

@ -53,12 +53,6 @@
android:layout_height="match_parent"
android:visibility="gone"/>
<org.mozilla.gecko.tabs.RemoteTabsPanel
android:id="@+id/remote_tabs"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:visibility="gone"/>
</view>
<RelativeLayout android:id="@+id/tabs_panel_footer"

Просмотреть файл

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/container"
style="@style/TabsPanelFrame.PrivateTabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
style="@style/TabsPanelSection.PrivateTabs.Header"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
style="@style/TabsPanelItem.TextAppearance.Header.PrivateTabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/remote_tabs_panel_moved_title" />
<TextView
style="@style/TabsPanelItem.TextAppearance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/remote_tabs_panel_moved_desc" />
</LinearLayout>
<LinearLayout
style="@style/TabsPanelSection.PrivateTabs"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/go_to_panel"
style="@style/TabsPanelItem.TextAppearance.Linkified.LearnMore"
android:layout_width="match_parent"
android:text="@string/remote_tabs_panel_moved_link" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</merge>

Просмотреть файл

@ -70,12 +70,6 @@
android:layout_height="match_parent"
android:visibility="gone"/>
<org.mozilla.gecko.tabs.RemoteTabsPanel
android:id="@+id/remote_tabs"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:visibility="gone"/>
</view>
<!-- To preserve the ID, even when building for pre-11. -->

Просмотреть файл

@ -147,9 +147,4 @@
<item>0</item>
<item>1</item>
</string-array>
<string-array name="tabs_panel_spinner">
<item>@string/tabs_normal</item>
<item>@string/tabs_private</item>
<item>@string/tabs_synced</item>
</string-array>
</resources>

Просмотреть файл

@ -503,16 +503,6 @@
<item name="android:nextFocusLeft">@+id/info</item>
</style>
<!-- RemoteTabsList -->
<style name="RemoteTabsList" parent="android:style/Widget.ListView">
<item name="android:listSelector">@android:color/transparent</item>
<item name="android:cacheColorHint">@android:color/transparent</item>
<item name="android:divider">@android:color/transparent</item>
<item name="android:dividerHeight">1dip</item>
<item name="android:childDivider">@drawable/remote_tabs_child_divider</item>
<item name="android:groupIndicator">@android:color/transparent</item>
</style>
<!-- Tabs panel -->
<style name="TabsPanelFrameBase">
<item name="android:paddingLeft">16dp</item>

Просмотреть файл

@ -1,73 +0,0 @@
/* 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.tabs;
import org.mozilla.gecko.AboutPages;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.home.HomeConfig.PanelType;
import org.mozilla.gecko.tabs.TabsPanel.PanelView;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
/**
* A tabs tray panel that displays a static view that informs users that the
* Synced Tabs/Remote Tabs list is now accessed as a home panel. The view
* provides a single link that opens the new home panel.
*/
class RemoteTabsPanel extends FrameLayout implements PanelView {
private TabsPanel tabsPanel;
public RemoteTabsPanel(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater.from(context).inflate(R.layout.remote_tabs_panel, this);
final View link = findViewById(R.id.go_to_panel);
link.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// It is possible that this will fail: if the user has removed
// the Remote Tabs panel, it won't exist. (The new tab will open
// to the default panel, which is confusing but not
// catastrophic.) Querying the current configuration to
// determine if the panel is present is not worth the effort; we
// expect very few configurations to not include the Remote Tabs
// panel.
Tabs.getInstance().loadUrl(AboutPages.getURLForBuiltinPanelType(PanelType.REMOTE_TABS),
Tabs.LOADURL_NEW_TAB);
if (tabsPanel != null) {
tabsPanel.autoHidePanel();
}
}
});
}
@Override
public void setTabsPanel(TabsPanel panel) {
tabsPanel = panel;
}
@Override
public void show() {
setVisibility(View.VISIBLE);
}
@Override
public void hide() {
setVisibility(View.GONE);
}
@Override
public boolean shouldExpand() {
final LinearLayout container = (LinearLayout) findViewById(R.id.container);
return container.getOrientation() == LinearLayout.VERTICAL;
}
}

Просмотреть файл

@ -8,14 +8,11 @@ package org.mozilla.gecko.tabs;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.GeckoApp;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoAppShell.AppStateListener;
import org.mozilla.gecko.GeckoApplication;
import org.mozilla.gecko.GeckoProfile;
import org.mozilla.gecko.LightweightTheme;
import org.mozilla.gecko.LightweightThemeDrawable;
import org.mozilla.gecko.NewTabletUI;
import org.mozilla.gecko.R;
import org.mozilla.gecko.RestrictedProfiles;
import org.mozilla.gecko.Telemetry;
import org.mozilla.gecko.TelemetryContract;
import org.mozilla.gecko.animation.PropertyAnimator;
@ -27,7 +24,6 @@ import org.mozilla.gecko.widget.IconTabWidget;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
@ -49,7 +45,6 @@ public class TabsPanel extends LinearLayout
public static enum Panel {
NORMAL_TABS,
PRIVATE_TABS,
REMOTE_TABS
}
public static interface PanelView {
@ -87,10 +82,8 @@ public class TabsPanel extends LinearLayout
private PanelView mPanel;
private PanelView mPanelNormal;
private PanelView mPanelPrivate;
private PanelView mPanelRemote;
private RelativeLayout mFooter;
private TabsLayoutChangeListener mLayoutChangeListener;
private final AppStateListener mAppStateListener;
private IconTabWidget mTabWidget;
private static ImageButton mMenuButton;
@ -121,27 +114,8 @@ public class TabsPanel extends LinearLayout
inflateLayout(context);
initialize();
mAppStateListener = new AppStateListener() {
@Override
public void onResume() {
if (mPanel == mPanelRemote) {
// Refresh the remote panel.
mPanelRemote.show();
}
}
@Override
public void onOrientationChanged() {
// Remote panel is already refreshed by chrome refresh.
}
@Override
public void onPause() {}
};
}
private void inflateLayout(Context context) {
if (NewTabletUI.isEnabled(context)) {
LayoutInflater.from(context).inflate(R.layout.tabs_panel_default, this);
@ -160,9 +134,6 @@ public class TabsPanel extends LinearLayout
mPanelPrivate = (PanelView) findViewById(R.id.private_tabs_panel);
mPanelPrivate.setTabsPanel(this);
mPanelRemote = (PanelView) findViewById(R.id.remote_tabs);
mPanelRemote.setTabsPanel(this);
// Only applies to v11+ in landscape.
// We ship a stub to avoid a compiler error when referencing the
// ID, so we conditionalize here.
@ -183,13 +154,6 @@ public class TabsPanel extends LinearLayout
mTabWidget.addTab(R.drawable.tabs_normal, R.string.tabs_normal);
mTabWidget.addTab(R.drawable.tabs_private, R.string.tabs_private);
if (RestrictedProfiles.isAllowed(mContext, RestrictedProfiles.Restriction.DISALLOW_MODIFY_ACCOUNTS)) {
// The initial icon is not the animated icon, because on Android
// 4.4.2, the animation starts immediately (and can start at other
// unpredictable times). See Bug 1015974.
mTabWidget.addTab(R.drawable.tabs_synced, R.string.tabs_synced);
}
mTabWidget.setTabSelectionListener(this);
mMenuButton = (ImageButton) findViewById(R.id.menu);
@ -202,10 +166,6 @@ public class TabsPanel extends LinearLayout
}
public void showMenu() {
if (mCurrentPanel == Panel.REMOTE_TABS) {
return;
}
final Menu menu = mPopupMenu.getMenu();
// Each panel has a "+" shortcut button, so don't show it for that panel.
@ -235,10 +195,8 @@ public class TabsPanel extends LinearLayout
public void onTabChanged(int index) {
if (index == 0) {
show(Panel.NORMAL_TABS);
} else if (index == 1) {
show(Panel.PRIVATE_TABS);
} else {
show(Panel.REMOTE_TABS);
show(Panel.PRIVATE_TABS);
}
}
@ -310,14 +268,12 @@ public class TabsPanel extends LinearLayout
public void onAttachedToWindow() {
super.onAttachedToWindow();
mTheme.addListener(this);
mActivity.addAppStateListener(mAppStateListener);
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
mTheme.removeListener(this);
mActivity.removeAppStateListener(mAppStateListener);
}
@Override
@ -447,39 +403,25 @@ public class TabsPanel extends LinearLayout
case PRIVATE_TABS:
mPanel = mPanelPrivate;
break;
case REMOTE_TABS:
mPanel = mPanelRemote;
break;
default:
throw new IllegalArgumentException("Unknown panel type " + panelToShow);
}
mPanel.show();
if (mCurrentPanel == Panel.REMOTE_TABS) {
// The footer is only defined in the sidebar, for landscape v11+ views.
if (mFooter != null) {
mFooter.setVisibility(View.GONE);
}
if (mFooter != null) {
mFooter.setVisibility(View.VISIBLE);
}
mAddTab.setVisibility(View.INVISIBLE);
mAddTab.setVisibility(View.VISIBLE);
mAddTab.setImageLevel(index);
mMenuButton.setVisibility(View.GONE);
if (!HardwareUtils.hasMenuButton()) {
mMenuButton.setVisibility(View.VISIBLE);
mMenuButton.setEnabled(true);
mPopupMenu.setAnchor(mMenuButton);
} else {
if (mFooter != null)
mFooter.setVisibility(View.VISIBLE);
mAddTab.setVisibility(View.VISIBLE);
mAddTab.setImageLevel(index);
if (!HardwareUtils.hasMenuButton()) {
mMenuButton.setVisibility(View.VISIBLE);
mMenuButton.setEnabled(true);
mPopupMenu.setAnchor(mMenuButton);
} else {
mPopupMenu.setAnchor(mAddTab);
}
mPopupMenu.setAnchor(mAddTab);
}
if (isSideBar()) {
@ -597,17 +539,4 @@ public class TabsPanel extends LinearLayout
if (mLayoutChangeListener != null)
mLayoutChangeListener.onTabsLayoutChange(width, height);
}
/**
* Fetch the Drawable icon corresponding to the given panel.
* @param panel to fetch icon for.
* @return Drawable instance, or null if no icon is being displayed, or the icon does not exist.
*/
public Drawable getIconDrawable(Panel panel) {
return mTabWidget.getIconDrawable(panel.ordinal());
}
public void setIconDrawable(Panel panel, int resource) {
mTabWidget.setIconDrawable(panel.ordinal(), resource);
}
}