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 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" |
10 #include "chrome/browser/ui/webui/chromeos/network_config_message_handler.h" | 11 #include "chrome/browser/ui/webui/chromeos/network_config_message_handler.h" |
11 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
12 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
14 #include "content/public/browser/web_ui.h" | 15 #include "content/public/browser/web_ui.h" |
15 #include "content/public/browser/web_ui_data_source.h" | 16 #include "content/public/browser/web_ui_data_source.h" |
16 #include "grit/browser_resources.h" | 17 #include "grit/browser_resources.h" |
17 | 18 |
18 namespace chromeos { | 19 namespace chromeos { |
19 | 20 |
20 NetworkUI::NetworkUI(content::WebUI* web_ui) | 21 NetworkUI::NetworkUI(content::WebUI* web_ui) |
21 : content::WebUIController(web_ui) { | 22 : content::WebUIController(web_ui) { |
22 web_ui->AddMessageHandler(new NetworkConfigMessageHandler()); | 23 web_ui->AddMessageHandler(new NetworkConfigMessageHandler()); |
| 24 extensions::TabHelper::CreateForWebContents(web_ui->GetWebContents()); |
23 | 25 |
24 content::WebUIDataSource* html = | 26 content::WebUIDataSource* html = |
25 content::WebUIDataSource::Create(chrome::kChromeUINetworkHost); | 27 content::WebUIDataSource::Create(chrome::kChromeUINetworkHost); |
26 | 28 |
27 html->AddLocalizedString("titleText", IDS_NETWORK_UI_TITLE); | 29 html->AddLocalizedString("titleText", IDS_NETWORK_UI_TITLE); |
28 html->AddLocalizedString("autoRefreshText", IDS_NETWORK_UI_AUTO_REFRESH); | 30 html->AddLocalizedString("autoRefreshText", IDS_NETWORK_UI_AUTO_REFRESH); |
29 html->AddLocalizedString("deviceLogLinkText", IDS_DEVICE_LOG_LINK_TEXT); | 31 html->AddLocalizedString("deviceLogLinkText", IDS_DEVICE_LOG_LINK_TEXT); |
30 html->AddLocalizedString("networkRefreshText", IDS_NETWORK_UI_REFRESH); | 32 html->AddLocalizedString("networkRefreshText", IDS_NETWORK_UI_REFRESH); |
31 html->AddLocalizedString("clickToExpandText", IDS_NETWORK_UI_EXPAND); | 33 html->AddLocalizedString("clickToExpandText", IDS_NETWORK_UI_EXPAND); |
32 html->AddLocalizedString("propertyFormatText", | 34 html->AddLocalizedString("propertyFormatText", |
(...skipping 16 matching lines...) Expand all Loading... |
49 html->SetDefaultResource(IDR_NETWORK_UI_HTML); | 51 html->SetDefaultResource(IDR_NETWORK_UI_HTML); |
50 | 52 |
51 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), | 53 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), |
52 html); | 54 html); |
53 } | 55 } |
54 | 56 |
55 NetworkUI::~NetworkUI() { | 57 NetworkUI::~NetworkUI() { |
56 } | 58 } |
57 | 59 |
58 } // namespace chromeos | 60 } // namespace chromeos |
OLD | NEW |