Commit 6fd2d9fe authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Toolbar: Move CustomTabToolbar to customtabs/features/toolbar

Class CustomToolbar inherits ToolbarLayout for the layout for
Custom Tab Toolbar. It also provides an implementation of
LocationBar interface used in omnibox. The concrete
implementation classes for Custom Tab don't necessarily have
to be a part of toolbar/. This CL moves the class to
customtab/features/toolbar where other implementation of Custom
Tab features are placed. This also helps reduce the outbound
dependencies the class brought in to toolbar/.

Bug: 1127732
Change-Id: I32a0d556a979d213293dd46aea5ff51afa966dcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426155
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811071}
parent 83c3d7bd
...@@ -474,6 +474,8 @@ chrome_java_sources = [ ...@@ -474,6 +474,8 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/customtabs/features/CustomTabNavigationBarController.java", "java/src/org/chromium/chrome/browser/customtabs/features/CustomTabNavigationBarController.java",
"java/src/org/chromium/chrome/browser/customtabs/features/ImmersiveModeController.java", "java/src/org/chromium/chrome/browser/customtabs/features/ImmersiveModeController.java",
"java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabBrowserControlsVisibilityDelegate.java", "java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabBrowserControlsVisibilityDelegate.java",
"java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java",
"java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarAnimationDelegate.java",
"java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarColorController.java", "java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarColorController.java",
"java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarCoordinator.java", "java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarCoordinator.java",
"java/src/org/chromium/chrome/browser/database/SQLiteCursor.java", "java/src/org/chromium/chrome/browser/database/SQLiteCursor.java",
...@@ -1577,8 +1579,6 @@ chrome_java_sources = [ ...@@ -1577,8 +1579,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonProperties.java", "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonProperties.java",
"java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonViewBinder.java", "java/src/org/chromium/chrome/browser/toolbar/menu_button/MenuButtonViewBinder.java",
"java/src/org/chromium/chrome/browser/toolbar/top/ActionModeController.java", "java/src/org/chromium/chrome/browser/toolbar/top/ActionModeController.java",
"java/src/org/chromium/chrome/browser/toolbar/top/CustomTabToolbar.java",
"java/src/org/chromium/chrome/browser/toolbar/top/CustomTabToolbarAnimationDelegate.java",
"java/src/org/chromium/chrome/browser/toolbar/top/IncognitoSwitchCoordinator.java", "java/src/org/chromium/chrome/browser/toolbar/top/IncognitoSwitchCoordinator.java",
"java/src/org/chromium/chrome/browser/toolbar/top/IncognitoSwitchProperties.java", "java/src/org/chromium/chrome/browser/toolbar/top/IncognitoSwitchProperties.java",
"java/src/org/chromium/chrome/browser/toolbar/top/IncognitoSwitchViewBinder.java", "java/src/org/chromium/chrome/browser/toolbar/top/IncognitoSwitchViewBinder.java",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<org.chromium.chrome.browser.toolbar.top.CustomTabToolbar <org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar" android:id="@+id/toolbar"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
android:visibility="invisible" android:visibility="invisible"
app:tint="@color/default_icon_color_tint_list" /> app:tint="@color/default_icon_color_tint_list" />
<view <view
class="org.chromium.chrome.browser.toolbar.top.CustomTabToolbar$InterceptTouchLayout" class="org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar$InterceptTouchLayout"
android:id="@+id/title_url_container" android:id="@+id/title_url_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -117,4 +117,4 @@ ...@@ -117,4 +117,4 @@
app:tint="@color/default_icon_color_tint_list" /> app:tint="@color/default_icon_color_tint_list" />
</org.chromium.chrome.browser.toolbar.menu_button.MenuButton> </org.chromium.chrome.browser.toolbar.menu_button.MenuButton>
</org.chromium.chrome.browser.toolbar.top.CustomTabToolbar> </org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar>
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.chrome.browser.toolbar.top; package org.chromium.chrome.browser.customtabs.features.toolbar;
import android.animation.Animator; import android.animation.Animator;
import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener; import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.Configuration; import android.content.res.Configuration;
...@@ -68,6 +69,9 @@ import org.chromium.chrome.browser.toolbar.ToolbarColors; ...@@ -68,6 +69,9 @@ import org.chromium.chrome.browser.toolbar.ToolbarColors;
import org.chromium.chrome.browser.toolbar.ToolbarDataProvider; import org.chromium.chrome.browser.toolbar.ToolbarDataProvider;
import org.chromium.chrome.browser.toolbar.ToolbarTabController; import org.chromium.chrome.browser.toolbar.ToolbarTabController;
import org.chromium.chrome.browser.toolbar.menu_button.MenuButtonCoordinator; import org.chromium.chrome.browser.toolbar.menu_button.MenuButtonCoordinator;
import org.chromium.chrome.browser.toolbar.top.ToolbarActionModeCallback;
import org.chromium.chrome.browser.toolbar.top.ToolbarLayout;
import org.chromium.chrome.browser.toolbar.top.ToolbarPhone;
import org.chromium.chrome.browser.ui.native_page.NativePage; import org.chromium.chrome.browser.ui.native_page.NativePage;
import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.browser_ui.styles.ChromeColors;
import org.chromium.components.browser_ui.widget.TintedDrawable; import org.chromium.components.browser_ui.widget.TintedDrawable;
...@@ -124,6 +128,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -124,6 +128,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
@SuppressLint("ClickableViewAccessibility")
public boolean onTouchEvent(MotionEvent event) { public boolean onTouchEvent(MotionEvent event) {
mGestureDetector.onTouchEvent(event); mGestureDetector.onTouchEvent(event);
return super.onTouchEvent(event); return super.onTouchEvent(event);
...@@ -211,8 +216,8 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -211,8 +216,8 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
void initialize(ToolbarDataProvider toolbarDataProvider, ToolbarTabController tabController, protected void initialize(ToolbarDataProvider toolbarDataProvider,
MenuButtonCoordinator menuButtonCoordinator) { ToolbarTabController tabController, MenuButtonCoordinator menuButtonCoordinator) {
super.initialize(toolbarDataProvider, tabController, menuButtonCoordinator); super.initialize(toolbarDataProvider, tabController, menuButtonCoordinator);
mLocationBar.setToolbarDataProvider(toolbarDataProvider); mLocationBar.setToolbarDataProvider(toolbarDataProvider);
mLocationBar.updateVisualsForState(); mLocationBar.updateVisualsForState();
...@@ -225,7 +230,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -225,7 +230,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
void setCloseButtonImageResource(Drawable drawable) { protected void setCloseButtonImageResource(Drawable drawable) {
mCloseButton.setVisibility(drawable != null ? View.VISIBLE : View.GONE); mCloseButton.setVisibility(drawable != null ? View.VISIBLE : View.GONE);
mCloseButton.setImageDrawable(drawable); mCloseButton.setImageDrawable(drawable);
if (drawable != null) { if (drawable != null) {
...@@ -234,12 +239,13 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -234,12 +239,13 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
void setCustomTabCloseClickHandler(OnClickListener listener) { protected void setCustomTabCloseClickHandler(OnClickListener listener) {
mCloseButton.setOnClickListener(listener); mCloseButton.setOnClickListener(listener);
} }
@Override @Override
void addCustomActionButton(Drawable drawable, String description, OnClickListener listener) { protected void addCustomActionButton(
Drawable drawable, String description, OnClickListener listener) {
ImageButton button = (ImageButton) LayoutInflater.from(getContext()) ImageButton button = (ImageButton) LayoutInflater.from(getContext())
.inflate(R.layout.custom_tabs_toolbar_button, null); .inflate(R.layout.custom_tabs_toolbar_button, null);
button.setOnLongClickListener(this); button.setOnLongClickListener(this);
...@@ -253,7 +259,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -253,7 +259,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
void updateCustomActionButton(int index, Drawable drawable, String description) { protected void updateCustomActionButton(int index, Drawable drawable, String description) {
ImageButton button = (ImageButton) mCustomActionButtons.getChildAt( ImageButton button = (ImageButton) mCustomActionButtons.getChildAt(
mCustomActionButtons.getChildCount() - 1 - index); mCustomActionButtons.getChildCount() - 1 - index);
assert button != null; assert button != null;
...@@ -292,7 +298,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -292,7 +298,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
int getTabStripHeight() { protected int getTabStripHeight() {
return 0; return 0;
} }
...@@ -336,7 +342,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -336,7 +342,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
String getContentPublisher() { protected String getContentPublisher() {
Tab tab = getToolbarDataProvider().getTab(); Tab tab = getToolbarDataProvider().getTab();
if (tab == null) return null; if (tab == null) return null;
...@@ -350,7 +356,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -350,7 +356,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
void onNavigatedToDifferentPage() { protected void onNavigatedToDifferentPage() {
super.onNavigatedToDifferentPage(); super.onNavigatedToDifferentPage();
mLocationBar.setTitleToPageTitle(); mLocationBar.setTitleToPageTitle();
if (mState == STATE_TITLE_ONLY) { if (mState == STATE_TITLE_ONLY) {
...@@ -406,7 +412,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -406,7 +412,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
* for the current tab changing. * for the current tab changing.
*/ */
@Override @Override
void onPrimaryColorChanged(boolean shouldAnimate) { protected void onPrimaryColorChanged(boolean shouldAnimate) {
if (mBrandColorTransitionActive) mBrandColorTransitionAnimation.cancel(); if (mBrandColorTransitionActive) mBrandColorTransitionAnimation.cancel();
final ColorDrawable background = getBackground(); final ColorDrawable background = getBackground();
...@@ -559,7 +565,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL ...@@ -559,7 +565,7 @@ public class CustomTabToolbar extends ToolbarLayout implements View.OnLongClickL
} }
@Override @Override
void onMenuButtonDisabled() { protected void onMenuButtonDisabled() {
super.onMenuButtonDisabled(); super.onMenuButtonDisabled();
// In addition to removing the menu button, we also need to remove the margin on the custom // In addition to removing the menu button, we also need to remove the margin on the custom
// action button. // action button.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
package org.chromium.chrome.browser.toolbar.top; package org.chromium.chrome.browser.customtabs.features.toolbar;
import android.animation.Animator; import android.animation.Animator;
import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorListenerAdapter;
......
...@@ -81,7 +81,6 @@ import org.chromium.chrome.browser.toolbar.load_progress.LoadProgressCoordinator ...@@ -81,7 +81,6 @@ import org.chromium.chrome.browser.toolbar.load_progress.LoadProgressCoordinator
import org.chromium.chrome.browser.toolbar.menu_button.MenuButtonCoordinator; import org.chromium.chrome.browser.toolbar.menu_button.MenuButtonCoordinator;
import org.chromium.chrome.browser.toolbar.top.ActionModeController; import org.chromium.chrome.browser.toolbar.top.ActionModeController;
import org.chromium.chrome.browser.toolbar.top.ActionModeController.ActionBarDelegate; import org.chromium.chrome.browser.toolbar.top.ActionModeController.ActionBarDelegate;
import org.chromium.chrome.browser.toolbar.top.CustomTabToolbar;
import org.chromium.chrome.browser.toolbar.top.TabSwitcherActionMenuCoordinator; import org.chromium.chrome.browser.toolbar.top.TabSwitcherActionMenuCoordinator;
import org.chromium.chrome.browser.toolbar.top.Toolbar; import org.chromium.chrome.browser.toolbar.top.Toolbar;
import org.chromium.chrome.browser.toolbar.top.ToolbarActionModeCallback; import org.chromium.chrome.browser.toolbar.top.ToolbarActionModeCallback;
...@@ -310,8 +309,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve ...@@ -310,8 +309,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve
-> setUrlBarFocus(focus, type), -> setUrlBarFocus(focus, type),
mActivity.getCompositorViewHolder()::requestFocus, shouldShowUpdateBadge, mActivity.getCompositorViewHolder()::requestFocus, shouldShowUpdateBadge,
mActivity::isInOverviewMode, mActivity::isInOverviewMode,
toolbarLayout instanceof CustomTabToolbar ? mAppThemeColorProvider mActivity.isCustomTab() ? mAppThemeColorProvider : browsingModeThemeColorProvider,
: browsingModeThemeColorProvider,
R.id.menu_button_wrapper); R.id.menu_button_wrapper);
MenuButtonCoordinator startSurfaceMenuButtonCoordinator = new MenuButtonCoordinator( MenuButtonCoordinator startSurfaceMenuButtonCoordinator = new MenuButtonCoordinator(
appMenuCoordinatorSupplier, mControlsVisibilityDelegate, mActivity, appMenuCoordinatorSupplier, mControlsVisibilityDelegate, mActivity,
......
...@@ -112,8 +112,8 @@ public abstract class ToolbarLayout ...@@ -112,8 +112,8 @@ public abstract class ToolbarLayout
* @param menuButtonCoordinator Coordinator for interacting with the MenuButton. * @param menuButtonCoordinator Coordinator for interacting with the MenuButton.
*/ */
@CallSuper @CallSuper
void initialize(ToolbarDataProvider toolbarDataProvider, ToolbarTabController tabController, protected void initialize(ToolbarDataProvider toolbarDataProvider,
MenuButtonCoordinator menuButtonCoordinator) { ToolbarTabController tabController, MenuButtonCoordinator menuButtonCoordinator) {
mToolbarDataProvider = toolbarDataProvider; mToolbarDataProvider = toolbarDataProvider;
mToolbarTabController = tabController; mToolbarTabController = tabController;
mMenuButtonCoordinator = menuButtonCoordinator; mMenuButtonCoordinator = menuButtonCoordinator;
...@@ -202,7 +202,7 @@ public abstract class ToolbarLayout ...@@ -202,7 +202,7 @@ public abstract class ToolbarLayout
* TODO comment * TODO comment
*/ */
@CallSuper @CallSuper
void onMenuButtonDisabled() {} protected void onMenuButtonDisabled() {}
@Override @Override
protected void onFinishInflate() { protected void onFinishInflate() {
...@@ -330,7 +330,7 @@ public abstract class ToolbarLayout ...@@ -330,7 +330,7 @@ public abstract class ToolbarLayout
/** /**
* This function handles native dependent initialization for this class. * This function handles native dependent initialization for this class.
*/ */
void onNativeLibraryReady() { protected void onNativeLibraryReady() {
mNativeLibraryReady = true; mNativeLibraryReady = true;
if (mProgressBar.getParent() != null) mProgressBar.initializeAnimation(); if (mProgressBar.getParent() != null) mProgressBar.initializeAnimation();
} }
...@@ -359,7 +359,7 @@ public abstract class ToolbarLayout ...@@ -359,7 +359,7 @@ public abstract class ToolbarLayout
/** /**
* @return The {@link ProgressBar} this layout uses. * @return The {@link ProgressBar} this layout uses.
*/ */
ToolbarProgressBar getProgressBar() { protected ToolbarProgressBar getProgressBar() {
return mProgressBar; return mProgressBar;
} }
...@@ -457,18 +457,18 @@ public abstract class ToolbarLayout ...@@ -457,18 +457,18 @@ public abstract class ToolbarLayout
* Sets the OnClickListener to notify when the close button is pressed in a custom tab. * Sets the OnClickListener to notify when the close button is pressed in a custom tab.
* @param listener The callback that will be notified when the close button is pressed. * @param listener The callback that will be notified when the close button is pressed.
*/ */
void setCustomTabCloseClickHandler(OnClickListener listener) {} protected void setCustomTabCloseClickHandler(OnClickListener listener) {}
/** /**
* Sets whether the urlbar should be hidden on first page load. * Sets whether the urlbar should be hidden on first page load.
*/ */
void setUrlBarHidden(boolean hide) {} protected void setUrlBarHidden(boolean hide) {}
/** /**
* @return The name of the publisher of the content if it can be reliably extracted, or null * @return The name of the publisher of the content if it can be reliably extracted, or null
* otherwise. * otherwise.
*/ */
String getContentPublisher() { protected String getContentPublisher() {
return null; return null;
} }
...@@ -545,13 +545,13 @@ public abstract class ToolbarLayout ...@@ -545,13 +545,13 @@ public abstract class ToolbarLayout
* For extending classes to override and carry out the changes related with the primary color * For extending classes to override and carry out the changes related with the primary color
* for the current tab changing. * for the current tab changing.
*/ */
void onPrimaryColorChanged(boolean shouldAnimate) {} protected void onPrimaryColorChanged(boolean shouldAnimate) {}
/** /**
* Sets the icon drawable that the close button in the toolbar (if any) should show, or hides * Sets the icon drawable that the close button in the toolbar (if any) should show, or hides
* it if {@code drawable} is {@code null}. * it if {@code drawable} is {@code null}.
*/ */
void setCloseButtonImageResource(@Nullable Drawable drawable) {} protected void setCloseButtonImageResource(@Nullable Drawable drawable) {}
/** /**
* Adds a custom action button to the toolbar layout, if it is supported. * Adds a custom action button to the toolbar layout, if it is supported.
...@@ -559,7 +559,8 @@ public abstract class ToolbarLayout ...@@ -559,7 +559,8 @@ public abstract class ToolbarLayout
* @param description The content description for the button. * @param description The content description for the button.
* @param listener The {@link OnClickListener} to use for clicks to the button. * @param listener The {@link OnClickListener} to use for clicks to the button.
*/ */
void addCustomActionButton(Drawable drawable, String description, OnClickListener listener) { protected void addCustomActionButton(
Drawable drawable, String description, OnClickListener listener) {
// This method should only be called for subclasses that override it. // This method should only be called for subclasses that override it.
assert false; assert false;
} }
...@@ -571,7 +572,7 @@ public abstract class ToolbarLayout ...@@ -571,7 +572,7 @@ public abstract class ToolbarLayout
* @param drawable The icon for the button. * @param drawable The icon for the button.
* @param description The content description for the button. * @param description The content description for the button.
*/ */
void updateCustomActionButton(int index, Drawable drawable, String description) { protected void updateCustomActionButton(int index, Drawable drawable, String description) {
// This method should only be called for subclasses that override it. // This method should only be called for subclasses that override it.
assert false; assert false;
} }
...@@ -579,7 +580,7 @@ public abstract class ToolbarLayout ...@@ -579,7 +580,7 @@ public abstract class ToolbarLayout
/** /**
* @return The height of the tab strip. Return 0 for toolbars that do not have a tabstrip. * @return The height of the tab strip. Return 0 for toolbars that do not have a tabstrip.
*/ */
int getTabStripHeight() { protected int getTabStripHeight() {
return getResources().getDimensionPixelSize(R.dimen.tab_strip_height); return getResources().getDimensionPixelSize(R.dimen.tab_strip_height);
} }
...@@ -700,7 +701,7 @@ public abstract class ToolbarLayout ...@@ -700,7 +701,7 @@ public abstract class ToolbarLayout
/** /**
* Notified when a navigation to a different page has occurred. * Notified when a navigation to a different page has occurred.
*/ */
void onNavigatedToDifferentPage() {} protected void onNavigatedToDifferentPage() {}
/** /**
* Starts load progress. * Starts load progress.
...@@ -752,7 +753,7 @@ public abstract class ToolbarLayout ...@@ -752,7 +753,7 @@ public abstract class ToolbarLayout
/** /**
* @return Whether or not the toolbar is incognito. * @return Whether or not the toolbar is incognito.
*/ */
boolean isIncognito() { protected boolean isIncognito() {
return mToolbarDataProvider.isIncognito(); return mToolbarDataProvider.isIncognito();
} }
......
...@@ -452,7 +452,7 @@ public class ToolbarPhone extends ToolbarLayout ...@@ -452,7 +452,7 @@ public class ToolbarPhone extends ToolbarLayout
* Sets up click and key listeners once we have native library available to handle clicks. * Sets up click and key listeners once we have native library available to handle clicks.
*/ */
@Override @Override
void onNativeLibraryReady() { protected void onNativeLibraryReady() {
super.onNativeLibraryReady(); super.onNativeLibraryReady();
getLocationBar().onNativeLibraryReady(); getLocationBar().onNativeLibraryReady();
......
...@@ -496,8 +496,8 @@ public class ToolbarTablet extends ToolbarLayout ...@@ -496,8 +496,8 @@ public class ToolbarTablet extends ToolbarLayout
} }
@Override @Override
void initialize(ToolbarDataProvider toolbarDataProvider, ToolbarTabController tabController, protected void initialize(ToolbarDataProvider toolbarDataProvider,
MenuButtonCoordinator menuButtonCoordinator) { ToolbarTabController tabController, MenuButtonCoordinator menuButtonCoordinator) {
super.initialize(toolbarDataProvider, tabController, menuButtonCoordinator); super.initialize(toolbarDataProvider, tabController, menuButtonCoordinator);
menuButtonCoordinator.setVisibility(true); menuButtonCoordinator.setVisibility(true);
} }
......
...@@ -41,11 +41,11 @@ import org.chromium.base.test.util.CommandLineFlags; ...@@ -41,11 +41,11 @@ import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.DisabledTest;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.OnFinishedForTest; import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.OnFinishedForTest;
import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.incognito.IncognitoDataTestUtils; import org.chromium.chrome.browser.incognito.IncognitoDataTestUtils;
import org.chromium.chrome.browser.incognito.IncognitoNotificationService; import org.chromium.chrome.browser.incognito.IncognitoNotificationService;
import org.chromium.chrome.browser.toolbar.top.CustomTabToolbar;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.Features;
import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.browser_ui.styles.ChromeColors;
......
...@@ -92,6 +92,7 @@ import org.chromium.chrome.browser.browserservices.SessionDataHolder; ...@@ -92,6 +92,7 @@ import org.chromium.chrome.browser.browserservices.SessionDataHolder;
import org.chromium.chrome.browser.contextmenu.RevampedContextMenuCoordinator; import org.chromium.chrome.browser.contextmenu.RevampedContextMenuCoordinator;
import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.OnFinishedForTest; import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.OnFinishedForTest;
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigationController.FinishReason; import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigationController.FinishReason;
import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar;
import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.chrome.browser.firstrun.FirstRunStatus; import org.chromium.chrome.browser.firstrun.FirstRunStatus;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
...@@ -112,7 +113,6 @@ import org.chromium.chrome.browser.tab.TabTestUtils; ...@@ -112,7 +113,6 @@ import org.chromium.chrome.browser.tab.TabTestUtils;
import org.chromium.chrome.browser.tabmodel.TabModelObserver; import org.chromium.chrome.browser.tabmodel.TabModelObserver;
import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.test.ScreenShooter; import org.chromium.chrome.browser.test.ScreenShooter;
import org.chromium.chrome.browser.toolbar.top.CustomTabToolbar;
import org.chromium.chrome.browser.ui.appmenu.AppMenuCoordinator; import org.chromium.chrome.browser.ui.appmenu.AppMenuCoordinator;
import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler;
import org.chromium.chrome.browser.ui.appmenu.AppMenuTestSupport; import org.chromium.chrome.browser.ui.appmenu.AppMenuTestSupport;
......
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