OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extensions_ui.h" | 5 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/webui/extensions/command_handler.h" | 8 #include "chrome/browser/ui/webui/extensions/command_handler.h" |
9 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" | 9 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
10 #include "chrome/browser/ui/webui/extensions/install_extension_handler.h" | 10 #include "chrome/browser/ui/webui/extensions/install_extension_handler.h" |
11 #include "chrome/browser/ui/webui/extensions/pack_extension_handler.h" | 11 #include "chrome/browser/ui/webui/extensions/pack_extension_handler.h" |
12 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
13 #include "content/public/browser/web_ui.h" | 13 #include "content/public/browser/web_ui.h" |
14 #include "content/public/browser/web_ui_data_source.h" | 14 #include "content/public/browser/web_ui_data_source.h" |
15 #include "grit/browser_resources.h" | 15 #include "grit/browser_resources.h" |
16 | 16 |
| 17 #if defined(OS_CHROMEOS) |
| 18 #include "chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.h" |
| 19 #endif |
| 20 |
17 namespace { | 21 namespace { |
18 | 22 |
19 content::WebUIDataSource* CreateExtensionsHTMLSource() { | 23 content::WebUIDataSource* CreateExtensionsHTMLSource() { |
20 content::WebUIDataSource* source = | 24 content::WebUIDataSource* source = |
21 content::WebUIDataSource::Create(chrome::kChromeUIExtensionsFrameHost); | 25 content::WebUIDataSource::Create(chrome::kChromeUIExtensionsFrameHost); |
22 | 26 |
23 source->SetUseJsonJSFormatV2(); | 27 source->SetUseJsonJSFormatV2(); |
24 source->SetJsonPath("strings.js"); | 28 source->SetJsonPath("strings.js"); |
25 source->AddResourcePath("extensions.js", IDR_EXTENSIONS_JS); | 29 source->AddResourcePath("extensions.js", IDR_EXTENSIONS_JS); |
26 source->AddResourcePath("extension_command_list.js", | 30 source->AddResourcePath("extension_command_list.js", |
(...skipping 21 matching lines...) Expand all Loading... |
48 extensions::CommandHandler* commands_handler = | 52 extensions::CommandHandler* commands_handler = |
49 new extensions::CommandHandler(profile); | 53 new extensions::CommandHandler(profile); |
50 commands_handler->GetLocalizedValues(source); | 54 commands_handler->GetLocalizedValues(source); |
51 web_ui->AddMessageHandler(commands_handler); | 55 web_ui->AddMessageHandler(commands_handler); |
52 | 56 |
53 InstallExtensionHandler* install_extension_handler = | 57 InstallExtensionHandler* install_extension_handler = |
54 new InstallExtensionHandler(); | 58 new InstallExtensionHandler(); |
55 install_extension_handler->GetLocalizedValues(source); | 59 install_extension_handler->GetLocalizedValues(source); |
56 web_ui->AddMessageHandler(install_extension_handler); | 60 web_ui->AddMessageHandler(install_extension_handler); |
57 | 61 |
| 62 #if defined(OS_CHROMEOS) |
| 63 chromeos::KioskAppsHandler* kiosk_app_handler = |
| 64 new chromeos::KioskAppsHandler(); |
| 65 kiosk_app_handler->GetLocalizedValues(source); |
| 66 web_ui->AddMessageHandler(kiosk_app_handler); |
| 67 #endif |
| 68 |
58 content::WebUIDataSource::Add(profile, source); | 69 content::WebUIDataSource::Add(profile, source); |
59 } | 70 } |
60 | 71 |
61 ExtensionsUI::~ExtensionsUI() { | 72 ExtensionsUI::~ExtensionsUI() { |
62 } | 73 } |
OLD | NEW |