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/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
22 #include "grit/browser_resources.h" | 22 #include "grit/browser_resources.h" |
23 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
24 #include "grit/locale_settings.h" | 24 #include "grit/locale_settings.h" |
25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
27 #include "ui/base/text/bytes_formatting.h" | 27 #include "ui/base/text/bytes_formatting.h" |
28 | 28 |
29 using content::BrowserThread; | 29 using content::BrowserThread; |
30 | 30 |
31 namespace { | |
32 | |
33 const char kPropertyDevicePath[] = "devicePath"; | 31 const char kPropertyDevicePath[] = "devicePath"; |
34 const char kPropertyFilePath[] = "filePath"; | 32 const char kPropertyFilePath[] = "filePath"; |
35 const char kPropertyLabel[] = "label"; | 33 const char kPropertyLabel[] = "label"; |
36 const char kPropertyPath[] = "path"; | 34 const char kPropertyPath[] = "path"; |
37 | 35 |
38 // Name for hwid in machine statistics. | 36 // Name for hwid in machine statistics. |
39 const std::string kHwidStatistic = "hardware_class"; | 37 const char kHwidStatistic[] = "hardware_class"; |
40 | 38 |
41 const char kImageZipFileName[] = "chromeos_image.bin.zip"; | 39 const char kImageZipFileName[] = "chromeos_image.bin.zip"; |
42 | 40 |
43 // 3.9GB. It is less than 4GB because true device size ussually varies a little. | 41 // 3.9GB. It is less than 4GB because true device size ussually varies a little. |
44 const uint64 kMinDeviceSize = static_cast<uint64>(3.9) * 1000 * 1000 * 1000; | 42 const uint64 kMinDeviceSize = static_cast<uint64>(3.9) * 1000 * 1000 * 1000; |
45 | 43 |
46 // Link displayed on imageburner ui. | 44 // Link displayed on imageburner ui. |
47 const std::string kMoreInfoLink = | 45 const char kMoreInfoLink[] = |
48 "http://www.chromium.org/chromium-os/chromiumos-design-docs/recovery-mode"; | 46 "http://www.chromium.org/chromium-os/chromiumos-design-docs/recovery-mode"; |
49 | 47 |
48 namespace { | |
Ryan Sleevi
2011/11/20 23:01:39
Why did you move the namespace down? These don't s
Nico
2011/11/20 23:14:03
Because consts have implicit internal linkage by d
| |
49 | |
50 ChromeWebUIDataSource *CreateImageburnerUIHTMLSource() { | 50 ChromeWebUIDataSource *CreateImageburnerUIHTMLSource() { |
51 ChromeWebUIDataSource *source = | 51 ChromeWebUIDataSource *source = |
52 new ChromeWebUIDataSource(chrome::kChromeUIImageBurnerHost); | 52 new ChromeWebUIDataSource(chrome::kChromeUIImageBurnerHost); |
53 | 53 |
54 source->AddLocalizedString("headerTitle", IDS_IMAGEBURN_HEADER_TITLE); | 54 source->AddLocalizedString("headerTitle", IDS_IMAGEBURN_HEADER_TITLE); |
55 source->AddLocalizedString("headerDescription", | 55 source->AddLocalizedString("headerDescription", |
56 IDS_IMAGEBURN_HEADER_DESCRIPTION); | 56 IDS_IMAGEBURN_HEADER_DESCRIPTION); |
57 source->AddLocalizedString("headerLink", IDS_IMAGEBURN_HEADER_LINK); | 57 source->AddLocalizedString("headerLink", IDS_IMAGEBURN_HEADER_LINK); |
58 source->AddLocalizedString("statusDevicesNone", | 58 source->AddLocalizedString("statusDevicesNone", |
59 IDS_IMAGEBURN_NO_DEVICES_STATUS); | 59 IDS_IMAGEBURN_NO_DEVICES_STATUS); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
638 //////////////////////////////////////////////////////////////////////////////// | 638 //////////////////////////////////////////////////////////////////////////////// |
639 | 639 |
640 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) { | 640 ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) { |
641 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); | 641 imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents); |
642 AddMessageHandler((handler)->Attach(this)); | 642 AddMessageHandler((handler)->Attach(this)); |
643 | 643 |
644 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 644 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
645 profile->GetChromeURLDataManager()->AddDataSource( | 645 profile->GetChromeURLDataManager()->AddDataSource( |
646 CreateImageburnerUIHTMLSource()); | 646 CreateImageburnerUIHTMLSource()); |
647 } | 647 } |
OLD | NEW |