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

Side by Side Diff: ash/common/system/date/date_view.cc

Issue 2438023004: mash: Migrate ShowSetTimeDialog from SystemTrayDelegate to mojo (Closed)
Patch Set: rebase Created 4 years, 1 month 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/common/system/tray/system_tray_controller.h » ('j') | no next file with comments »
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 #include "ash/common/system/date/date_view.h" 5 #include "ash/common/system/date/date_view.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/system/tray/system_tray_controller.h" 8 #include "ash/common/system/tray/system_tray_controller.h"
9 #include "ash/common/system/tray/system_tray_delegate.h"
10 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
11 #include "ash/common/system/tray/tray_utils.h" 10 #include "ash/common/system/tray/tray_utils.h"
12 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
13 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
14 #include "base/i18n/time_formatting.h" 13 #include "base/i18n/time_formatting.h"
15 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
16 #include "base/time/time.h" 15 #include "base/time/time.h"
17 #include "grit/ash_strings.h" 16 #include "grit/ash_strings.h"
18 #include "third_party/icu/source/i18n/unicode/datefmt.h" 17 #include "third_party/icu/source/i18n/unicode/datefmt.h"
19 #include "third_party/icu/source/i18n/unicode/dtptngen.h" 18 #include "third_party/icu/source/i18n/unicode/dtptngen.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 date_label_->SetText(l10n_util::GetStringFUTF16( 190 date_label_->SetText(l10n_util::GetStringFUTF16(
192 IDS_ASH_STATUS_TRAY_DATE, FormatDayOfWeek(now), FormatDate(now))); 191 IDS_ASH_STATUS_TRAY_DATE, FormatDayOfWeek(now), FormatDate(now)));
193 } 192 }
194 193
195 bool DateView::PerformAction(const ui::Event& event) { 194 bool DateView::PerformAction(const ui::Event& event) {
196 if (action_ == TrayDate::NONE) 195 if (action_ == TrayDate::NONE)
197 return false; 196 return false;
198 if (action_ == TrayDate::SHOW_DATE_SETTINGS) 197 if (action_ == TrayDate::SHOW_DATE_SETTINGS)
199 WmShell::Get()->system_tray_controller()->ShowDateSettings(); 198 WmShell::Get()->system_tray_controller()->ShowDateSettings();
200 else if (action_ == TrayDate::SET_SYSTEM_TIME) 199 else if (action_ == TrayDate::SET_SYSTEM_TIME)
201 WmShell::Get()->system_tray_delegate()->ShowSetTimeDialog(); 200 WmShell::Get()->system_tray_controller()->ShowSetTimeDialog();
202 else 201 else
203 return false; 202 return false;
204 CloseSystemBubble(); 203 CloseSystemBubble();
205 return true; 204 return true;
206 } 205 }
207 206
208 void DateView::OnMouseEntered(const ui::MouseEvent& event) { 207 void DateView::OnMouseEntered(const ui::MouseEvent& event) {
209 if (action_ == TrayDate::NONE) 208 if (action_ == TrayDate::NONE)
210 return; 209 return;
211 SetActive(true); 210 SetActive(true);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 353 }
355 354
356 void TimeView::SetupLabel(views::Label* label) { 355 void TimeView::SetupLabel(views::Label* label) {
357 label->set_owned_by_client(); 356 label->set_owned_by_client();
358 SetupLabelForTray(label); 357 SetupLabelForTray(label);
359 label->SetElideBehavior(gfx::NO_ELIDE); 358 label->SetElideBehavior(gfx::NO_ELIDE);
360 } 359 }
361 360
362 } // namespace tray 361 } // namespace tray
363 } // namespace ash 362 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698