| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/webui/chromeos/imageburner/webui_handler.h" | 6 #include "chrome/browser/ui/webui/chromeos/imageburner/webui_handler.h" |
| 7 | 7 |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/chromeos/system_access.h" | 13 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/common/jstemplate_builder.h" | 15 #include "chrome/common/jstemplate_builder.h" |
| 16 #include "chrome/common/time_format.h" | 16 #include "chrome/common/time_format.h" |
| 17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 18 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
| 19 #include "grit/browser_resources.h" | 19 #include "grit/browser_resources.h" |
| 20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 21 #include "grit/locale_settings.h" | 21 #include "grit/locale_settings.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 // invokation. | 524 // invokation. |
| 525 chromeos::CrosLibrary::Get()->GetBurnLibrary()->CancelBurnImage(); | 525 chromeos::CrosLibrary::Get()->GetBurnLibrary()->CancelBurnImage(); |
| 526 chromeos::CrosLibrary::Get()->GetBurnLibrary()->RemoveObserver(this); | 526 chromeos::CrosLibrary::Get()->GetBurnLibrary()->RemoveObserver(this); |
| 527 observing_burn_lib_ = false; | 527 observing_burn_lib_ = false; |
| 528 } | 528 } |
| 529 burn_manager_->ResetTargetPaths(); | 529 burn_manager_->ResetTargetPaths(); |
| 530 } | 530 } |
| 531 | 531 |
| 532 bool WebUIHandler::ExtractInfoFromConfigFile(const ConfigFile& config_file) { | 532 bool WebUIHandler::ExtractInfoFromConfigFile(const ConfigFile& config_file) { |
| 533 std::string hwid; | 533 std::string hwid; |
| 534 if (!chromeos::SystemAccess::GetInstance()->GetMachineStatistic( | 534 if (!chromeos::system::StatisticsProvider::GetInstance()-> |
| 535 kHwidStatistic, &hwid)) | 535 GetMachineStatistic(kHwidStatistic, &hwid)) |
| 536 return false; | 536 return false; |
| 537 | 537 |
| 538 image_file_name_ = config_file.GetProperty(kFileName, hwid); | 538 image_file_name_ = config_file.GetProperty(kFileName, hwid); |
| 539 if (image_file_name_.empty()) | 539 if (image_file_name_.empty()) |
| 540 return false; | 540 return false; |
| 541 | 541 |
| 542 image_download_url_ = GURL(config_file.GetProperty(kUrl, hwid)); | 542 image_download_url_ = GURL(config_file.GetProperty(kUrl, hwid)); |
| 543 if (image_download_url_.is_empty()) { | 543 if (image_download_url_.is_empty()) { |
| 544 image_file_name_.clear(); | 544 image_file_name_.clear(); |
| 545 return false; | 545 return false; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 // ImageBurnUI | 667 // ImageBurnUI |
| 668 // | 668 // |
| 669 //////////////////////////////////////////////////////////////////////////////// | 669 //////////////////////////////////////////////////////////////////////////////// |
| 670 | 670 |
| 671 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) { | 671 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) { |
| 672 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); | 672 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); |
| 673 AddMessageHandler((handler)->Attach(this)); | 673 AddMessageHandler((handler)->Attach(this)); |
| 674 imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource(); | 674 imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource(); |
| 675 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 675 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
| 676 } | 676 } |
| 677 | |
| OLD | NEW |