| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf_button.h" | 5 #include "ash/common/shelf/shelf_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } | 266 } |
| 267 | 267 |
| 268 const gfx::ShadowValue kShadows[] = { | 268 const gfx::ShadowValue kShadows[] = { |
| 269 gfx::ShadowValue(gfx::Vector2d(0, 2), 0, SkColorSetARGB(0x1A, 0, 0, 0)), | 269 gfx::ShadowValue(gfx::Vector2d(0, 2), 0, SkColorSetARGB(0x1A, 0, 0, 0)), |
| 270 gfx::ShadowValue(gfx::Vector2d(0, 3), 1, SkColorSetARGB(0x1A, 0, 0, 0)), | 270 gfx::ShadowValue(gfx::Vector2d(0, 3), 1, SkColorSetARGB(0x1A, 0, 0, 0)), |
| 271 gfx::ShadowValue(gfx::Vector2d(0, 0), 1, SkColorSetARGB(0x54, 0, 0, 0)), | 271 gfx::ShadowValue(gfx::Vector2d(0, 0), 1, SkColorSetARGB(0x54, 0, 0, 0)), |
| 272 }; | 272 }; |
| 273 icon_shadows_.assign(kShadows, kShadows + arraysize(kShadows)); | 273 icon_shadows_.assign(kShadows, kShadows + arraysize(kShadows)); |
| 274 | 274 |
| 275 // TODO: refactor the layers so each button doesn't require 2. | 275 // TODO: refactor the layers so each button doesn't require 2. |
| 276 icon_view_->SetPaintToLayer(true); | 276 icon_view_->SetPaintToLayer(); |
| 277 icon_view_->layer()->SetFillsBoundsOpaquely(false); | 277 icon_view_->layer()->SetFillsBoundsOpaquely(false); |
| 278 icon_view_->SetHorizontalAlignment(views::ImageView::CENTER); | 278 icon_view_->SetHorizontalAlignment(views::ImageView::CENTER); |
| 279 icon_view_->SetVerticalAlignment(views::ImageView::LEADING); | 279 icon_view_->SetVerticalAlignment(views::ImageView::LEADING); |
| 280 // Do not make this interactive, so that events are sent to ShelfView. | 280 // Do not make this interactive, so that events are sent to ShelfView. |
| 281 icon_view_->set_interactive(false); | 281 icon_view_->set_interactive(false); |
| 282 | 282 |
| 283 AddChildView(bar_); | 283 AddChildView(bar_); |
| 284 AddChildView(icon_view_); | 284 AddChildView(icon_view_); |
| 285 } | 285 } |
| 286 | 286 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 bar_->SetHorizontalAlignment(views::ImageView::TRAILING); | 598 bar_->SetHorizontalAlignment(views::ImageView::TRAILING); |
| 599 bar_->SetVerticalAlignment(views::ImageView::CENTER); | 599 bar_->SetVerticalAlignment(views::ImageView::CENTER); |
| 600 break; | 600 break; |
| 601 } | 601 } |
| 602 bar_->SchedulePaint(); | 602 bar_->SchedulePaint(); |
| 603 } | 603 } |
| 604 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); | 604 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); |
| 605 } | 605 } |
| 606 | 606 |
| 607 } // namespace ash | 607 } // namespace ash |
| OLD | NEW |