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

Side by Side Diff: ash/display/resolution_notification_controller.cc

Issue 147443007: Add support for localized time strings with two units, eg. "2 hours 17 minutes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Tony's comments Created 6 years, 9 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/chromeos/power/power_status.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/display/resolution_notification_controller.h" 5 #include "ash/display/resolution_notification_controller.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/system_notifier.h" 10 #include "ash/system/system_notifier.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return; 205 return;
206 } 206 }
207 207
208 base::string16 timeout_message; 208 base::string16 timeout_message;
209 message_center::RichNotificationData data; 209 message_center::RichNotificationData data;
210 if (change_info_->timeout_count > 0) { 210 if (change_info_->timeout_count > 0) {
211 data.buttons.push_back(message_center::ButtonInfo( 211 data.buttons.push_back(message_center::ButtonInfo(
212 l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_RESOLUTION_CHANGE_ACCEPT))); 212 l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_RESOLUTION_CHANGE_ACCEPT)));
213 timeout_message = l10n_util::GetStringFUTF16( 213 timeout_message = l10n_util::GetStringFUTF16(
214 IDS_ASH_DISPLAY_RESOLUTION_TIMEOUT, 214 IDS_ASH_DISPLAY_RESOLUTION_TIMEOUT,
215 ui::TimeFormat::TimeDurationLong( 215 ui::TimeFormat::Simple(
216 ui::TimeFormat::FORMAT_DURATION, ui::TimeFormat::LENGTH_LONG,
216 base::TimeDelta::FromSeconds(change_info_->timeout_count))); 217 base::TimeDelta::FromSeconds(change_info_->timeout_count)));
217 } 218 }
218 data.buttons.push_back(message_center::ButtonInfo( 219 data.buttons.push_back(message_center::ButtonInfo(
219 l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_RESOLUTION_CHANGE_REVERT))); 220 l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_RESOLUTION_CHANGE_REVERT)));
220 221
221 data.should_make_spoken_feedback_for_popup_updates = enable_spoken_feedback; 222 data.should_make_spoken_feedback_for_popup_updates = enable_spoken_feedback;
222 223
223 const base::string16 display_name = base::UTF8ToUTF16( 224 const base::string16 display_name = base::UTF8ToUTF16(
224 Shell::GetInstance()->display_manager()->GetDisplayNameForId( 225 Shell::GetInstance()->display_manager()->GetDisplayNameForId(
225 change_info_->display_id)); 226 change_info_->display_id));
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 &ResolutionNotificationController::OnTimerTick); 315 &ResolutionNotificationController::OnTimerTick);
315 } 316 }
316 } 317 }
317 318
318 void ResolutionNotificationController::SuppressTimerForTest() { 319 void ResolutionNotificationController::SuppressTimerForTest() {
319 g_use_timer = false; 320 g_use_timer = false;
320 } 321 }
321 322
322 } // namespace internal 323 } // namespace internal
323 } // namespace ash 324 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/chromeos/power/power_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698