Chromium Code Reviews| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 DISALLOW_COPY_AND_ASSIGN(ShelfButtonAnimation); | 126 DISALLOW_COPY_AND_ASSIGN(ShelfButtonAnimation); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace | 129 } // namespace |
| 130 | 130 |
| 131 namespace ash { | 131 namespace ash { |
| 132 | 132 |
| 133 //////////////////////////////////////////////////////////////////////////////// | 133 //////////////////////////////////////////////////////////////////////////////// |
| 134 // ShelfButton::BarView | 134 // ShelfButton::BarView |
| 135 | 135 |
| 136 // Draws a bar underneath the button to represent the state of the application. | |
|
msw
2016/05/24 20:46:55
nit: bar will soon be dot for MD, maybe omit this
James Cook
2016/05/25 00:25:43
Done.
| |
| 136 class ShelfButton::BarView : public views::ImageView, | 137 class ShelfButton::BarView : public views::ImageView, |
| 137 public ShelfButtonAnimation::Observer { | 138 public ShelfButtonAnimation::Observer { |
| 138 public: | 139 public: |
| 139 BarView(Shelf* shelf) | 140 BarView(Shelf* shelf) |
| 140 : shelf_(shelf), | 141 : shelf_(shelf), |
| 141 show_attention_(false), | 142 show_attention_(false), |
| 142 animation_end_time_(base::TimeTicks()), | 143 animation_end_time_(base::TimeTicks()), |
| 143 animating_(false) { | 144 animating_(false) { |
| 144 // Make sure the events reach the parent view for handling. | 145 // Make sure the events reach the parent view for handling. |
| 145 set_interactive(false); | 146 set_interactive(false); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 529 views::ImageView::TRAILING)); | 530 views::ImageView::TRAILING)); |
| 530 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment( | 531 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment( |
| 531 views::ImageView::TRAILING, views::ImageView::CENTER, | 532 views::ImageView::TRAILING, views::ImageView::CENTER, |
| 532 views::ImageView::CENTER)); | 533 views::ImageView::CENTER)); |
| 533 bar_->SchedulePaint(); | 534 bar_->SchedulePaint(); |
| 534 } | 535 } |
| 535 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); | 536 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); |
| 536 } | 537 } |
| 537 | 538 |
| 538 } // namespace ash | 539 } // namespace ash |
| OLD | NEW |