| 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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, |
| 763 ThemeProperties::GetDefaultColor( |
| 764 ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR, incognito), |
| 761 client_bounds, true); | 765 client_bounds, true); |
| 762 } else { | 766 } else { |
| 763 // Ensure the client edge rects are drawn to the top of the location bar. | 767 // Ensure the client edge rects are drawn to the top of the location bar. |
| 764 img_y_offset = kClientEdgeThickness; | 768 img_y_offset = kClientEdgeThickness; |
| 765 | 769 |
| 766 // Shadow. | 770 // Shadow. |
| 767 const gfx::ImageSkia* const top_left = | 771 const gfx::ImageSkia* const top_left = |
| 768 tp->GetImageSkiaNamed(IDR_APP_TOP_LEFT); | 772 tp->GetImageSkiaNamed(IDR_APP_TOP_LEFT); |
| 769 const int img_w = top_left->width(); | 773 const int img_w = top_left->width(); |
| 770 const int height = top_left->height(); | 774 const int height = top_left->height(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 gfx::Rect side(x, y, kClientEdgeThickness, h); | 833 gfx::Rect side(x, y, kClientEdgeThickness, h); |
| 830 canvas->FillRect(side, color); | 834 canvas->FillRect(side, color); |
| 831 if (draw_bottom) { | 835 if (draw_bottom) { |
| 832 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), | 836 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), |
| 833 kClientEdgeThickness), | 837 kClientEdgeThickness), |
| 834 color); | 838 color); |
| 835 } | 839 } |
| 836 side.Offset(w + kClientEdgeThickness, 0); | 840 side.Offset(w + kClientEdgeThickness, 0); |
| 837 canvas->FillRect(side, color); | 841 canvas->FillRect(side, color); |
| 838 } | 842 } |
| OLD | NEW |