| 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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 566 } |
| 567 | 567 |
| 568 gfx::Rect TrayBackgroundView::GetFocusBounds() { | 568 gfx::Rect TrayBackgroundView::GetFocusBounds() { |
| 569 // The tray itself expands to the right and bottom edge of the screen to make | 569 // The tray itself expands to the right and bottom edge of the screen to make |
| 570 // sure clicking on the edges brings up the popup. However, the focus border | 570 // sure clicking on the edges brings up the popup. However, the focus border |
| 571 // should be only around the container. | 571 // should be only around the container. |
| 572 return GetContentsBounds(); | 572 return GetContentsBounds(); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) { | 575 void TrayBackgroundView::OnPaintFocus(gfx::Canvas* canvas) { |
| 576 gfx::Rect paint_bounds(GetFocusBounds()); | 576 gfx::RectF paint_bounds(GetFocusBounds()); |
| 577 paint_bounds.Inset(2, -2, 3, -2); | 577 paint_bounds.Inset(gfx::Insets(2, -2)); |
| 578 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor); | 578 canvas->DrawSolidFocusRect(paint_bounds, kFocusBorderColor, |
| 579 kFocusBorderThickness); |
| 579 } | 580 } |
| 580 | 581 |
| 581 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { | 582 void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) { |
| 582 ActionableView::OnPaint(canvas); | 583 ActionableView::OnPaint(canvas); |
| 583 if (!MaterialDesignController::IsShelfMaterial() || | 584 if (!MaterialDesignController::IsShelfMaterial() || |
| 584 shelf()->GetBackgroundType() == | 585 shelf()->GetBackgroundType() == |
| 585 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || | 586 ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT || |
| 586 !is_separator_visible_) { | 587 !is_separator_visible_) { |
| 587 return; | 588 return; |
| 588 } | 589 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 // TODO(mohsen): Remove this extra size when resize is handled properly (see | 644 // TODO(mohsen): Remove this extra size when resize is handled properly (see |
| 644 // https://crbug.com/666175). | 645 // https://crbug.com/666175). |
| 645 const int icon_size = | 646 const int icon_size = |
| 646 kTrayIconSize + 2 * GetTrayConstant(TRAY_IMAGE_ITEM_PADDING); | 647 kTrayIconSize + 2 * GetTrayConstant(TRAY_IMAGE_ITEM_PADDING); |
| 647 bounds.set_width(bounds.width() + 2 * icon_size); | 648 bounds.set_width(bounds.width() + 2 * icon_size); |
| 648 bounds.set_height(bounds.height() + 2 * icon_size); | 649 bounds.set_height(bounds.height() + 2 * icon_size); |
| 649 return bounds; | 650 return bounds; |
| 650 } | 651 } |
| 651 | 652 |
| 652 } // namespace ash | 653 } // namespace ash |
| OLD | NEW |