Commit 2ceb0195 authored by Pedro Amaral's avatar Pedro Amaral Committed by Commit Bot

Remove unused SelectableListToolbarObserver interface

This interface was never implemented so it's being removed.

Bug: 814528
Change-Id: I24a7e51ac3d7575d91253ac097a5308e1fb22119
Reviewed-on: https://chromium-review.googlesource.com/956684Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Pedro Amaral <amaralp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543869}
parent bc753b0a
...@@ -30,7 +30,6 @@ import android.widget.TextView; ...@@ -30,7 +30,6 @@ import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener; import android.widget.TextView.OnEditorActionListener;
import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ObserverList;
import org.chromium.base.VisibleForTesting; import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.toolbar.ActionModeController; import org.chromium.chrome.browser.toolbar.ActionModeController;
...@@ -76,23 +75,6 @@ public class SelectableListToolbar<E> ...@@ -76,23 +75,6 @@ public class SelectableListToolbar<E>
void onEndSearch(); void onEndSearch();
} }
/**
* An interface to observe events on this toolbar.
*/
public interface SelectableListToolbarObserver {
/**
* A notification that the theme color of the toolbar has changed.
* @param isLightTheme Whether or not the toolbar is using a light theme. When this
* parameter is true, it indicates that dark drawables should be used.
*/
void onThemeColorChanged(boolean isLightTheme);
/**
* A notification that search mode has been activated for this toolbar.
*/
void onStartSearch();
}
/** No navigation button is displayed. **/ /** No navigation button is displayed. **/
public static final int NAVIGATION_BUTTON_NONE = 0; public static final int NAVIGATION_BUTTON_NONE = 0;
/** Button to open the DrawerLayout. Only valid if mDrawerLayout is set. **/ /** Button to open the DrawerLayout. Only valid if mDrawerLayout is set. **/
...@@ -102,9 +84,6 @@ public class SelectableListToolbar<E> ...@@ -102,9 +84,6 @@ public class SelectableListToolbar<E>
/** Button to clear the selection. **/ /** Button to clear the selection. **/
public static final int NAVIGATION_BUTTON_SELECTION_BACK = 3; public static final int NAVIGATION_BUTTON_SELECTION_BACK = 3;
/** An observer list for this toolbar. */
private final ObserverList<SelectableListToolbarObserver> mObservers = new ObserverList<>();
protected boolean mIsSelectionEnabled; protected boolean mIsSelectionEnabled;
protected SelectionDelegate<E> mSelectionDelegate; protected SelectionDelegate<E> mSelectionDelegate;
protected boolean mIsSearching; protected boolean mIsSearching;
...@@ -115,7 +94,6 @@ public class SelectableListToolbar<E> ...@@ -115,7 +94,6 @@ public class SelectableListToolbar<E>
private EditText mSearchEditText; private EditText mSearchEditText;
private TintedImageButton mClearTextButton; private TintedImageButton mClearTextButton;
private SearchDelegate mSearchDelegate; private SearchDelegate mSearchDelegate;
private boolean mIsLightTheme = true;
private boolean mSelectableListHasItems; private boolean mSelectableListHasItems;
private boolean mIsVrEnabled = false; private boolean mIsVrEnabled = false;
...@@ -158,7 +136,6 @@ public class SelectableListToolbar<E> ...@@ -158,7 +136,6 @@ public class SelectableListToolbar<E>
void destroy() { void destroy() {
mIsDestroyed = true; mIsDestroyed = true;
if (mSelectionDelegate != null) mSelectionDelegate.removeObserver(this); if (mSelectionDelegate != null) mSelectionDelegate.removeObserver(this);
mObservers.clear();
UiUtils.hideKeyboard(mSearchEditText); UiUtils.hideKeyboard(mSearchEditText);
VrShellDelegate.unregisterVrModeObserver(this); VrShellDelegate.unregisterVrModeObserver(this);
} }
...@@ -430,7 +407,6 @@ public class SelectableListToolbar<E> ...@@ -430,7 +407,6 @@ public class SelectableListToolbar<E>
mSelectionDelegate.clearSelection(); mSelectionDelegate.clearSelection();
showSearchViewInternal(); showSearchViewInternal();
for (SelectableListToolbarObserver o : mObservers) o.onStartSearch();
mSearchEditText.requestFocus(); mSearchEditText.requestFocus();
UiUtils.showKeyboard(mSearchEditText); UiUtils.showKeyboard(mSearchEditText);
...@@ -562,20 +538,6 @@ public class SelectableListToolbar<E> ...@@ -562,20 +538,6 @@ public class SelectableListToolbar<E>
return mSelectionDelegate; return mSelectionDelegate;
} }
/**
* @return Whether or not the toolbar is currently using a light theme.
*/
public boolean isLightTheme() {
return mIsLightTheme;
}
/**
* @param observer The observer to add to this toolbar.
*/
public void addObserver(SelectableListToolbarObserver observer) {
mObservers.addObserver(observer);
}
/** /**
* Set up ActionBarDrawerToggle, a.k.a. hamburger button. * Set up ActionBarDrawerToggle, a.k.a. hamburger button.
*/ */
...@@ -606,7 +568,6 @@ public class SelectableListToolbar<E> ...@@ -606,7 +568,6 @@ public class SelectableListToolbar<E>
mNumberRollView.setVisibility(View.GONE); mNumberRollView.setVisibility(View.GONE);
mNumberRollView.setNumber(0, false); mNumberRollView.setNumber(0, false);
onThemeChanged(true);
updateDisplayStyleIfNecessary(); updateDisplayStyleIfNecessary();
} }
...@@ -623,7 +584,6 @@ public class SelectableListToolbar<E> ...@@ -623,7 +584,6 @@ public class SelectableListToolbar<E>
if (mIsSearching) UiUtils.hideKeyboard(mSearchEditText); if (mIsSearching) UiUtils.hideKeyboard(mSearchEditText);
onThemeChanged(false);
updateDisplayStyleIfNecessary(); updateDisplayStyleIfNecessary();
} }
...@@ -640,7 +600,6 @@ public class SelectableListToolbar<E> ...@@ -640,7 +600,6 @@ public class SelectableListToolbar<E>
setBackgroundColor(mSearchBackgroundColor); setBackgroundColor(mSearchBackgroundColor);
} }
onThemeChanged(true);
updateDisplayStyleIfNecessary(); updateDisplayStyleIfNecessary();
} }
...@@ -660,15 +619,6 @@ public class SelectableListToolbar<E> ...@@ -660,15 +619,6 @@ public class SelectableListToolbar<E>
mNumberRollView.setNumber(selectedItems.size(), true); mNumberRollView.setNumber(selectedItems.size(), true);
} }
/**
* Update internal state and notify observers that the theme color changed.
* @param isLightTheme Whether or not the theme color is light.
*/
private void onThemeChanged(boolean isLightTheme) {
mIsLightTheme = isLightTheme;
for (SelectableListToolbarObserver o : mObservers) o.onThemeColorChanged(isLightTheme);
}
private void updateDisplayStyleIfNecessary() { private void updateDisplayStyleIfNecessary() {
if (mUiConfig != null) onDisplayStyleChanged(mUiConfig.getCurrentDisplayStyle()); if (mUiConfig != null) onDisplayStyleChanged(mUiConfig.getCurrentDisplayStyle());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment