Commit 5becfacf authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Fix Ash app title bar color being blue instead of grey

The color of Ash app window title bar was changed to
the same color of the settings app title bar accidentally in
https://chromium-review.googlesource.com/c/chromium/src/+/1125512.
This changed DevTools, the Terminal and Chrome App windows to be blue.

This CL fixes the unintentional change in behavior by updating
UpdateFrameColors() to use the same guard as CreateFrameHeader() when
setting the frame color to kMdWebUiFrameColor.

Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=359594&signed_aid=Yr-u3b9GUhWb0iEc6igy5Q==&inline=1
After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=359595&signed_aid=rfGnleo9Sj8jmcVXfDipeg==&inline=1

Bug: 879851
Change-Id: I8980b7f52f529390938a1a5ff05742b336e665d2
Reviewed-on: https://chromium-review.googlesource.com/1223951
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593802}
parent 98f5ccd8
...@@ -1008,7 +1008,7 @@ void BrowserNonClientFrameViewAsh::UpdateFrameColors() { ...@@ -1008,7 +1008,7 @@ void BrowserNonClientFrameViewAsh::UpdateFrameColors() {
active_color = active_color =
browser_view()->browser()->hosted_app_controller()->GetThemeColor(); browser_view()->browser()->hosted_app_controller()->GetThemeColor();
window->SetProperty(ash::kFrameIsThemedByHostedAppKey, !!active_color); window->SetProperty(ash::kFrameIsThemedByHostedAppKey, !!active_color);
} else { } else if (!browser_view()->browser()->is_app()) {
active_color = kMdWebUiFrameColor; active_color = kMdWebUiFrameColor;
} }
......
...@@ -1187,6 +1187,26 @@ IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTest, ...@@ -1187,6 +1187,26 @@ IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTest,
EXPECT_FALSE(frame_view2->caption_button_container_->visible()); EXPECT_FALSE(frame_view2->caption_button_container_->visible());
} }
// Regression test for https://crbug.com/879851.
// Tests that we don't accidentally change the color of app frame title bars.
// Update expectation if change is intentional.
IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTest, AppFrameColor) {
browser()->window()->Close();
// Open a new app window.
Browser* app_browser = new Browser(Browser::CreateParams::CreateForApp(
"test_browser_app", true /* trusted_source */, gfx::Rect(),
browser()->profile(), true /* user_gesture */));
aura::Window* window = app_browser->window()->GetNativeWindow();
window->Show();
SkColor active_frame_color = window->GetProperty(ash::kFrameActiveColorKey);
EXPECT_EQ(active_frame_color, SkColorSetRGB(253, 254, 255))
<< "RGB: " << SkColorGetR(active_frame_color) << ", "
<< SkColorGetG(active_frame_color) << ", "
<< SkColorGetB(active_frame_color);
}
IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTest, IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewAshTest,
ImmersiveModeTopViewInset) { ImmersiveModeTopViewInset) {
browser()->window()->Close(); browser()->window()->Close();
......
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