Commit 7b19e05f authored by Yulun Wu's avatar Yulun Wu Committed by Chromium LUCI CQ

Update tablet mode themed colors for suggestion chip and search box.

Bug: 1156265
Change-Id: Ie422fd32cf651b6e0524425c7eae7f10f56271e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577894Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834829}
parent 1a02906a
......@@ -5,11 +5,23 @@
#include "ash/app_list/app_list_color_provider_impl.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/shell.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/default_colors.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
namespace ash {
namespace {
// Helper to check if tablet mode is enabled.
bool IsTabletModeEnabled() {
return Shell::Get()->tablet_mode_controller() &&
Shell::Get()->tablet_mode_controller()->InTabletMode();
}
} // namespace
AppListColorProviderImpl::AppListColorProviderImpl()
: ash_color_provider_(AshColorProvider::Get()) {}
......@@ -39,6 +51,12 @@ SkColor AppListColorProviderImpl::GetAppListBackgroundColor() const {
}
SkColor AppListColorProviderImpl::GetSearchBoxBackgroundColor() const {
if (IsTabletModeEnabled()) {
return DeprecatedGetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80,
/*default_color*/ SK_ColorWHITE);
}
return DeprecatedGetControlsLayerColor(
AshColorProvider::ControlsLayerType::kControlBackgroundColorInactive,
SK_ColorWHITE);
......@@ -69,6 +87,12 @@ SkColor AppListColorProviderImpl::GetSearchBoxSecondaryTextColor(
}
SkColor AppListColorProviderImpl::GetSuggestionChipBackgroundColor() const {
if (IsTabletModeEnabled()) {
return DeprecatedGetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80,
/*default_color*/ SkColorSetA(gfx::kGoogleGrey100, 0x14));
}
return DeprecatedGetControlsLayerColor(
AshColorProvider::ControlsLayerType::kControlBackgroundColorInactive,
/*default_color*/ SkColorSetA(gfx::kGoogleGrey100, 0x14));
......
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