Chromium Code Reviews| 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_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" | 
| 6 | 6 | 
| 7 #include <stdint.h> | 7 #include <stdint.h> | 
| 8 | 8 | 
| 9 #include <algorithm> | 9 #include <algorithm> | 
| 10 #include <memory> | 10 #include <memory> | 
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 tp->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND)); | 230 tp->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND)); | 
| 231 canvas->FillRect( | 231 canvas->FillRect( | 
| 232 fill_rect, | 232 fill_rect, | 
| 233 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND)); | 233 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND)); | 
| 234 | 234 | 
| 235 // Draw the separators above and below bookmark bar; | 235 // Draw the separators above and below bookmark bar; | 
| 236 // if animating, these are fading in/out. | 236 // if animating, these are fading in/out. | 
| 237 SkColor separator_color = | 237 SkColor separator_color = | 
| 238 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); | 238 tp->GetColor(ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); | 
| 239 | 239 | 
| 240 if (ui::MaterialDesignController::IsModeMaterial()) { | 240 if (!ui::MaterialDesignController::IsModeMaterial()) { | 
| 
 
Peter Kasting
2016/08/19 01:32:59
Nit: No {}
 
Bret
2016/08/19 18:02:00
Done.
 
 | |
| 241 BrowserView::Paint1pxHorizontalLine( | |
| 242 canvas, separator_color, | |
| 243 gfx::Rect(0, 0, view->width(), | |
| 244 views::NonClientFrameView::kClientEdgeThickness), | |
| 245 true); | |
| 246 } else { | |
| 247 PaintHorizontalBorder(canvas, view, true, separator_color); | 241 PaintHorizontalBorder(canvas, view, true, separator_color); | 
| 248 } | 242 } // In material mode the toolbar bottom stroke serves as our top stroke. | 
| 
 
Peter Kasting
2016/08/19 01:32:59
Nit: I'd put this comment above the conditional.
 
Bret
2016/08/19 18:02:00
Done.
 
 | |
| 249 | 243 | 
| 250 // For the bottom separator, increase the luminance. Either double it or halve | 244 // For the bottom separator, increase the luminance. Either double it or halve | 
| 251 // the distance to 1.0, whichever is less of a difference. | 245 // the distance to 1.0, whichever is less of a difference. | 
| 252 color_utils::HSL hsl; | 246 color_utils::HSL hsl; | 
| 253 color_utils::SkColorToHSL(separator_color, &hsl); | 247 color_utils::SkColorToHSL(separator_color, &hsl); | 
| 254 hsl.l = std::min((hsl.l + 1) / 2, hsl.l * 2); | 248 hsl.l = std::min((hsl.l + 1) / 2, hsl.l * 2); | 
| 255 BrowserView::Paint1pxHorizontalLine( | 249 BrowserView::Paint1pxHorizontalLine( | 
| 256 canvas, color_utils::HSLToSkColor(hsl, SK_AlphaOPAQUE), | 250 canvas, color_utils::HSLToSkColor(hsl, SK_AlphaOPAQUE), | 
| 257 view->GetLocalBounds(), true); | 251 view->GetLocalBounds(), true); | 
| 258 } | 252 } | 
| (...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2662 } | 2656 } | 
| 2663 | 2657 | 
| 2664 extensions::ActiveTabPermissionGranter* | 2658 extensions::ActiveTabPermissionGranter* | 
| 2665 BrowserView::GetActiveTabPermissionGranter() { | 2659 BrowserView::GetActiveTabPermissionGranter() { | 
| 2666 content::WebContents* web_contents = GetActiveWebContents(); | 2660 content::WebContents* web_contents = GetActiveWebContents(); | 
| 2667 if (!web_contents) | 2661 if (!web_contents) | 
| 2668 return nullptr; | 2662 return nullptr; | 
| 2669 return extensions::TabHelper::FromWebContents(web_contents) | 2663 return extensions::TabHelper::FromWebContents(web_contents) | 
| 2670 ->active_tab_permission_granter(); | 2664 ->active_tab_permission_granter(); | 
| 2671 } | 2665 } | 
| OLD | NEW |