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/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "content/public/browser/web_ui.h" | 10 #include "content/public/browser/web_ui.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 source->AddLocalizedString("addingMessage1", | 41 source->AddLocalizedString("addingMessage1", |
42 IDS_LOCAL_DISCOVERY_ADDING_PRINTER_MESSAGE1); | 42 IDS_LOCAL_DISCOVERY_ADDING_PRINTER_MESSAGE1); |
43 source->AddLocalizedString("addingMessage2", | 43 source->AddLocalizedString("addingMessage2", |
44 IDS_LOCAL_DISCOVERY_ADDING_PRINTER_MESSAGE2); | 44 IDS_LOCAL_DISCOVERY_ADDING_PRINTER_MESSAGE2); |
45 source->AddLocalizedString("registeredDevicesTitle", | 45 source->AddLocalizedString("registeredDevicesTitle", |
46 IDS_LOCAL_DISCOVERY_REGISTERED_DEVICES_TITLE); | 46 IDS_LOCAL_DISCOVERY_REGISTERED_DEVICES_TITLE); |
47 source->AddLocalizedString("unregisteredDevicesTitle", | 47 source->AddLocalizedString("unregisteredDevicesTitle", |
48 IDS_LOCAL_DISCOVERY_UNREGISTERED_DEVICES_TITLE); | 48 IDS_LOCAL_DISCOVERY_UNREGISTERED_DEVICES_TITLE); |
49 source->AddLocalizedString("devicesTitle", | 49 source->AddLocalizedString("devicesTitle", |
50 IDS_LOCAL_DISCOVERY_DEVICES_PAGE_TITLE); | 50 IDS_LOCAL_DISCOVERY_DEVICES_PAGE_TITLE); |
| 51 source->AddLocalizedString("noDescription", |
| 52 IDS_LOCAL_DISCOVERY_NO_DESCRIPTION); |
| 53 source->AddLocalizedString("printersOnNetworkZero", |
| 54 IDS_LOCAL_DISCOVERY_PRINTERS_ON_NETWORK_ZERO); |
| 55 source->AddLocalizedString("printersOnNetworkOne", |
| 56 IDS_LOCAL_DISCOVERY_PRINTERS_ON_NETWORK_ONE); |
| 57 source->AddLocalizedString("printersOnNetworkMultiple", |
| 58 IDS_LOCAL_DISCOVERY_PRINTERS_ON_NETWORK_MULTIPLE); |
| 59 source->AddLocalizedString("cancel", IDS_CANCEL); |
| 60 source->AddLocalizedString("ok", IDS_OK); |
| 61 source->AddLocalizedString("loading", IDS_LOCAL_DISCOVERY_LOADING); |
| 62 source->AddLocalizedString("addPrinters", IDS_LOCAL_DISCOVERY_ADD_PRINTERS); |
| 63 source->AddLocalizedString( |
| 64 "noPrintersOnNetworkExplanation", |
| 65 IDS_LOCAL_DISCOVERY_NO_PRINTERS_ON_NETWORK_EXPLANATION); |
| 66 |
51 | 67 |
52 source->SetJsonPath("strings.js"); | 68 source->SetJsonPath("strings.js"); |
53 | 69 |
54 source->DisableDenyXFrameOptions(); | 70 source->DisableDenyXFrameOptions(); |
55 | 71 |
56 return source; | 72 return source; |
57 } | 73 } |
58 | 74 |
59 } // namespace | 75 } // namespace |
60 | 76 |
61 LocalDiscoveryUI::LocalDiscoveryUI(content::WebUI* web_ui) | 77 LocalDiscoveryUI::LocalDiscoveryUI(content::WebUI* web_ui) |
62 : WebUIController(web_ui) { | 78 : WebUIController(web_ui) { |
63 // Set up the chrome://devices/ source. | 79 // Set up the chrome://devices/ source. |
64 Profile* profile = Profile::FromWebUI(web_ui); | 80 Profile* profile = Profile::FromWebUI(web_ui); |
65 content::WebUIDataSource::Add(profile, CreateLocalDiscoveryHTMLSource()); | 81 content::WebUIDataSource::Add(profile, CreateLocalDiscoveryHTMLSource()); |
66 | 82 |
67 // TODO(gene): Use LocalDiscoveryUIHandler to send updated to the devices | 83 // TODO(gene): Use LocalDiscoveryUIHandler to send updated to the devices |
68 // page. For example | 84 // page. For example |
69 web_ui->AddMessageHandler(local_discovery::LocalDiscoveryUIHandler::Create()); | 85 web_ui->AddMessageHandler(local_discovery::LocalDiscoveryUIHandler::Create()); |
70 } | 86 } |
OLD | NEW |