| 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/chrome_url_data_manager.h" | 8 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 9 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 9 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 10 #include "chrome/browser/ui/webui/extensions/pack_extension_handler.h" | 10 #include "chrome/browser/ui/webui/extensions/pack_extension_handler.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 source->add_resource_path("extension_list.js", IDR_EXTENSION_LIST_JS); | 29 source->add_resource_path("extension_list.js", IDR_EXTENSION_LIST_JS); |
| 30 source->set_default_resource(IDR_EXTENSIONS_HTML); | 30 source->set_default_resource(IDR_EXTENSIONS_HTML); |
| 31 return source; | 31 return source; |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 ExtensionsUI::ExtensionsUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 36 ExtensionsUI::ExtensionsUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 37 Profile* profile = Profile::FromWebUI(web_ui); | 37 Profile* profile = Profile::FromWebUI(web_ui); |
| 38 ChromeWebUIDataSource* source = CreateExtensionsHTMLSource(); | 38 ChromeWebUIDataSource* source = CreateExtensionsHTMLSource(); |
| 39 profile->GetChromeURLDataManager()->AddDataSource(source); | 39 ChromeURLDataManager::AddDataSource(profile, source); |
| 40 profile->GetChromeURLDataManager()->AddDataSource( | 40 ChromeURLDataManager::AddDataSource(profile, new SharedResourcesDataSource()); |
| 41 new SharedResourcesDataSource()); | |
| 42 | 41 |
| 43 ExtensionSettingsHandler* handler = new ExtensionSettingsHandler(); | 42 ExtensionSettingsHandler* handler = new ExtensionSettingsHandler(); |
| 44 handler->GetLocalizedValues(source->localized_strings()); | 43 handler->GetLocalizedValues(source->localized_strings()); |
| 45 web_ui->AddMessageHandler(handler); | 44 web_ui->AddMessageHandler(handler); |
| 46 | 45 |
| 47 PackExtensionHandler* pack_handler = new PackExtensionHandler(); | 46 PackExtensionHandler* pack_handler = new PackExtensionHandler(); |
| 48 pack_handler->GetLocalizedValues(source->localized_strings()); | 47 pack_handler->GetLocalizedValues(source->localized_strings()); |
| 49 web_ui->AddMessageHandler(pack_handler); | 48 web_ui->AddMessageHandler(pack_handler); |
| 50 } | 49 } |
| 51 | 50 |
| 52 ExtensionsUI::~ExtensionsUI() { | 51 ExtensionsUI::~ExtensionsUI() { |
| 53 } | 52 } |
| OLD | NEW |