forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL updates hosted app windows on Mac to paint the site's theme colour and include the hosted app menu button and permission icons. This change is hidden behind the kDesktopPWAWindowing flag. Before: https://bugs.chromium.org/p/chromium/issues/attachment?aid=363793&signed_aid=_Z4yIZ_JlJC81IRgR-cUrA==&inline=1 After: https://bugs.chromium.org/p/chromium/issues/attachment?aid=363794&signed_aid=hHrKili6tqk3XTdQPfWLiQ==&inline=1 Bug: 895690 Change-Id: I7753b5119f165dab9573cc35f6d56cafb1ccfdb8 Reviewed-on: https://chromium-review.googlesource.com/c/1290057 Commit-Queue: Alan Cutter <alancutter@chromium.org> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org> Cr-Commit-Position: refs/heads/master@{#601443}
- Loading branch information
1 parent
06696fa
commit 2f84adc
Showing
7 changed files
with
168 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
chrome/browser/ui/views/frame/browser_non_client_frame_view_mac_unittest.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.h" | ||
|
||
#include "base/strings/stringprintf.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
TEST(BrowserNonClientFrameViewMacTest, GetCenteredTitleBounds) { | ||
struct { | ||
int frame_width; | ||
int frame_height; | ||
int left_inset_x; | ||
int right_inset_x; | ||
int title_width; | ||
int expected_title_x; | ||
int expected_title_width; | ||
} test_cases[] = { | ||
{800, 40, 0, 800, 400, 200, 400}, {800, 40, 100, 700, 400, 200, 400}, | ||
{800, 40, 250, 550, 400, 250, 300}, {800, 40, 350, 450, 400, 350, 100}, | ||
{800, 40, 100, 700, 400, 200, 400}, {800, 40, 250, 700, 400, 250, 400}, | ||
{800, 40, 350, 700, 400, 350, 350}, {800, 40, 650, 700, 400, 650, 50}, | ||
{800, 40, 100, 700, 400, 200, 400}, {800, 40, 100, 550, 400, 150, 400}, | ||
{800, 40, 100, 450, 400, 100, 350}, {800, 40, 100, 150, 400, 100, 50}, | ||
}; | ||
|
||
int index = 0; | ||
for (const auto& test_case : test_cases) { | ||
SCOPED_TRACE(base::StringPrintf("\nTest case index: %d", index)); | ||
gfx::Rect title_bounds = | ||
BrowserNonClientFrameViewMac::GetCenteredTitleBounds( | ||
test_case.frame_width, test_case.frame_height, | ||
test_case.left_inset_x, test_case.right_inset_x, | ||
test_case.title_width); | ||
gfx::Rect expected_title_bounds = | ||
gfx::Rect(test_case.expected_title_x, 0, test_case.expected_title_width, | ||
test_case.frame_height); | ||
EXPECT_EQ(title_bounds, expected_title_bounds); | ||
index++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters