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

Side by Side Diff: ash/common/shelf/app_list_button.cc

Issue 2277523004: Fix background of overflow shelf icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | ash/resources/ash_resources.grd » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shelf/app_list_button.h" 5 #include "ash/common/shelf/app_list_button.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/shelf/ink_drop_button_listener.h" 9 #include "ash/common/shelf/ink_drop_button_listener.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 canvas->DrawImageInt(foreground_image, foreground_bounds.x(), 192 canvas->DrawImageInt(foreground_image, foreground_bounds.x(),
193 foreground_bounds.y()); 193 foreground_bounds.y());
194 } 194 }
195 195
196 void AppListButton::PaintAppListButton(gfx::Canvas* canvas, 196 void AppListButton::PaintAppListButton(gfx::Canvas* canvas,
197 const gfx::ImageSkia& foreground_image) { 197 const gfx::ImageSkia& foreground_image) {
198 int background_image_id = 0; 198 int background_image_id = 0;
199 199
200 if (WmShell::Get()->GetAppListTargetVisibility() || 200 if (WmShell::Get()->GetAppListTargetVisibility() ||
201 draw_background_as_active_) { 201 draw_background_as_active_) {
202 background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; 202 background_image_id = IDR_AURA_LAUNCHER_BACKGROUND_PRESSED;
203 } else if (wm_shelf_->IsDimmed()) {
204 background_image_id = IDR_AURA_LAUNCHER_BACKGROUND_ON_BLACK;
203 } else { 205 } else {
204 if (wm_shelf_->IsDimmed()) { 206 background_image_id = IDR_AURA_LAUNCHER_BACKGROUND_NORMAL;
205 background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK;
206 } else {
207 background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL;
208 }
209 } 207 }
210 208
211 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 209 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
212 gfx::ImageSkia background_image = 210 gfx::ImageSkia background_image =
213 *rb.GetImageNamed(background_image_id).ToImageSkia(); 211 *rb.GetImageNamed(background_image_id).ToImageSkia();
214 gfx::Rect background_bounds(background_image.size()); 212 gfx::Rect background_bounds(background_image.size());
215 ShelfAlignment alignment = wm_shelf_->GetAlignment(); 213 ShelfAlignment alignment = wm_shelf_->GetAlignment();
216 gfx::Rect contents_bounds = GetContentsBounds(); 214 gfx::Rect contents_bounds = GetContentsBounds();
217 215
218 if (alignment == SHELF_ALIGNMENT_LEFT) { 216 if (alignment == SHELF_ALIGNMENT_LEFT) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 282 }
285 283
286 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { 284 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) {
287 if (draw_background_as_active_ == draw_background_as_active) 285 if (draw_background_as_active_ == draw_background_as_active)
288 return; 286 return;
289 draw_background_as_active_ = draw_background_as_active; 287 draw_background_as_active_ = draw_background_as_active;
290 SchedulePaint(); 288 SchedulePaint();
291 } 289 }
292 290
293 } // namespace ash 291 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/resources/ash_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698