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 "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 close_button_->SetVisible(false); | 971 close_button_->SetVisible(false); |
972 // Set the bounds of the minimize button so that we don't have to change | 972 // Set the bounds of the minimize button so that we don't have to change |
973 // other places that rely on the bounds. Put it slightly to the right | 973 // other places that rely on the bounds. Put it slightly to the right |
974 // of the edge of the view, so that when we remove the spacing it lines | 974 // of the edge of the view, so that when we remove the spacing it lines |
975 // up with the edge. | 975 // up with the edge. |
976 minimize_button_->SetBounds(width() - FrameBorderThickness(false) + | 976 minimize_button_->SetBounds(width() - FrameBorderThickness(false) + |
977 kNewTabCaptionMaximizedSpacing, 0, 0, 0); | 977 kNewTabCaptionMaximizedSpacing, 0, 0, 0); |
978 } | 978 } |
979 return; | 979 return; |
980 } | 980 } |
981 close_button_->SetVisible(true); | |
982 } | 981 } |
| 982 // Aura can transition in and out of single-window mode, so be sure the |
| 983 // close button is visible after the change. |
| 984 close_button_->SetVisible(true); |
983 | 985 |
984 // When the window is restored, we show a maximized button; otherwise, we show | 986 // When the window is restored, we show a maximized button; otherwise, we show |
985 // a restore button. | 987 // a restore button. |
986 bool is_restored = !is_maximized && !frame()->IsMinimized(); | 988 bool is_restored = !is_maximized && !frame()->IsMinimized(); |
987 views::ImageButton* invisible_button = is_restored ? | 989 views::ImageButton* invisible_button = is_restored ? |
988 restore_button_ : maximize_button_; | 990 restore_button_ : maximize_button_; |
989 invisible_button->SetVisible(false); | 991 invisible_button->SetVisible(false); |
990 | 992 |
991 views::ImageButton* visible_button = is_restored ? | 993 views::ImageButton* visible_button = is_restored ? |
992 maximize_button_ : restore_button_; | 994 maximize_button_ : restore_button_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 | 1063 |
1062 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1064 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
1063 int height) const { | 1065 int height) const { |
1064 int top_height = NonClientTopBorderHeight(false); | 1066 int top_height = NonClientTopBorderHeight(false); |
1065 int border_thickness = NonClientBorderThickness(); | 1067 int border_thickness = NonClientBorderThickness(); |
1066 return gfx::Rect(border_thickness, top_height, | 1068 return gfx::Rect(border_thickness, top_height, |
1067 std::max(0, width - (2 * border_thickness)), | 1069 std::max(0, width - (2 * border_thickness)), |
1068 std::max(0, height - GetReservedHeight() - | 1070 std::max(0, height - GetReservedHeight() - |
1069 top_height - border_thickness)); | 1071 top_height - border_thickness)); |
1070 } | 1072 } |
OLD | NEW |