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

Side by Side Diff: chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.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: More cleanup and documentation Created 6 years, 10 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
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 "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 // BurnController::Delegate override. 163 // BurnController::Delegate override.
164 virtual void OnProgressWithRemainingTime( 164 virtual void OnProgressWithRemainingTime(
165 ProgressType progress_type, 165 ProgressType progress_type,
166 int64 amount_finished, 166 int64 amount_finished,
167 int64 amount_total, 167 int64 amount_total,
168 const base::TimeDelta& time_remaining) OVERRIDE { 168 const base::TimeDelta& time_remaining) OVERRIDE {
169 const base::string16 time_remaining_text = l10n_util::GetStringFUTF16( 169 const base::string16 time_remaining_text = l10n_util::GetStringFUTF16(
170 IDS_IMAGEBURN_DOWNLOAD_TIME_REMAINING, 170 IDS_IMAGEBURN_DOWNLOAD_TIME_REMAINING,
171 ui::TimeFormat::TimeRemaining(time_remaining)); 171 ui::TimeFormat::Simple(ui::TimeFormat::kRemaining,
172 ui::TimeFormat::kShort, time_remaining));
172 SendProgressSignal(progress_type, amount_finished, amount_total, 173 SendProgressSignal(progress_type, amount_finished, amount_total,
173 time_remaining_text); 174 time_remaining_text);
174 } 175 }
175 176
176 // BurnController::Delegate override. 177 // BurnController::Delegate override.
177 virtual void OnNetworkDetected() OVERRIDE { 178 virtual void OnNetworkDetected() OVERRIDE {
178 web_ui()->CallJavascriptFunction("browserBridge.reportNetworkDetected"); 179 web_ui()->CallJavascriptFunction("browserBridge.reportNetworkDetected");
179 } 180 }
180 181
181 // BurnController::Delegate override. 182 // BurnController::Delegate override.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 323
323 ImageBurnUI::ImageBurnUI(content::WebUI* web_ui) : WebUIController(web_ui) { 324 ImageBurnUI::ImageBurnUI(content::WebUI* web_ui) : WebUIController(web_ui) {
324 chromeos::imageburner::WebUIHandler* handler = 325 chromeos::imageburner::WebUIHandler* handler =
325 new chromeos::imageburner::WebUIHandler(web_ui->GetWebContents()); 326 new chromeos::imageburner::WebUIHandler(web_ui->GetWebContents());
326 web_ui->AddMessageHandler(handler); 327 web_ui->AddMessageHandler(handler);
327 328
328 Profile* profile = Profile::FromWebUI(web_ui); 329 Profile* profile = Profile::FromWebUI(web_ui);
329 content::WebUIDataSource::Add( 330 content::WebUIDataSource::Add(
330 profile, chromeos::imageburner::CreateImageburnerUIHTMLSource()); 331 profile, chromeos::imageburner::CreateImageburnerUIHTMLSource());
331 } 332 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698