| OLD | NEW |
| 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/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 GetDataSizeText(amount_finished, &finished); | 286 GetDataSizeText(amount_finished, &finished); |
| 287 string16 total; | 287 string16 total; |
| 288 GetDataSizeText(amount_total, &total); | 288 GetDataSizeText(amount_total, &total); |
| 289 *progress_text = l10n_util::GetStringFUTF16(message_id, finished, total); | 289 *progress_text = l10n_util::GetStringFUTF16(message_id, finished, total); |
| 290 } | 290 } |
| 291 | 291 |
| 292 // device_path has to be previously created. | 292 // device_path has to be previously created. |
| 293 void ExtractTargetedDevicePath(const ListValue& list_value, | 293 void ExtractTargetedDevicePath(const ListValue& list_value, |
| 294 int index, | 294 int index, |
| 295 FilePath* device_path) { | 295 FilePath* device_path) { |
| 296 Value* list_member; | 296 const Value* list_member; |
| 297 if (list_value.Get(index, &list_member) && | 297 if (list_value.Get(index, &list_member) && |
| 298 list_member->GetType() == Value::TYPE_STRING) { | 298 list_member->GetType() == Value::TYPE_STRING) { |
| 299 const StringValue* string_value = | 299 const StringValue* string_value = |
| 300 static_cast<const StringValue*>(list_member); | 300 static_cast<const StringValue*>(list_member); |
| 301 std::string image_dest; | 301 std::string image_dest; |
| 302 string_value->GetAsString(&image_dest); | 302 string_value->GetAsString(&image_dest); |
| 303 *device_path = FilePath(image_dest); | 303 *device_path = FilePath(image_dest); |
| 304 } else { | 304 } else { |
| 305 LOG(ERROR) << "Unable to get path string"; | 305 LOG(ERROR) << "Unable to get path string"; |
| 306 device_path->clear(); | 306 device_path->clear(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 325 | 325 |
| 326 ImageBurnUI::ImageBurnUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 326 ImageBurnUI::ImageBurnUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 327 chromeos::imageburner::WebUIHandler* handler = | 327 chromeos::imageburner::WebUIHandler* handler = |
| 328 new chromeos::imageburner::WebUIHandler(web_ui->GetWebContents()); | 328 new chromeos::imageburner::WebUIHandler(web_ui->GetWebContents()); |
| 329 web_ui->AddMessageHandler(handler); | 329 web_ui->AddMessageHandler(handler); |
| 330 | 330 |
| 331 Profile* profile = Profile::FromWebUI(web_ui); | 331 Profile* profile = Profile::FromWebUI(web_ui); |
| 332 ChromeURLDataManager::AddDataSource(profile, | 332 ChromeURLDataManager::AddDataSource(profile, |
| 333 chromeos::imageburner::CreateImageburnerUIHTMLSource()); | 333 chromeos::imageburner::CreateImageburnerUIHTMLSource()); |
| 334 } | 334 } |
| OLD | NEW |