diff options
author | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-26 00:33:36 +0000 |
---|---|---|
committer | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-26 00:33:36 +0000 |
commit | 354d067ffae4fa3e6aca666684d76c6b68a64f49 (patch) | |
tree | 46fd35df6f8d49f94fbe5b58ddf3a16b38a4270f /chrome/browser/ui/views | |
parent | 0eeeba6d4db597c734ea84b299aa9ab138a13fdf (diff) | |
download | chromium_src-354d067ffae4fa3e6aca666684d76c6b68a64f49.zip chromium_src-354d067ffae4fa3e6aca666684d76c6b68a64f49.tar.gz chromium_src-354d067ffae4fa3e6aca666684d76c6b68a64f49.tar.bz2 |
Revert 158692 - Fixed problem with disappearing window controls for applications when maximizing / minimizing / maximizing
Reverted to link errors:
out/Release/../../third_party/gold/gold32: out/Release/obj.target/browser_tests/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.o: in function AppNonClientFrameViewAuraTest_ControlsAtRightSide_Test::RunTestOnMainThread():app_non_client_frame_view_aura_browsertest.cc(.text._ZN54AppNonClientFrameViewAuraTest_ControlsAtRightSide_Test19RunTestOnMainThreadEv+0x5ab): error: undefined reference to 'ash::wm::MinimizeWindow(aura::Window*)'
out/Release/../../third_party/gold/gold32: out/Release/obj.target/browser_tests/chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.o: in function AppNonClientFrameViewAuraTest_ControlsAtRightSide_Test::RunTestOnMainThread():app_non_client_frame_view_aura_browsertest.cc(.text._ZN54AppNonClientFrameViewAuraTest_ControlsAtRightSide_Test19RunTestOnMainThreadEv+0x5dc): error: undefined reference to 'ash::wm::MaximizeWindow(aura::Window*)'
BUG=151632
TEST=unit test to see that the locations of the controls are always at the right side of the screen
Review URL: https://chromiumcodereview.appspot.com/10986003
TBR=skuhne@chromium.org
Review URL: https://codereview.chromium.org/10986040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158700 0039d316-1c4b-4281-b951-d872f2087c98
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); } } |