| 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 "ash/common/system/tray/tray_background_view.h" | 5 #include "ash/common/system/tray/tray_background_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 } | 576 } |
| 577 | 577 |
| 578 gfx::Rect TrayBackgroundView::GetFocusBounds() { | 578 gfx::Rect TrayBackgroundView::GetFocusBounds() { |
| 579 // The tray itself expands to the right and bottom edge of the screen to make | 579 // The tray itself expands to the right and bottom edge of the screen to make |
| 580 // sure clicking on the edges brings up the popup. However, the focus border | 580 // sure clicking on the edges brings up the popup. However, the focus border |
| 581 // should be only around the container. | 581 // should be only around the container. |
| 582 return GetContentsBounds(); | 582 return GetContentsBounds(); |
| 583 } | 583 } |
| 584 | 584 |
| 585 void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) { | 585 void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) { |
| 586 gfx::Rect paint_bounds(GetFocusBounds()); | 586 gfx::RectF paint_bounds(GetFocusBounds()); |
| 587 paint_bounds.Inset(2, -2, 3, -2); | 587 paint_bounds.Inset(gfx::Insets(2, -2)); |
| 588 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor); | 588 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor, |
| 589 kFocusBorderThickness); |
| 589 } | 590 } |
| 590 | 591 |
| 591 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { | 592 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { |
| 592 ActionableView::OnPaint(canvas); | 593 ActionableView::OnPaint(canvas); |
| 593 if (!MaterialDesignController::IsShelfMaterial() || | 594 if (!MaterialDesignController::IsShelfMaterial() || |
| 594 shelf()->GetBackgroundType() == | 595 shelf()->GetBackgroundType() == |
| 595 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || | 596 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || |
| 596 !is_separator_visible_) { | 597 !is_separator_visible_) { |
| 597 return; | 598 return; |
| 598 } | 599 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 } | 644 } |
| 644 | 645 |
| 645 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { | 646 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { |
| 646 gfx::Insets insets = GetBackgroundInsets(); | 647 gfx::Insets insets = GetBackgroundInsets(); |
| 647 gfx::Rect bounds = GetLocalBounds(); | 648 gfx::Rect bounds = GetLocalBounds(); |
| 648 bounds.Inset(insets); | 649 bounds.Inset(insets); |
| 649 return bounds; | 650 return bounds; |
| 650 } | 651 } |
| 651 | 652 |
| 652 } // namespace ash | 653 } // namespace ash |
| OLD | NEW |