| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 void OpaqueBrowserFrameView::GetWindowMask(const gfx::Size& size, | 373 void OpaqueBrowserFrameView::GetWindowMask(const gfx::Size& size, |
| 374 gfx::Path* window_mask) { | 374 gfx::Path* window_mask) { |
| 375 DCHECK(window_mask); | 375 DCHECK(window_mask); |
| 376 | 376 |
| 377 if (frame()->IsMaximized() || frame()->IsFullscreen()) | 377 if (frame()->IsMaximized() || frame()->IsFullscreen()) |
| 378 return; | 378 return; |
| 379 | 379 |
| 380 views::GetDefaultWindowMask(size, window_mask); | 380 views::GetDefaultWindowMask(size, window_mask); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void OpaqueBrowserFrameView::EnableClose(bool enable) { |
| 384 close_button_->SetEnabled(enable); |
| 385 } |
| 386 |
| 383 void OpaqueBrowserFrameView::ResetWindowControls() { | 387 void OpaqueBrowserFrameView::ResetWindowControls() { |
| 384 restore_button_->SetState(views::CustomButton::BS_NORMAL); | 388 restore_button_->SetState(views::CustomButton::BS_NORMAL); |
| 385 minimize_button_->SetState(views::CustomButton::BS_NORMAL); | 389 minimize_button_->SetState(views::CustomButton::BS_NORMAL); |
| 386 maximize_button_->SetState(views::CustomButton::BS_NORMAL); | 390 maximize_button_->SetState(views::CustomButton::BS_NORMAL); |
| 387 // The close button isn't affected by this constraint. | 391 // The close button isn't affected by this constraint. |
| 388 } | 392 } |
| 389 | 393 |
| 390 void OpaqueBrowserFrameView::UpdateWindowIcon() { | 394 void OpaqueBrowserFrameView::UpdateWindowIcon() { |
| 391 window_icon_->SchedulePaint(); | 395 window_icon_->SchedulePaint(); |
| 392 } | 396 } |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 | 1136 |
| 1133 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1137 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
| 1134 int height) const { | 1138 int height) const { |
| 1135 int top_height = NonClientTopBorderHeight(false); | 1139 int top_height = NonClientTopBorderHeight(false); |
| 1136 int border_thickness = NonClientBorderThickness(); | 1140 int border_thickness = NonClientBorderThickness(); |
| 1137 return gfx::Rect(border_thickness, top_height, | 1141 return gfx::Rect(border_thickness, top_height, |
| 1138 std::max(0, width - (2 * border_thickness)), | 1142 std::max(0, width - (2 * border_thickness)), |
| 1139 std::max(0, height - GetReservedHeight() - | 1143 std::max(0, height - GetReservedHeight() - |
| 1140 top_height - border_thickness)); | 1144 top_height - border_thickness)); |
| 1141 } | 1145 } |
| OLD | NEW |