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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 restore_button_->SetState(views::CustomButton::BS_NORMAL); | 383 restore_button_->SetState(views::CustomButton::BS_NORMAL); |
384 minimize_button_->SetState(views::CustomButton::BS_NORMAL); | 384 minimize_button_->SetState(views::CustomButton::BS_NORMAL); |
385 maximize_button_->SetState(views::CustomButton::BS_NORMAL); | 385 maximize_button_->SetState(views::CustomButton::BS_NORMAL); |
386 // The close button isn't affected by this constraint. | 386 // The close button isn't affected by this constraint. |
387 } | 387 } |
388 | 388 |
389 void OpaqueBrowserFrameView::UpdateWindowIcon() { | 389 void OpaqueBrowserFrameView::UpdateWindowIcon() { |
390 window_icon_->SchedulePaint(); | 390 window_icon_->SchedulePaint(); |
391 } | 391 } |
392 | 392 |
393 void OpaqueBrowserFrameView::UpdateWindowTitle() { | |
394 if (!frame()->IsFullscreen() && window_title_) | |
msw
2012/09/28 20:42:51
nit: you don't need to check |window_title_| here,
Mr4D (OOO till 08-26)
2012/09/28 21:54:47
Done.
| |
395 window_title_->SchedulePaint(); | |
396 } | |
397 | |
393 /////////////////////////////////////////////////////////////////////////////// | 398 /////////////////////////////////////////////////////////////////////////////// |
394 // OpaqueBrowserFrameView, views::View overrides: | 399 // OpaqueBrowserFrameView, views::View overrides: |
395 | 400 |
396 void OpaqueBrowserFrameView::OnPaint(gfx::Canvas* canvas) { | 401 void OpaqueBrowserFrameView::OnPaint(gfx::Canvas* canvas) { |
397 if (frame()->IsFullscreen()) | 402 if (frame()->IsFullscreen()) |
398 return; // Nothing is visible, so don't bother to paint. | 403 return; // Nothing is visible, so don't bother to paint. |
399 | 404 |
400 if (frame()->IsMaximized()) | 405 if (frame()->IsMaximized()) |
401 PaintMaximizedFrameBorder(canvas); | 406 PaintMaximizedFrameBorder(canvas); |
402 else | 407 else |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1039 | 1044 |
1040 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1045 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
1041 int height) const { | 1046 int height) const { |
1042 int top_height = NonClientTopBorderHeight(false); | 1047 int top_height = NonClientTopBorderHeight(false); |
1043 int border_thickness = NonClientBorderThickness(); | 1048 int border_thickness = NonClientBorderThickness(); |
1044 return gfx::Rect(border_thickness, top_height, | 1049 return gfx::Rect(border_thickness, top_height, |
1045 std::max(0, width - (2 * border_thickness)), | 1050 std::max(0, width - (2 * border_thickness)), |
1046 std::max(0, height - GetReservedHeight() - | 1051 std::max(0, height - GetReservedHeight() - |
1047 top_height - border_thickness)); | 1052 top_height - border_thickness)); |
1048 } | 1053 } |
OLD | NEW |