Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: ash/common/system/tray/tray_background_view.cc

Issue 2190773003: [ABANDONED] Simplify ash shelf dimmer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore an EventHandler object; fix behavior tests. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/shelf/wm_shelf.h ('k') | ash/mus/bridge/wm_shelf_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/common/shelf/wm_shelf.h ('k') | ash/mus/bridge/wm_shelf_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698