OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/frame_painter.h" | 5 #include "ash/wm/frame_painter.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/property_util.h" | 10 #include "ash/wm/property_util.h" |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 return kInactiveWindowOpacity; | 667 return kInactiveWindowOpacity; |
668 } | 668 } |
669 | 669 |
670 int FramePainter::AdjustFrameHitCodeForMaximizedModes(int hit_code) { | 670 int FramePainter::AdjustFrameHitCodeForMaximizedModes(int hit_code) { |
671 if (hit_code != HTNOWHERE && wm::IsWindowNormal(window_) && | 671 if (hit_code != HTNOWHERE && wm::IsWindowNormal(window_) && |
672 GetRestoreBoundsInScreen(window_)) { | 672 GetRestoreBoundsInScreen(window_)) { |
673 // When there is a restore rectangle, a left/right maximized window might | 673 // When there is a restore rectangle, a left/right maximized window might |
674 // be active. | 674 // be active. |
675 const gfx::Rect& bounds = frame_->GetWindowBoundsInScreen(); | 675 const gfx::Rect& bounds = frame_->GetWindowBoundsInScreen(); |
676 const gfx::Rect& screen = | 676 const gfx::Rect& screen = |
677 gfx::Screen::GetDisplayMatching(bounds).work_area(); | 677 Shell::GetScreen()->GetDisplayMatching(bounds).work_area(); |
678 if (bounds.y() == screen.y() && bounds.bottom() == screen.bottom()) { | 678 if (bounds.y() == screen.y() && bounds.bottom() == screen.bottom()) { |
679 // The window is probably either left or right maximized. | 679 // The window is probably either left or right maximized. |
680 if (bounds.x() == screen.x()) { | 680 if (bounds.x() == screen.x()) { |
681 // It is left maximized and we can only allow a right resize. | 681 // It is left maximized and we can only allow a right resize. |
682 return (hit_code == HTBOTTOMRIGHT || | 682 return (hit_code == HTBOTTOMRIGHT || |
683 hit_code == HTTOPRIGHT || | 683 hit_code == HTTOPRIGHT || |
684 hit_code == HTRIGHT) ? HTRIGHT : HTNOWHERE; | 684 hit_code == HTRIGHT) ? HTRIGHT : HTNOWHERE; |
685 } else if (bounds.right() == screen.right()) { | 685 } else if (bounds.right() == screen.right()) { |
686 // It is right maximized and we can only allow a left resize. | 686 // It is right maximized and we can only allow a left resize. |
687 return (hit_code == HTBOTTOMLEFT || | 687 return (hit_code == HTBOTTOMLEFT || |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 int title_y = | 780 int title_y = |
781 (view->GetBoundsForClientView().y() - title_font.GetHeight()) / 2; | 781 (view->GetBoundsForClientView().y() - title_font.GetHeight()) / 2; |
782 return gfx::Rect( | 782 return gfx::Rect( |
783 title_x, | 783 title_x, |
784 std::max(0, title_y), | 784 std::max(0, title_y), |
785 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x), | 785 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x), |
786 title_font.GetHeight()); | 786 title_font.GetHeight()); |
787 } | 787 } |
788 | 788 |
789 } // namespace ash | 789 } // namespace ash |
OLD | NEW |