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 | |
387 void OpaqueBrowserFrameView::ResetWindowControls() { | 383 void OpaqueBrowserFrameView::ResetWindowControls() { |
388 restore_button_->SetState(views::CustomButton::BS_NORMAL); | 384 restore_button_->SetState(views::CustomButton::BS_NORMAL); |
389 minimize_button_->SetState(views::CustomButton::BS_NORMAL); | 385 minimize_button_->SetState(views::CustomButton::BS_NORMAL); |
390 maximize_button_->SetState(views::CustomButton::BS_NORMAL); | 386 maximize_button_->SetState(views::CustomButton::BS_NORMAL); |
391 // The close button isn't affected by this constraint. | 387 // The close button isn't affected by this constraint. |
392 } | 388 } |
393 | 389 |
394 void OpaqueBrowserFrameView::UpdateWindowIcon() { | 390 void OpaqueBrowserFrameView::UpdateWindowIcon() { |
395 window_icon_->SchedulePaint(); | 391 window_icon_->SchedulePaint(); |
396 } | 392 } |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 | 1132 |
1137 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1133 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
1138 int height) const { | 1134 int height) const { |
1139 int top_height = NonClientTopBorderHeight(false); | 1135 int top_height = NonClientTopBorderHeight(false); |
1140 int border_thickness = NonClientBorderThickness(); | 1136 int border_thickness = NonClientBorderThickness(); |
1141 return gfx::Rect(border_thickness, top_height, | 1137 return gfx::Rect(border_thickness, top_height, |
1142 std::max(0, width - (2 * border_thickness)), | 1138 std::max(0, width - (2 * border_thickness)), |
1143 std::max(0, height - GetReservedHeight() - | 1139 std::max(0, height - GetReservedHeight() - |
1144 top_height - border_thickness)); | 1140 top_height - border_thickness)); |
1145 } | 1141 } |
OLD | NEW |