Commit 07e4fc2f authored by gogerald's avatar gogerald Committed by Commit Bot

[StartSurface] Format and cleanup

Bug: 982018
Change-Id: I6d9bb134e4d98fbd7ebae7a889afd14f880dbfcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894139
Commit-Queue: Ganggui Tang <gogerald@chromium.org>
Auto-Submit: Ganggui Tang <gogerald@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711704}
parent c3d4d98a
...@@ -118,27 +118,33 @@ class StartSurfaceMediator ...@@ -118,27 +118,33 @@ class StartSurfaceMediator
}); });
mPropertyModel.set(IS_INCOGNITO, mIsIncognito); mPropertyModel.set(IS_INCOGNITO, mIsIncognito);
mPropertyModel.set( if (mSurfaceMode == SurfaceMode.TWO_PANES) {
BOTTOM_BAR_CLICKLISTENER, new StartSurfaceProperties.BottomBarClickListener() { mPropertyModel.set(BOTTOM_BAR_CLICKLISTENER,
// TODO(crbug.com/982018): Animate switching between explore and home new StartSurfaceProperties.BottomBarClickListener() {
// surface. // TODO(crbug.com/982018): Animate switching between explore and home
@Override // surface.
public void onHomeButtonClicked() { @Override
setExploreSurfaceVisibility(false); public void onHomeButtonClicked() {
notifyStateChange(); setExploreSurfaceVisibility(false);
RecordUserAction.record("StartSurface.TwoPanes.BottomBar.TapHome"); notifyStateChange();
} RecordUserAction.record("StartSurface.TwoPanes.BottomBar.TapHome");
}
@Override
public void onExploreButtonClicked() { @Override
// TODO(crbug.com/982018): Hide the Tab switcher toolbar when showing public void onExploreButtonClicked() {
// explore surface. // TODO(crbug.com/982018): Hide the Tab switcher toolbar when
setExploreSurfaceVisibility(true); // showing explore surface.
notifyStateChange(); setExploreSurfaceVisibility(true);
RecordUserAction.record( notifyStateChange();
"StartSurface.TwoPanes.BottomBar.TapExploreSurface"); RecordUserAction.record(
} "StartSurface.TwoPanes.BottomBar.TapExploreSurface");
}); }
});
mPropertyModel.set(BOTTOM_BAR_HEIGHT,
ContextUtils.getApplicationContext().getResources().getDimensionPixelSize(
R.dimen.ss_bottom_bar_height));
mPropertyModel.set(IS_BOTTOM_BAR_VISIBLE, !mIsIncognito);
}
if (mSurfaceMode == SurfaceMode.SINGLE_PANE) { if (mSurfaceMode == SurfaceMode.SINGLE_PANE) {
mPropertyModel.set(MORE_TABS_CLICK_LISTENER, this); mPropertyModel.set(MORE_TABS_CLICK_LISTENER, this);
...@@ -153,12 +159,6 @@ class StartSurfaceMediator ...@@ -153,12 +159,6 @@ class StartSurfaceMediator
|| ReturnToStartSurfaceUtil.shouldShowExploreSurface()) || ReturnToStartSurfaceUtil.shouldShowExploreSurface())
&& !mIsIncognito; && !mIsIncognito;
setExploreSurfaceVisibility(shouldShowExploreSurface); setExploreSurfaceVisibility(shouldShowExploreSurface);
if (mSurfaceMode == SurfaceMode.TWO_PANES) {
mPropertyModel.set(BOTTOM_BAR_HEIGHT,
ContextUtils.getApplicationContext().getResources().getDimensionPixelSize(
R.dimen.ss_bottom_bar_height));
mPropertyModel.set(IS_BOTTOM_BAR_VISIBLE, !mIsIncognito);
}
mPropertyModel.set(MV_TILES_VISIBLE, !mIsIncognito); mPropertyModel.set(MV_TILES_VISIBLE, !mIsIncognito);
// Note that isVoiceSearchEnabled will return false in incognito mode. // Note that isVoiceSearchEnabled will return false in incognito mode.
......
...@@ -76,8 +76,5 @@ class TasksSurfaceMediator { ...@@ -76,8 +76,5 @@ class TasksSurfaceMediator {
// Set the initial state. // Set the initial state.
mModel.set(IS_FAKE_SEARCH_BOX_VISIBLE, true); mModel.set(IS_FAKE_SEARCH_BOX_VISIBLE, true);
mModel.set(IS_VOICE_RECOGNITION_BUTTON_VISIBLE, false); mModel.set(IS_VOICE_RECOGNITION_BUTTON_VISIBLE, false);
// TODO(crbug.com/982018): Enable voice recognition button in the fake search box.
// TODO(crbug.com/982018): Change the fake search box in dark mode.
} }
} }
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