| 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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 } else { | 579 } else { |
| 580 // For "browser mode" windows, we use the native positioning, which is just | 580 // For "browser mode" windows, we use the native positioning, which is just |
| 581 // below the top frame border. | 581 // below the top frame border. |
| 582 y = frame_thickness; | 582 y = frame_thickness; |
| 583 } | 583 } |
| 584 return gfx::Rect(frame_thickness + kIconLeftSpacing, y, size, size); | 584 return gfx::Rect(frame_thickness + kIconLeftSpacing, y, size, size); |
| 585 } | 585 } |
| 586 | 586 |
| 587 gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStripAndAvatarArea( | 587 gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStripAndAvatarArea( |
| 588 views::View* tabstrip) const { | 588 views::View* tabstrip) const { |
| 589 const int available_width = | 589 int available_width = width(); |
| 590 minimize_button_ ? minimize_button_->x() : width(); | 590 if (minimize_button_) { |
| 591 available_width = minimize_button_->x(); |
| 592 } else if (browser_view()->window_switcher_button()) { |
| 593 // We don't have the sysmenu buttons in Windows 8 metro mode. However there |
| 594 // are buttons like the window switcher which are drawn in the non client |
| 595 // are in the BrowserView. We need to ensure that the tab strip does not |
| 596 // draw on the window switcher button. |
| 597 available_width -= browser_view()->window_switcher_button()->width(); |
| 598 } |
| 591 const int caption_spacing = frame()->IsMaximized() ? | 599 const int caption_spacing = frame()->IsMaximized() ? |
| 592 kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing; | 600 kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing; |
| 593 const int tabstrip_x = NonClientBorderThickness(); | 601 const int tabstrip_x = NonClientBorderThickness(); |
| 594 const int tabstrip_width = available_width - tabstrip_x - caption_spacing; | 602 const int tabstrip_width = available_width - tabstrip_x - caption_spacing; |
| 595 return gfx::Rect(tabstrip_x, GetTabStripInsets(false).top, | 603 return gfx::Rect(tabstrip_x, GetTabStripInsets(false).top, |
| 596 std::max(0, tabstrip_width), | 604 std::max(0, tabstrip_width), |
| 597 tabstrip->GetPreferredSize().height()); | 605 tabstrip->GetPreferredSize().height()); |
| 598 } | 606 } |
| 599 | 607 |
| 600 void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { | 608 void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 | 1046 |
| 1039 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1047 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
| 1040 int height) const { | 1048 int height) const { |
| 1041 int top_height = NonClientTopBorderHeight(false); | 1049 int top_height = NonClientTopBorderHeight(false); |
| 1042 int border_thickness = NonClientBorderThickness(); | 1050 int border_thickness = NonClientBorderThickness(); |
| 1043 return gfx::Rect(border_thickness, top_height, | 1051 return gfx::Rect(border_thickness, top_height, |
| 1044 std::max(0, width - (2 * border_thickness)), | 1052 std::max(0, width - (2 * border_thickness)), |
| 1045 std::max(0, height - GetReservedHeight() - | 1053 std::max(0, height - GetReservedHeight() - |
| 1046 top_height - border_thickness)); | 1054 top_height - border_thickness)); |
| 1047 } | 1055 } |
| OLD | NEW |