| 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/shelf/shelf_button.h" | 5 #include "ash/shelf/shelf_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // static | 221 // static |
| 222 const char ShelfButton::kViewClassName[] = "ash/ShelfButton"; | 222 const char ShelfButton::kViewClassName[] = "ash/ShelfButton"; |
| 223 | 223 |
| 224 ShelfButton::ShelfButton(ShelfView* shelf_view) | 224 ShelfButton::ShelfButton(ShelfView* shelf_view) |
| 225 : CustomButton(shelf_view), | 225 : CustomButton(shelf_view), |
| 226 shelf_view_(shelf_view), | 226 shelf_view_(shelf_view), |
| 227 icon_view_(new views::ImageView()), | 227 icon_view_(new views::ImageView()), |
| 228 bar_(new BarView(shelf_view->shelf())), | 228 bar_(new BarView(shelf_view->shelf())), |
| 229 state_(STATE_NORMAL), | 229 state_(STATE_NORMAL), |
| 230 destroyed_flag_(nullptr) { | 230 destroyed_flag_(nullptr) { |
| 231 SetAccessibilityFocusable(true); | 231 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 232 | 232 |
| 233 const gfx::ShadowValue kShadows[] = { | 233 const gfx::ShadowValue kShadows[] = { |
| 234 gfx::ShadowValue(gfx::Vector2d(0, 2), 0, SkColorSetARGB(0x1A, 0, 0, 0)), | 234 gfx::ShadowValue(gfx::Vector2d(0, 2), 0, SkColorSetARGB(0x1A, 0, 0, 0)), |
| 235 gfx::ShadowValue(gfx::Vector2d(0, 3), 1, SkColorSetARGB(0x1A, 0, 0, 0)), | 235 gfx::ShadowValue(gfx::Vector2d(0, 3), 1, SkColorSetARGB(0x1A, 0, 0, 0)), |
| 236 gfx::ShadowValue(gfx::Vector2d(0, 0), 1, SkColorSetARGB(0x54, 0, 0, 0)), | 236 gfx::ShadowValue(gfx::Vector2d(0, 0), 1, SkColorSetARGB(0x54, 0, 0, 0)), |
| 237 }; | 237 }; |
| 238 icon_shadows_.assign(kShadows, kShadows + arraysize(kShadows)); | 238 icon_shadows_.assign(kShadows, kShadows + arraysize(kShadows)); |
| 239 | 239 |
| 240 // TODO: refactor the layers so each button doesn't require 2. | 240 // TODO: refactor the layers so each button doesn't require 2. |
| 241 icon_view_->SetPaintToLayer(true); | 241 icon_view_->SetPaintToLayer(true); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment( | 501 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment( |
| 502 views::ImageView::TRAILING, views::ImageView::CENTER, | 502 views::ImageView::TRAILING, views::ImageView::CENTER, |
| 503 views::ImageView::CENTER)); | 503 views::ImageView::CENTER)); |
| 504 bar_->SchedulePaint(); | 504 bar_->SchedulePaint(); |
| 505 } | 505 } |
| 506 | 506 |
| 507 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); | 507 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace ash | 510 } // namespace ash |
| OLD | NEW |