| 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 "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/shelf/shelf_constants.h" | 8 #include "ash/common/shelf/shelf_constants.h" |
| 9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
| 10 #include "ash/common/shelf/wm_shelf_util.h" | 10 #include "ash/common/shelf/wm_shelf_util.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 }}; | 138 }}; |
| 139 | 139 |
| 140 WmShelf* shelf = GetShelf(); | 140 WmShelf* shelf = GetShelf(); |
| 141 const int orientation = IsHorizontalAlignment(shelf->GetAlignment()) | 141 const int orientation = IsHorizontalAlignment(shelf->GetAlignment()) |
| 142 ? kImageHorizontal | 142 ? kImageHorizontal |
| 143 : kImageVertical; | 143 : kImageVertical; |
| 144 | 144 |
| 145 int state = kImageTypeDefault; | 145 int state = kImageTypeDefault; |
| 146 if (tray_background_view_->draw_background_as_active()) | 146 if (tray_background_view_->draw_background_as_active()) |
| 147 state = kImageTypePressed; | 147 state = kImageTypePressed; |
| 148 else if (shelf->IsDimmed()) | 148 else if (shelf->GetBackgroundType() == SHELF_BACKGROUND_MAXIMIZED) |
| 149 state = kImageTypeOnBlack; | 149 state = kImageTypeOnBlack; |
| 150 else | |
| 151 state = kImageTypeDefault; | |
| 152 | 150 |
| 153 ui::CreateNineImagePainter(kImages[orientation][state]) | 151 ui::CreateNineImagePainter(kImages[orientation][state]) |
| 154 ->Paint(canvas, view->GetLocalBounds()); | 152 ->Paint(canvas, view->GetLocalBounds()); |
| 155 } | 153 } |
| 156 | 154 |
| 157 // Overridden from views::Background. | 155 // Overridden from views::Background. |
| 158 void Paint(gfx::Canvas* canvas, views::View* view) const override { | 156 void Paint(gfx::Canvas* canvas, views::View* view) const override { |
| 159 if (MaterialDesignController::IsShelfMaterial()) | 157 if (MaterialDesignController::IsShelfMaterial()) |
| 160 PaintMaterial(canvas, view); | 158 PaintMaterial(canvas, view); |
| 161 else | 159 else |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 return; | 502 return; |
| 505 SchedulePaint(); | 503 SchedulePaint(); |
| 506 } | 504 } |
| 507 | 505 |
| 508 void TrayBackgroundView::UpdateBubbleViewArrow( | 506 void TrayBackgroundView::UpdateBubbleViewArrow( |
| 509 views::TrayBubbleView* bubble_view) { | 507 views::TrayBubbleView* bubble_view) { |
| 510 // Nothing to do here. | 508 // Nothing to do here. |
| 511 } | 509 } |
| 512 | 510 |
| 513 } // namespace ash | 511 } // namespace ash |
| OLD | NEW |