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/chromeos/network_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/network_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/chromeos/options/network_config_view.h" | 14 #include "chrome/browser/chromeos/options/network_config_view.h" |
15 #include "chrome/browser/extensions/tab_helper.h" | 15 #include "chrome/browser/extensions/tab_helper.h" |
16 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide
r.h" | 16 #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_pro
vider.h" |
17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
18 #include "chrome/grit/browser_resources.h" | 18 #include "chrome/grit/browser_resources.h" |
19 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
20 #include "chromeos/network/device_state.h" | 20 #include "chromeos/network/device_state.h" |
21 #include "chromeos/network/network_configuration_handler.h" | 21 #include "chromeos/network/network_configuration_handler.h" |
22 #include "chromeos/network/network_state.h" | 22 #include "chromeos/network/network_state.h" |
23 #include "chromeos/network/network_state_handler.h" | 23 #include "chromeos/network/network_state_handler.h" |
24 #include "components/device_event_log/device_event_log.h" | 24 #include "components/device_event_log/device_event_log.h" |
25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
26 #include "content/public/browser/web_ui.h" | 26 #include "content/public/browser/web_ui.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Enable extension API calls in the WebUI. | 207 // Enable extension API calls in the WebUI. |
208 extensions::TabHelper::CreateForWebContents(web_ui->GetWebContents()); | 208 extensions::TabHelper::CreateForWebContents(web_ui->GetWebContents()); |
209 | 209 |
210 base::DictionaryValue localized_strings; | 210 base::DictionaryValue localized_strings; |
211 GetLocalizedStrings(&localized_strings); | 211 GetLocalizedStrings(&localized_strings); |
212 | 212 |
213 content::WebUIDataSource* html = | 213 content::WebUIDataSource* html = |
214 content::WebUIDataSource::Create(chrome::kChromeUINetworkHost); | 214 content::WebUIDataSource::Create(chrome::kChromeUINetworkHost); |
215 html->AddLocalizedStrings(localized_strings); | 215 html->AddLocalizedStrings(localized_strings); |
216 | 216 |
217 settings::AddCrNetworkStrings(html); | 217 network_element::AddLocalizedStrings(html); |
218 | 218 |
219 html->SetJsonPath("strings.js"); | 219 html->SetJsonPath("strings.js"); |
220 html->AddResourcePath("network_ui.css", IDR_NETWORK_UI_CSS); | 220 html->AddResourcePath("network_ui.css", IDR_NETWORK_UI_CSS); |
221 html->AddResourcePath("network_ui.js", IDR_NETWORK_UI_JS); | 221 html->AddResourcePath("network_ui.js", IDR_NETWORK_UI_JS); |
222 html->SetDefaultResource(IDR_NETWORK_UI_HTML); | 222 html->SetDefaultResource(IDR_NETWORK_UI_HTML); |
223 | 223 |
224 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), | 224 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), |
225 html); | 225 html); |
226 } | 226 } |
227 | 227 |
228 NetworkUI::~NetworkUI() { | 228 NetworkUI::~NetworkUI() { |
229 } | 229 } |
230 | 230 |
231 } // namespace chromeos | 231 } // namespace chromeos |
OLD | NEW |