Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1319)

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc

Issue 1505223004: Do not use assets for Ash window control button backgrounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP for pkasting and estade feedback Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 GetTopInset(false), 169 GetTopInset(false),
170 std::max(0, width() - left_inset - right_inset), 170 std::max(0, width() - left_inset - right_inset),
171 tabstrip->GetPreferredSize().height()); 171 tabstrip->GetPreferredSize().height());
172 } 172 }
173 173
174 int BrowserNonClientFrameViewAsh::GetTopInset(bool restored) const { 174 int BrowserNonClientFrameViewAsh::GetTopInset(bool restored) const {
175 if (!ShouldPaint() || UseImmersiveLightbarHeaderStyle()) 175 if (!ShouldPaint() || UseImmersiveLightbarHeaderStyle())
176 return 0; 176 return 0;
177 177
178 if (browser_view()->IsTabStripVisible()) { 178 if (browser_view()->IsTabStripVisible()) {
179 return ((frame()->IsMaximized() || frame()->IsFullscreen()) && !restored) ? 179 // TODO(tdanderson): Remove this temporary hack to prevent the buttons in
180 kTabstripTopSpacingShort : kTabstripTopSpacingTall; 180 // the header from overlapping the tabstrip/toolbar
181 // separator in material design.
182 if (ui::MaterialDesignController::IsModeMaterial()) {
183 return header_painter_->GetHeaderHeight() -
184 browser_view()->GetTabStripHeight();
185 } else {
186 return ((frame()->IsMaximized() ||
187 frame()->IsFullscreen()) &&
188 !restored) ? kTabstripTopSpacingShort : kTabstripTopSpacingTall;
189 }
181 } 190 }
182 191
183 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) 192 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle())
184 return header_painter_->GetHeaderHeight(); 193 return header_painter_->GetHeaderHeight();
185 194
186 int caption_buttons_bottom = caption_button_container_->bounds().bottom(); 195 int caption_buttons_bottom = caption_button_container_->bounds().bottom();
187 196
188 // The toolbar partially overlaps the caption buttons. 197 // The toolbar partially overlaps the caption buttons.
189 if (browser_view()->IsToolbarVisible()) 198 if (browser_view()->IsToolbarVisible())
190 return caption_buttons_bottom - kContentShadowHeight; 199 return caption_buttons_bottom - kContentShadowHeight;
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 709 }
701 } 710 }
702 711
703 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { 712 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) {
704 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); 713 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle());
705 canvas->FillRect( 714 canvas->FillRect(
706 gfx::Rect(0, caption_button_container_->bounds().bottom(), width(), 715 gfx::Rect(0, caption_button_container_->bounds().bottom(), width(),
707 kClientEdgeThickness), 716 kClientEdgeThickness),
708 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); 717 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR_SEPARATOR));
709 } 718 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698