Commit 0f8f5b47 authored by tmdiep@chromium.org's avatar tmdiep@chromium.org

Fixed incorrect frame insets for app windows on ChromeOS

HeaderPainter::GetWindowBoundsForClientBounds() shifts the Y
coordinate of the window bounds to ensure it is not negative.
This causes NativeAppWindowViews::GetFrameInsets() to compute
the wrong insets.

Therefore we should leave the Y coordinate of the window bounds
negative in HeaderPainter::GetWindowBoundsForClientBounds().

BUG=349220
TEST=browser_tests (AppWindowBrowserTest.*)

Review URL: https://codereview.chromium.org/180803013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255878 0039d316-1c4b-4281-b951-d872f2087c98
parent aa051274
...@@ -13,10 +13,10 @@ namespace { ...@@ -13,10 +13,10 @@ namespace {
typedef extensions::PlatformAppBrowserTest AppWindowBrowserTest; typedef extensions::PlatformAppBrowserTest AppWindowBrowserTest;
#if defined(OS_WIN) || defined(OS_MACOSX) #if defined(TOOLKIT_GTK)
#define MAYBE_FrameInsetsForDefaultFrame FrameInsetsForDefaultFrame
#else
#define MAYBE_FrameInsetsForDefaultFrame DISABLED_FrameInsetsForDefaultFrame #define MAYBE_FrameInsetsForDefaultFrame DISABLED_FrameInsetsForDefaultFrame
#else
#define MAYBE_FrameInsetsForDefaultFrame FrameInsetsForDefaultFrame
#endif #endif
// Verifies that the NativeAppWindows implement GetFrameInsets() correctly. // Verifies that the NativeAppWindows implement GetFrameInsets() correctly.
...@@ -33,10 +33,10 @@ IN_PROC_BROWSER_TEST_F(AppWindowBrowserTest, MAYBE_FrameInsetsForDefaultFrame) { ...@@ -33,10 +33,10 @@ IN_PROC_BROWSER_TEST_F(AppWindowBrowserTest, MAYBE_FrameInsetsForDefaultFrame) {
CloseAppWindow(app_window); CloseAppWindow(app_window);
} }
#if defined(OS_WIN) || defined(OS_MACOSX) #if defined(TOOLKIT_GTK)
#define MAYBE_FrameInsetsForColoredFrame FrameInsetsForColoredFrame
#else
#define MAYBE_FrameInsetsForColoredFrame DISABLED_FrameInsetsForColoredFrame #define MAYBE_FrameInsetsForColoredFrame DISABLED_FrameInsetsForColoredFrame
#else
#define MAYBE_FrameInsetsForColoredFrame FrameInsetsForColoredFrame
#endif #endif
// Verifies that the NativeAppWindows implement GetFrameInsets() correctly. // Verifies that the NativeAppWindows implement GetFrameInsets() correctly.
......
...@@ -185,8 +185,6 @@ gfx::Rect HeaderPainter::GetWindowBoundsForClientBounds( ...@@ -185,8 +185,6 @@ gfx::Rect HeaderPainter::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) { const gfx::Rect& client_bounds) {
gfx::Rect window_bounds(client_bounds); gfx::Rect window_bounds(client_bounds);
window_bounds.Inset(0, -header_height, 0, 0); window_bounds.Inset(0, -header_height, 0, 0);
if (window_bounds.y() < 0)
window_bounds.set_y(0);
return window_bounds; return window_bounds;
} }
......
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