| 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 #ifndef ASH_COMMON_SYSTEM_DATE_DATE_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_DATE_DATE_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_DATE_DATE_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_DATE_DATE_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/common/system/date/tray_date.h" | |
| 12 #include "ash/common/system/tray/actionable_view.h" | 11 #include "ash/common/system/tray/actionable_view.h" |
| 13 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
| 14 #include "base/macros.h" | 13 #include "base/macros.h" |
| 15 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
| 16 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
| 17 | 16 |
| 18 namespace base { | 17 namespace base { |
| 19 class Time; | 18 class Time; |
| 20 } | 19 } |
| 21 | 20 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 private: | 85 private: |
| 87 // Sets active rendering state and updates the color of |date_label_|. | 86 // Sets active rendering state and updates the color of |date_label_|. |
| 88 void SetActive(bool active); | 87 void SetActive(bool active); |
| 89 | 88 |
| 90 // BaseDateTimeView: | 89 // BaseDateTimeView: |
| 91 void UpdateTextInternal(const base::Time& now) override; | 90 void UpdateTextInternal(const base::Time& now) override; |
| 92 | 91 |
| 93 // ActionableView: | 92 // ActionableView: |
| 94 bool PerformAction(const ui::Event& event) override; | 93 bool PerformAction(const ui::Event& event) override; |
| 95 | 94 |
| 96 // views::View: | |
| 97 void OnMouseEntered(const ui::MouseEvent& event) override; | |
| 98 void OnMouseExited(const ui::MouseEvent& event) override; | |
| 99 void OnGestureEvent(ui::GestureEvent* event) override; | |
| 100 | |
| 101 views::Label* date_label_; | 95 views::Label* date_label_; |
| 102 | 96 |
| 103 DateAction action_; | 97 DateAction action_; |
| 104 | 98 |
| 105 DISALLOW_COPY_AND_ASSIGN(DateView); | 99 DISALLOW_COPY_AND_ASSIGN(DateView); |
| 106 }; | 100 }; |
| 107 | 101 |
| 108 // Tray view used to display the current time. | 102 // Tray view used to display the current time. |
| 109 // Exported for tests. | 103 // Exported for tests. |
| 110 class ASH_EXPORT TimeView : public BaseDateTimeView { | 104 class ASH_EXPORT TimeView : public BaseDateTimeView { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 std::unique_ptr<views::Label> vertical_label_hours_; | 143 std::unique_ptr<views::Label> vertical_label_hours_; |
| 150 std::unique_ptr<views::Label> vertical_label_minutes_; | 144 std::unique_ptr<views::Label> vertical_label_minutes_; |
| 151 | 145 |
| 152 DISALLOW_COPY_AND_ASSIGN(TimeView); | 146 DISALLOW_COPY_AND_ASSIGN(TimeView); |
| 153 }; | 147 }; |
| 154 | 148 |
| 155 } // namespace tray | 149 } // namespace tray |
| 156 } // namespace ash | 150 } // namespace ash |
| 157 | 151 |
| 158 #endif // ASH_COMMON_SYSTEM_DATE_DATE_VIEW_H_ | 152 #endif // ASH_COMMON_SYSTEM_DATE_DATE_VIEW_H_ |
| OLD | NEW |