| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 9 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 10 #include "ash/frame/default_header_painter.h" | 10 #include "ash/frame/default_header_painter.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 GetTopInset(false), | 170 GetTopInset(false), |
| 171 std::max(0, width() - left_inset - right_inset), | 171 std::max(0, width() - left_inset - right_inset), |
| 172 tabstrip->GetPreferredSize().height()); | 172 tabstrip->GetPreferredSize().height()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 int BrowserNonClientFrameViewAsh::GetTopInset(bool restored) const { | 175 int BrowserNonClientFrameViewAsh::GetTopInset(bool restored) const { |
| 176 if (!ShouldPaint() || UseImmersiveLightbarHeaderStyle()) | 176 if (!ShouldPaint() || UseImmersiveLightbarHeaderStyle()) |
| 177 return 0; | 177 return 0; |
| 178 | 178 |
| 179 if (browser_view()->IsTabStripVisible()) { | 179 if (browser_view()->IsTabStripVisible()) { |
| 180 // TODO(tdanderson): Remove this temporary hack to prevent the buttons in |
| 181 // the header from overlapping the tabstrip/toolbar |
| 182 // separator in material design. |
| 183 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 184 return header_painter_->GetHeaderHeight() - |
| 185 browser_view()->GetTabStripHeight(); |
| 186 } |
| 187 |
| 180 return ((frame()->IsMaximized() || frame()->IsFullscreen()) && !restored) ? | 188 return ((frame()->IsMaximized() || frame()->IsFullscreen()) && !restored) ? |
| 181 kTabstripTopSpacingShort : kTabstripTopSpacingTall; | 189 kTabstripTopSpacingShort : kTabstripTopSpacingTall; |
| 182 } | 190 } |
| 183 | 191 |
| 184 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) | 192 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) |
| 185 return header_painter_->GetHeaderHeight(); | 193 return header_painter_->GetHeaderHeight(); |
| 186 | 194 |
| 187 int caption_buttons_bottom = caption_button_container_->bounds().bottom(); | 195 int caption_buttons_bottom = caption_button_container_->bounds().bottom(); |
| 188 | 196 |
| 189 // The toolbar partially overlaps the caption buttons. | 197 // The toolbar partially overlaps the caption buttons. |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 } | 709 } |
| 702 } | 710 } |
| 703 | 711 |
| 704 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 712 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
| 705 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); | 713 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); |
| 706 canvas->FillRect( | 714 canvas->FillRect( |
| 707 gfx::Rect(0, caption_button_container_->bounds().bottom(), width(), | 715 gfx::Rect(0, caption_button_container_->bounds().bottom(), width(), |
| 708 kClientEdgeThickness), | 716 kClientEdgeThickness), |
| 709 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 717 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
| 710 } | 718 } |
| OLD | NEW |