| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view.h" | 5 #include "ash/shelf/shelf_view.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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 break; | 303 break; |
| 304 case STATUS_ATTENTION: | 304 case STATUS_ATTENTION: |
| 305 button->ClearState(ShelfButton::STATE_ACTIVE); | 305 button->ClearState(ShelfButton::STATE_ACTIVE); |
| 306 button->ClearState(ShelfButton::STATE_RUNNING); | 306 button->ClearState(ShelfButton::STATE_RUNNING); |
| 307 button->AddState(ShelfButton::STATE_ATTENTION); | 307 button->AddState(ShelfButton::STATE_ATTENTION); |
| 308 break; | 308 break; |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 | 311 |
| 312 void RecordIconActivatedAction(const ui::Event& event) { | 312 void RecordIconActivatedAction(const ui::Event& event) { |
| 313 if (event.IsMouseEvent()) | 313 if (event.IsMouseEvent()) { |
| 314 Shell::GetInstance()->metrics()->RecordUserMetricsAction( | 314 Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| 315 UMA_LAUNCHER_BUTTON_PRESSED_WITH_MOUSE); | 315 UMA_LAUNCHER_BUTTON_PRESSED_WITH_MOUSE); |
| 316 else if (event.IsGestureEvent()) | 316 } else if (event.IsGestureEvent()) { |
| 317 Shell::GetInstance()->metrics()->RecordUserMetricsAction( | 317 Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| 318 UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH); | 318 UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH); |
| 319 } |
| 319 } | 320 } |
| 320 | 321 |
| 321 } // namespace | 322 } // namespace |
| 322 | 323 |
| 323 // AnimationDelegate used when deleting an item. This steadily decreased the | 324 // AnimationDelegate used when deleting an item. This steadily decreased the |
| 324 // opacity of the layer as the animation progress. | 325 // opacity of the layer as the animation progress. |
| 325 class ShelfView::FadeOutAnimationDelegate : public gfx::AnimationDelegate { | 326 class ShelfView::FadeOutAnimationDelegate : public gfx::AnimationDelegate { |
| 326 public: | 327 public: |
| 327 FadeOutAnimationDelegate(ShelfView* host, views::View* view) | 328 FadeOutAnimationDelegate(ShelfView* host, views::View* view) |
| 328 : shelf_view_(host), | 329 : shelf_view_(host), |
| (...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 distance = bounds.x() - coordinate.x(); | 1974 distance = bounds.x() - coordinate.x(); |
| 1974 break; | 1975 break; |
| 1975 case SHELF_ALIGNMENT_TOP: | 1976 case SHELF_ALIGNMENT_TOP: |
| 1976 distance = coordinate.y() - bounds.bottom(); | 1977 distance = coordinate.y() - bounds.bottom(); |
| 1977 break; | 1978 break; |
| 1978 } | 1979 } |
| 1979 return distance > 0 ? distance : 0; | 1980 return distance > 0 ? distance : 0; |
| 1980 } | 1981 } |
| 1981 | 1982 |
| 1982 } // namespace ash | 1983 } // namespace ash |
| OLD | NEW |