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

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

Issue 1785613004: Dynamically compute tab/frame separator color. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude test on Mac Created 4 years, 9 months 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 (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/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 const bool incognito = browser_view()->IsOffTheRecord(); 740 const bool incognito = browser_view()->IsOffTheRecord();
741 const bool toolbar_visible = IsToolbarVisible(); 741 const bool toolbar_visible = IsToolbarVisible();
742 int img_y_offset = 0; 742 int img_y_offset = 0;
743 if (tabstrip_visible) { 743 if (tabstrip_visible) {
744 toolbar_color = tp->GetColor(ThemeProperties::COLOR_TOOLBAR); 744 toolbar_color = tp->GetColor(ThemeProperties::COLOR_TOOLBAR);
745 745
746 // Pre-Material Design, the client edge images start below the toolbar. In 746 // Pre-Material Design, the client edge images start below the toolbar. In
747 // MD the client edge images start at the top of the toolbar. 747 // MD the client edge images start at the top of the toolbar.
748 y += md ? toolbar_bounds.y() : toolbar_bounds.bottom(); 748 y += md ? toolbar_bounds.y() : toolbar_bounds.bottom();
749 } else { 749 } else {
750 // Note that windows without tabstrips are never themed, so we always use
751 // the default colors in this section.
750 toolbar_color = ThemeProperties::GetDefaultColor( 752 toolbar_color = ThemeProperties::GetDefaultColor(
751 ThemeProperties::COLOR_TOOLBAR, incognito); 753 ThemeProperties::COLOR_TOOLBAR, incognito);
752 754
753 // The toolbar isn't going to draw a top edge for us, so draw one ourselves. 755 // The toolbar isn't going to draw a top edge for us, so draw one ourselves.
754 if (md) { 756 if (md) {
755 client_bounds.Inset(-kClientEdgeThickness, -1, -kClientEdgeThickness, 757 client_bounds.Inset(-kClientEdgeThickness, -1, -kClientEdgeThickness,
756 client_bounds.height()); 758 client_bounds.height());
757 759
758 // Shadow. 760 // Shadow.
759 BrowserView::Paint1pxHorizontalLine( 761 BrowserView::Paint1pxHorizontalLine(
760 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR), 762 canvas, ThemeProperties::GetDefaultColor(
763 ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR, incognito),
761 client_bounds, true); 764 client_bounds, true);
762 } else { 765 } else {
763 // Ensure the client edge rects are drawn to the top of the location bar. 766 // Ensure the client edge rects are drawn to the top of the location bar.
764 img_y_offset = kClientEdgeThickness; 767 img_y_offset = kClientEdgeThickness;
765 768
766 // Shadow. 769 // Shadow.
767 const gfx::ImageSkia* const top_left = 770 const gfx::ImageSkia* const top_left =
768 tp->GetImageSkiaNamed(IDR_APP_TOP_LEFT); 771 tp->GetImageSkiaNamed(IDR_APP_TOP_LEFT);
769 const int img_w = top_left->width(); 772 const int img_w = top_left->width();
770 const int height = top_left->height(); 773 const int height = top_left->height();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 gfx::Rect side(x, y, kClientEdgeThickness, h); 832 gfx::Rect side(x, y, kClientEdgeThickness, h);
830 canvas->FillRect(side, color); 833 canvas->FillRect(side, color);
831 if (draw_bottom) { 834 if (draw_bottom) {
832 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), 835 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness),
833 kClientEdgeThickness), 836 kClientEdgeThickness),
834 color); 837 color);
835 } 838 }
836 side.Offset(w + kClientEdgeThickness, 0); 839 side.Offset(w + kClientEdgeThickness, 0);
837 canvas->FillRect(side, color); 840 canvas->FillRect(side, color);
838 } 841 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service_unittest.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698