| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |