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

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

Issue 247663003: Date and Time dialog for when the clock isn't synced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, single quotes in browsertest js Created 6 years, 8 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/system/date/date_view.h ('k') | ash/system/date/tray_date.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/date/date_view.cc
diff --git a/ash/system/date/date_view.cc b/ash/system/date/date_view.cc
index 26f910d2719170eefd0ef1d300b027e55ba279cc..6bdd83e673b91145a18e72338c1fad57c5fad110 100644
--- a/ash/system/date/date_view.cc
+++ b/ash/system/date/date_view.cc
@@ -128,7 +128,7 @@ void BaseDateTimeView::OnLocaleChanged() {
DateView::DateView()
: hour_type_(ash::Shell::GetInstance()->system_tray_delegate()->
GetHourClockType()),
- actionable_(false) {
+ action_(TrayDate::NONE) {
SetLayoutManager(
new views::BoxLayout(
views::BoxLayout::kVertical, 0, 0, 0));
@@ -136,15 +136,15 @@ DateView::DateView()
date_label_->SetEnabledColor(kHeaderTextColorNormal);
UpdateTextInternal(base::Time::Now());
AddChildView(date_label_);
- SetFocusable(actionable_);
+ SetFocusable(false);
}
DateView::~DateView() {
}
-void DateView::SetActionable(bool actionable) {
- actionable_ = actionable;
- SetFocusable(actionable_);
+void DateView::SetAction(TrayDate::DateAction action) {
+ action_ = action;
+ SetFocusable(action_ != TrayDate::NONE);
}
void DateView::UpdateTimeFormat() {
@@ -169,22 +169,24 @@ void DateView::UpdateTextInternal(const base::Time& now) {
}
bool DateView::PerformAction(const ui::Event& event) {
- if (!actionable_)
+ if (action_ == TrayDate::NONE)
return false;
-
- ash::Shell::GetInstance()->system_tray_delegate()->ShowDateSettings();
+ if (action_ == TrayDate::SHOW_DATE_SETTINGS)
+ ash::Shell::GetInstance()->system_tray_delegate()->ShowDateSettings();
+ else if (action_ == TrayDate::SET_SYSTEM_TIME)
+ ash::Shell::GetInstance()->system_tray_delegate()->ShowSetTimeDialog();
return true;
}
void DateView::OnMouseEntered(const ui::MouseEvent& event) {
- if (!actionable_)
+ if (action_ == TrayDate::NONE)
return;
date_label_->SetEnabledColor(kHeaderTextColorHover);
SchedulePaint();
}
void DateView::OnMouseExited(const ui::MouseEvent& event) {
- if (!actionable_)
+ if (action_ == TrayDate::NONE)
return;
date_label_->SetEnabledColor(kHeaderTextColorNormal);
SchedulePaint();
« no previous file with comments | « ash/system/date/date_view.h ('k') | ash/system/date/tray_date.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698