Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: chrome/browser/ui/webui/extensions/extensions_ui.cc

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Made ChromeURLDataManager's destructor virtual Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_activity_ui.cc ('k') | chrome/browser/ui/webui/feedback_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698