Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: ash/system/date/date_view.h

Issue 560473003: DateView Touch Feedback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/system/date/date_view.cc » ('j') | ash/system/date/date_view.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SYSTEM_DATE_DATE_VIEW_H_ 5 #ifndef ASH_SYSTEM_DATE_DATE_VIEW_H_
6 #define ASH_SYSTEM_DATE_DATE_VIEW_H_ 6 #define ASH_SYSTEM_DATE_DATE_VIEW_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/system/date/tray_date.h" 9 #include "ash/system/date/tray_date.h"
10 #include "ash/system/tray/actionable_view.h" 10 #include "ash/system/tray/actionable_view.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // Sets the action the view should take. An actionable date view gives visual 58 // Sets the action the view should take. An actionable date view gives visual
59 // feedback on hover, can be focused by keyboard, and clicking/pressing space 59 // feedback on hover, can be focused by keyboard, and clicking/pressing space
60 // or enter on the view executes the action. 60 // or enter on the view executes the action.
61 void SetAction(TrayDate::DateAction action); 61 void SetAction(TrayDate::DateAction action);
62 62
63 // Updates the format of the displayed time. 63 // Updates the format of the displayed time.
64 void UpdateTimeFormat(); 64 void UpdateTimeFormat();
65 65
66 base::HourClockType GetHourTypeForTesting() const; 66 base::HourClockType GetHourTypeForTesting() const;
67 67
68 bool active() const {
69 return active_;
70 }
71
68 private: 72 private:
73 // Sets |active_| and updates the color of |date_label_|.
74 void SetActive(bool active);
75
69 // Overridden from BaseDateTimeView. 76 // Overridden from BaseDateTimeView.
70 virtual void UpdateTextInternal(const base::Time& now) OVERRIDE; 77 virtual void UpdateTextInternal(const base::Time& now) OVERRIDE;
71 78
72 // Overridden from ActionableView. 79 // Overridden from ActionableView.
73 virtual bool PerformAction(const ui::Event& event) OVERRIDE; 80 virtual bool PerformAction(const ui::Event& event) OVERRIDE;
74 81
75 // Overridden from views::View. 82 // Overridden from views::View.
76 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; 83 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
77 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; 84 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
85 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
86
87 // True when a mouse is within the bounds, or when a tap gesture is occuring.
88 bool active_;
89
90 // True if touch view feedback command line flag has been enabled. When
91 // enabled touch gestures will toggle rendering the background as active.
92 bool touch_feedback_enabled_;
78 93
79 views::Label* date_label_; 94 views::Label* date_label_;
80 95
81 // Time format (12/24hr) used for accessibility string. 96 // Time format (12/24hr) used for accessibility string.
82 base::HourClockType hour_type_; 97 base::HourClockType hour_type_;
83 98
84 TrayDate::DateAction action_; 99 TrayDate::DateAction action_;
85 100
86 DISALLOW_COPY_AND_ASSIGN(DateView); 101 DISALLOW_COPY_AND_ASSIGN(DateView);
87 }; 102 };
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 141
127 base::HourClockType hour_type_; 142 base::HourClockType hour_type_;
128 143
129 DISALLOW_COPY_AND_ASSIGN(TimeView); 144 DISALLOW_COPY_AND_ASSIGN(TimeView);
130 }; 145 };
131 146
132 } // namespace tray 147 } // namespace tray
133 } // namespace ash 148 } // namespace ash
134 149
135 #endif // ASH_SYSTEM_DATE_DATE_VIEW_H_ 150 #endif // ASH_SYSTEM_DATE_DATE_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ash/system/date/date_view.cc » ('j') | ash/system/date/date_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698