OLD | NEW |
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 "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h" | 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 8 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
9 #include "chrome/browser/ui/webui/metrics_handler.h" | 9 #include "chrome/browser/ui/webui/metrics_handler.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
12 #include "content/public/browser/web_ui.h" | 12 #include "content/public/browser/web_ui.h" |
13 #include "content/public/browser/web_ui_data_source.h" | 13 #include "content/public/browser/web_ui_data_source.h" |
14 #include "grit/browser_resources.h" | 14 #include "grit/browser_resources.h" |
15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() { | 19 content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() { |
20 content::WebUIDataSource* source = | 20 content::WebUIDataSource* source = |
21 content::WebUIDataSource::Create(chrome::kChromeUIDevicesHost); | 21 content::WebUIDataSource::Create(chrome::kChromeUIDevicesHost); |
22 | 22 |
23 source->SetDefaultResource(IDR_LOCAL_DISCOVERY_HTML); | 23 source->SetDefaultResource(IDR_LOCAL_DISCOVERY_HTML); |
24 source->AddResourcePath("local_discovery.css", IDR_LOCAL_DISCOVERY_CSS); | 24 source->AddResourcePath("local_discovery.css", IDR_LOCAL_DISCOVERY_CSS); |
25 source->AddResourcePath("local_discovery.js", IDR_LOCAL_DISCOVERY_JS); | 25 source->AddResourcePath("local_discovery.js", IDR_LOCAL_DISCOVERY_JS); |
| 26 source->AddResourcePath("device.png", IDR_LOCAL_DISCOVERY_DEVICE_PNG); |
26 source->AddResourcePath("printer.png", IDR_LOCAL_DISCOVERY_PRINTER_PNG); | 27 source->AddResourcePath("printer.png", IDR_LOCAL_DISCOVERY_PRINTER_PNG); |
27 | 28 |
28 source->SetUseJsonJSFormatV2(); | 29 source->SetUseJsonJSFormatV2(); |
29 source->AddLocalizedString("serviceRegister", | 30 source->AddLocalizedString("serviceRegister", |
30 IDS_LOCAL_DISCOVERY_SERVICE_REGISTER); | 31 IDS_LOCAL_DISCOVERY_SERVICE_REGISTER); |
31 | 32 |
32 source->AddLocalizedString("registerConfirmMessage", | 33 source->AddLocalizedString("registerConfirmMessage", |
33 IDS_LOCAL_DISCOVERY_REGISTER_CONFIRMATION); | 34 IDS_LOCAL_DISCOVERY_REGISTER_CONFIRMATION); |
34 source->AddLocalizedString("registerUser", | 35 source->AddLocalizedString("registerUser", |
35 IDS_LOCAL_DISCOVERY_REGISTER_USER); | 36 IDS_LOCAL_DISCOVERY_REGISTER_USER); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 user_prefs::PrefRegistrySyncable* registry) { | 122 user_prefs::PrefRegistrySyncable* registry) { |
122 registry->RegisterBooleanPref( | 123 registry->RegisterBooleanPref( |
123 prefs::kLocalDiscoveryNotificationsEnabled, | 124 prefs::kLocalDiscoveryNotificationsEnabled, |
124 #if defined(OS_WIN) | 125 #if defined(OS_WIN) |
125 false, | 126 false, |
126 #else | 127 #else |
127 true, | 128 true, |
128 #endif | 129 #endif |
129 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 130 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
130 } | 131 } |
OLD | NEW |