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

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

Issue 2287753002: Fix background of overflow shelf icon (Closed)
Patch Set: Created 4 years, 3 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/resources/default_200_percent/common/shelf/status_launcher_icon_background_pressed.png ('k') | no next file » | 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/shelf/app_list_button.h" 5 #include "ash/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/shelf_constants.h" 9 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/common/shelf/shelf_item_types.h" 10 #include "ash/common/shelf/shelf_item_types.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 canvas->DrawImageInt(foreground_image, foreground_bounds.x(), 174 canvas->DrawImageInt(foreground_image, foreground_bounds.x(),
175 foreground_bounds.y()); 175 foreground_bounds.y());
176 } 176 }
177 177
178 void AppListButton::PaintAppListButton(gfx::Canvas* canvas, 178 void AppListButton::PaintAppListButton(gfx::Canvas* canvas,
179 const gfx::ImageSkia& foreground_image) { 179 const gfx::ImageSkia& foreground_image) {
180 int background_image_id = 0; 180 int background_image_id = 0;
181 181
182 if (Shell::GetInstance()->GetAppListTargetVisibility() || 182 if (Shell::GetInstance()->GetAppListTargetVisibility() ||
183 draw_background_as_active_) { 183 draw_background_as_active_) {
184 background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; 184 background_image_id = IDR_AURA_LAUNCHER_BACKGROUND_PRESSED;
185 } else { 185 } else {
186 if (shelf_view_->shelf()->shelf_widget()->GetDimsShelf()) { 186 if (shelf_view_->shelf()->shelf_widget()->GetDimsShelf()) {
187 background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK; 187 background_image_id = IDR_AURA_LAUNCHER_BACKGROUND_ON_BLACK;
188 } else { 188 } else {
189 background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; 189 background_image_id = IDR_AURA_LAUNCHER_BACKGROUND_NORMAL;
190 } 190 }
191 } 191 }
192 192
193 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 193 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
194 gfx::ImageSkia background_image = 194 gfx::ImageSkia background_image =
195 *rb.GetImageNamed(background_image_id).ToImageSkia(); 195 *rb.GetImageNamed(background_image_id).ToImageSkia();
196 gfx::Rect background_bounds(background_image.size()); 196 gfx::Rect background_bounds(background_image.size());
197 ShelfAlignment alignment = shelf_view_->shelf()->alignment(); 197 ShelfAlignment alignment = shelf_view_->shelf()->alignment();
198 gfx::Rect contents_bounds = GetContentsBounds(); 198 gfx::Rect contents_bounds = GetContentsBounds();
199 199
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
243 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) { 243 void AppListButton::SetDrawBackgroundAsActive(bool draw_background_as_active) {
244 if (draw_background_as_active_ == draw_background_as_active) 244 if (draw_background_as_active_ == draw_background_as_active)
245 return; 245 return;
246 draw_background_as_active_ = draw_background_as_active; 246 draw_background_as_active_ = draw_background_as_active;
247 SchedulePaint(); 247 SchedulePaint();
248 } 248 }
249 249
250 } // namespace ash 250 } // namespace ash
OLDNEW
« no previous file with comments | « ash/resources/default_200_percent/common/shelf/status_launcher_icon_background_pressed.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698