| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef ASH_SHELF_SHELF_BUTTON_PRESSED_METRIC_TRACKER_H_ | 5 #ifndef ASH_SHELF_SHELF_BUTTON_PRESSED_METRIC_TRACKER_H_ |
| 6 #define ASH_SHELF_SHELF_BUTTON_PRESSED_METRIC_TRACKER_H_ | 6 #define ASH_SHELF_SHELF_BUTTON_PRESSED_METRIC_TRACKER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 9 #include "ash/shelf/shelf_item_delegate.h" | 11 #include "ash/shelf/shelf_item_delegate.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/time/tick_clock.h" | 13 #include "base/time/tick_clock.h" |
| 13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 14 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
| 15 | 16 |
| 16 namespace views { | 17 namespace views { |
| 17 class Button; | 18 class Button; |
| 18 } // namespace views | 19 } // namespace views |
| 19 | 20 |
| 20 namespace ash { | 21 namespace ash { |
| 21 | 22 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bool IsSubsequentActivationEvent(const views::Button* sender) const; | 68 bool IsSubsequentActivationEvent(const views::Button* sender) const; |
| 68 | 69 |
| 69 // Caches state data for a window minimized action. The |sender| is the button | 70 // Caches state data for a window minimized action. The |sender| is the button |
| 70 // that caused the action. | 71 // that caused the action. |
| 71 void SetMinimizedData(const views::Button* sender); | 72 void SetMinimizedData(const views::Button* sender); |
| 72 | 73 |
| 73 // Resets the state data associated with the last window minimize action. | 74 // Resets the state data associated with the last window minimize action. |
| 74 void ResetMinimizedData(); | 75 void ResetMinimizedData(); |
| 75 | 76 |
| 76 // Time source for performed action times. | 77 // Time source for performed action times. |
| 77 scoped_ptr<base::TickClock> tick_clock_; | 78 std::unique_ptr<base::TickClock> tick_clock_; |
| 78 | 79 |
| 79 // Stores the time of the last window minimize action. | 80 // Stores the time of the last window minimize action. |
| 80 base::TimeTicks time_of_last_minimize_; | 81 base::TimeTicks time_of_last_minimize_; |
| 81 | 82 |
| 82 // Stores the source button of the last window minimize action. | 83 // Stores the source button of the last window minimize action. |
| 83 // NOTE: This may become stale and should not be operated on. Not owned. | 84 // NOTE: This may become stale and should not be operated on. Not owned. |
| 84 const views::Button* last_minimized_source_button_; | 85 const views::Button* last_minimized_source_button_; |
| 85 | 86 |
| 86 DISALLOW_COPY_AND_ASSIGN(ShelfButtonPressedMetricTracker); | 87 DISALLOW_COPY_AND_ASSIGN(ShelfButtonPressedMetricTracker); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 } // namespace ash | 90 } // namespace ash |
| 90 | 91 |
| 91 #endif // ASH_SHELF_SHELF_BUTTON_PRESSED_METRIC_TRACKER_H_ | 92 #endif // ASH_SHELF_SHELF_BUTTON_PRESSED_METRIC_TRACKER_H_ |
| OLD | NEW |