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

Unified Diff: ash/common/system/date/date_view.cc

Issue 2330403002: Do not activate system tray bubble by default (Closed)
Patch Set: Do not activate system tray bubble by default Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/date/date_view.h ('k') | ash/common/system/date/tray_date.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/date/date_view.cc
diff --git a/ash/common/system/date/date_view.cc b/ash/common/system/date/date_view.cc
index 02444f31aad36dcb6c264fb03e3dcc9eadb84612..716a61fea402fb205d3b736313df776cada84e19 100644
--- a/ash/common/system/date/date_view.cc
+++ b/ash/common/system/date/date_view.cc
@@ -89,8 +89,9 @@ void BaseDateTimeView::GetAccessibleState(ui::AXViewState* state) {
state->role = ui::AX_ROLE_TIME;
}
-BaseDateTimeView::BaseDateTimeView()
- : hour_type_(WmShell::Get()->system_tray_delegate()->GetHourClockType()) {
+BaseDateTimeView::BaseDateTimeView(SystemTrayItem* owner)
+ : ActionableView(owner),
+ hour_type_(WmShell::Get()->system_tray_delegate()->GetHourClockType()) {
SetTimer(base::Time::Now());
SetFocusBehavior(FocusBehavior::NEVER);
}
@@ -136,7 +137,8 @@ void BaseDateTimeView::OnLocaleChanged() {
///////////////////////////////////////////////////////////////////////////////
-DateView::DateView() : action_(TrayDate::NONE) {
+DateView::DateView(SystemTrayItem* owner)
+ : BaseDateTimeView(owner), action_(TrayDate::NONE) {
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
date_label_ = new views::Label();
date_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
@@ -189,6 +191,9 @@ bool DateView::PerformAction(const ui::Event& event) {
WmShell::Get()->system_tray_delegate()->ShowDateSettings();
else if (action_ == TrayDate::SET_SYSTEM_TIME)
WmShell::Get()->system_tray_delegate()->ShowSetTimeDialog();
+ else
+ return false;
+ CloseSystemBubble();
return true;
}
@@ -216,7 +221,8 @@ void DateView::OnGestureEvent(ui::GestureEvent* event) {
///////////////////////////////////////////////////////////////////////////////
-TimeView::TimeView(TrayDate::ClockLayout clock_layout) {
+TimeView::TimeView(TrayDate::ClockLayout clock_layout)
+ : BaseDateTimeView(nullptr) {
SetupLabels();
UpdateTextInternal(base::Time::Now());
UpdateClockLayout(clock_layout);
« no previous file with comments | « ash/common/system/date/date_view.h ('k') | ash/common/system/date/tray_date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698