| 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..f8e9cdea352bf543218eace59e21db58ec6a83e5 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,27 @@ void DateView::UpdateTextInternal(const base::Time& now) {
|
| }
|
|
|
| bool DateView::PerformAction(const ui::Event& event) {
|
| - if (!actionable_)
|
| - return false;
|
| -
|
| - ash::Shell::GetInstance()->system_tray_delegate()->ShowDateSettings();
|
| - return true;
|
| + switch (action_) {
|
| + case TrayDate::SHOW_DATE_SETTINGS:
|
| + ash::Shell::GetInstance()->system_tray_delegate()->ShowDateSettings();
|
| + return true;
|
| + case TrayDate::SET_SYSTEM_TIME:
|
| + ash::Shell::GetInstance()->system_tray_delegate()->ShowSetTimeDialog();
|
| + return true;
|
| + case TrayDate::NONE:
|
| + return false;
|
| + }
|
| }
|
|
|
| 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();
|
|
|