diff options
Diffstat (limited to 'chrome/browser/ui/views')
3 files changed, 7 insertions, 49 deletions
diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc index 098d27c..294fd2c 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc @@ -250,8 +250,10 @@ gfx::Rect AppNonClientFrameViewAura::GetControlBounds() const { if (!control_view_) return gfx::Rect(); gfx::Size preferred = control_view_->GetPreferredSize(); + gfx::Point location(width() - preferred.width(), 0); + ConvertPointToWidget(this, &location); return gfx::Rect( - width() - preferred.width(), 0, + location.x(), location.y(), preferred.width(), preferred.height()); } diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc index 52b1db7..46de1bf 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/wm/window_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" @@ -16,23 +15,18 @@ #include "ui/aura/root_window.h" #include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" -#include "ui/gfx/screen.h" using aura::Window; namespace { -Window* GetChildWindowNamed(Window* window, const char* name) { +bool HasChildWindowNamed(Window* window, const char* name) { for (size_t i = 0; i < window->children().size(); ++i) { Window* child = window->children()[i]; if (child->name() == name) - return child; + return true; } - return NULL; -} - -bool HasChildWindowNamed(Window* window, const char* name) { - return GetChildWindowNamed(window, name) != NULL; + return false; } } // namespace @@ -135,37 +129,3 @@ IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, SnapLeftClosesControls) { EXPECT_FALSE(HasChildWindowNamed( native_window, AppNonClientFrameViewAura::kControlWindowName)); } - -// Ensure that the controls are at the proper locations. -IN_PROC_BROWSER_TEST_F(AppNonClientFrameViewAuraTest, ControlsAtRightSide) { - const gfx::Rect work_area = gfx::Screen::GetPrimaryDisplay().work_area(); - - aura::RootWindow* root_window = GetRootWindow(); - aura::test::EventGenerator eg(root_window); - aura::Window* native_window = app_browser()->window()->GetNativeWindow(); - - // Control window exists. - aura::Window* window = GetChildWindowNamed( - native_window, AppNonClientFrameViewAura::kControlWindowName); - - ASSERT_TRUE(window); - gfx::Rect rect = window->bounds(); - EXPECT_EQ(work_area.right(), rect.right()); - EXPECT_EQ(work_area.y(), rect.y()); - - ash::wm::MinimizeWindow(native_window); - content::RunAllPendingInMessageLoop(); - window = GetChildWindowNamed( - native_window, AppNonClientFrameViewAura::kControlWindowName); - EXPECT_FALSE(window); - ash::wm::MaximizeWindow(native_window); - content::RunAllPendingInMessageLoop(); - - // Control window exists. - aura::Window* window_after = GetChildWindowNamed( - native_window, AppNonClientFrameViewAura::kControlWindowName); - ASSERT_TRUE(window_after); - gfx::Rect rect_after = window_after->bounds(); - EXPECT_EQ(work_area.right(), rect_after.right()); - EXPECT_EQ(work_area.y(), rect_after.y()); -} diff --git a/chrome/browser/ui/views/frame/browser_frame_aura.cc b/chrome/browser/ui/views/frame/browser_frame_aura.cc index 764e95b..1d3a7d8 100644 --- a/chrome/browser/ui/views/frame/browser_frame_aura.cc +++ b/chrome/browser/ui/views/frame/browser_frame_aura.cc @@ -62,11 +62,7 @@ class BrowserFrameAura::WindowPropertyWatcher : public aura::WindowObserver { // window's bounds are updated. The window maximize/restore animations // clone the window's layers and rely on the subsequent layout to set // the layer sizes. - // If the window is minimized, the frame view needs to be updated via - // an OnBoundsChanged event so that the frame will change its size - // properly. - browser_frame_->non_client_view()->UpdateFrame( - old_state == ui::SHOW_STATE_MINIMIZED); + browser_frame_->non_client_view()->UpdateFrame(false); } } |