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/common/ash_layout_constants.h" | 9 #include "ash/common/ash_layout_constants.h" |
10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 if (toolbar_bounds.IsEmpty()) | 497 if (toolbar_bounds.IsEmpty()) |
498 return; | 498 return; |
499 gfx::Point toolbar_origin(toolbar_bounds.origin()); | 499 gfx::Point toolbar_origin(toolbar_bounds.origin()); |
500 View::ConvertPointToTarget(browser_view(), this, &toolbar_origin); | 500 View::ConvertPointToTarget(browser_view(), this, &toolbar_origin); |
501 toolbar_bounds.set_origin(toolbar_origin); | 501 toolbar_bounds.set_origin(toolbar_origin); |
502 | 502 |
503 const ui::ThemeProvider* tp = GetThemeProvider(); | 503 const ui::ThemeProvider* tp = GetThemeProvider(); |
504 const gfx::ImageSkia* const bg = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); | 504 const gfx::ImageSkia* const bg = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); |
505 const int x = toolbar_bounds.x(); | 505 const int x = toolbar_bounds.x(); |
506 const int y = toolbar_bounds.y(); | 506 const int y = toolbar_bounds.y(); |
507 const int bg_y = GetTopInset(false) + Tab::GetYInsetForActiveTabBackground(); | 507 const int bg_y = GetTopInset(false) + GetLayoutInsets(TAB).top(); |
508 const int w = toolbar_bounds.width(); | 508 const int w = toolbar_bounds.width(); |
509 const int h = toolbar_bounds.height(); | 509 const int h = toolbar_bounds.height(); |
510 const SkColor separator_color = | 510 const SkColor separator_color = |
511 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR); | 511 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR); |
512 if (ui::MaterialDesignController::IsModeMaterial()) { | 512 if (ui::MaterialDesignController::IsModeMaterial()) { |
513 // Background. The top stroke is drawn above the toolbar bounds, so | 513 // Background. The top stroke is drawn above the toolbar bounds, so |
514 // unlike in the non-Material Design code below, we don't need to exclude | 514 // unlike in the non-Material Design code below, we don't need to exclude |
515 // any region from having the background image drawn over it. | 515 // any region from having the background image drawn over it. |
516 if (tp->HasCustomImage(IDR_THEME_TOOLBAR)) { | 516 if (tp->HasCustomImage(IDR_THEME_TOOLBAR)) { |
517 canvas->TileImageInt(*bg, x + GetThemeBackgroundXInset(), y - bg_y, x, y, | 517 canvas->TileImageInt(*bg, x + GetThemeBackgroundXInset(), y - bg_y, x, y, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 // TODO(pkasting): The "2 *" part of this makes no sense to me. | 563 // TODO(pkasting): The "2 *" part of this makes no sense to me. |
564 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, | 564 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, |
565 img_y, img_w, img_h); | 565 img_y, img_w, img_h); |
566 | 566 |
567 // Toolbar/content separator. | 567 // Toolbar/content separator. |
568 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, | 568 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, |
569 kClientEdgeThickness, 0); | 569 kClientEdgeThickness, 0); |
570 canvas->FillRect(toolbar_bounds, separator_color); | 570 canvas->FillRect(toolbar_bounds, separator_color); |
571 } | 571 } |
572 } | 572 } |
OLD | NEW |