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

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

Issue 698623002: Split WarningService from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: virtual -> override Created 6 years, 1 month 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/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/saved_files_service.h" 8 #include "apps/saved_files_service.h"
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 // chrome/browser/resources/extensions/extensions.js in @typedef for 877 // chrome/browser/resources/extensions/extensions.js in @typedef for
878 // ExtensionDataResponse. Please update it whenever you add or remove any keys 878 // ExtensionDataResponse. Please update it whenever you add or remove any keys
879 // here. 879 // here.
880 base::DictionaryValue results; 880 base::DictionaryValue results;
881 881
882 Profile* profile = Profile::FromWebUI(web_ui()); 882 Profile* profile = Profile::FromWebUI(web_ui());
883 883
884 // Add the extensions to the results structure. 884 // Add the extensions to the results structure.
885 base::ListValue* extensions_list = new base::ListValue(); 885 base::ListValue* extensions_list = new base::ListValue();
886 886
887 WarningService* warnings = ExtensionSystem::Get(profile)->warning_service(); 887 WarningService* warnings = WarningService::Get(profile);
888 888
889 ExtensionRegistry* registry = ExtensionRegistry::Get(profile); 889 ExtensionRegistry* registry = ExtensionRegistry::Get(profile);
890 const ExtensionSet& enabled_set = registry->enabled_extensions(); 890 const ExtensionSet& enabled_set = registry->enabled_extensions();
891 for (ExtensionSet::const_iterator extension = enabled_set.begin(); 891 for (ExtensionSet::const_iterator extension = enabled_set.begin();
892 extension != enabled_set.end(); ++extension) { 892 extension != enabled_set.end(); ++extension) {
893 if (ui_util::ShouldDisplayInExtensionSettings(extension->get(), profile)) { 893 if (ui_util::ShouldDisplayInExtensionSettings(extension->get(), profile)) {
894 extensions_list->Append(CreateExtensionDetailValue( 894 extensions_list->Append(CreateExtensionDetailValue(
895 extension->get(), 895 extension->get(),
896 GetInspectablePagesForExtension(extension->get(), true), 896 GetInspectablePagesForExtension(extension->get(), true),
897 warnings)); 897 warnings));
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, 1348 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
1349 content::NotificationService::AllBrowserContextsAndSources()); 1349 content::NotificationService::AllBrowserContextsAndSources());
1350 registrar_.Add(this, 1350 registrar_.Add(this,
1351 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, 1351 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
1352 content::NotificationService::AllBrowserContextsAndSources()); 1352 content::NotificationService::AllBrowserContextsAndSources());
1353 1353
1354 extension_registry_observer_.Add(ExtensionRegistry::Get(profile)); 1354 extension_registry_observer_.Add(ExtensionRegistry::Get(profile));
1355 1355
1356 content::WebContentsObserver::Observe(web_ui()->GetWebContents()); 1356 content::WebContentsObserver::Observe(web_ui()->GetWebContents());
1357 1357
1358 warning_service_observer_.Add( 1358 warning_service_observer_.Add(WarningService::Get(profile));
1359 ExtensionSystem::Get(profile)->warning_service());
1360 1359
1361 error_console_observer_.Add(ErrorConsole::Get(profile)); 1360 error_console_observer_.Add(ErrorConsole::Get(profile));
1362 1361
1363 extension_management_observer_.Add( 1362 extension_management_observer_.Add(
1364 ExtensionManagementFactory::GetForBrowserContext(profile)); 1363 ExtensionManagementFactory::GetForBrowserContext(profile));
1365 } 1364 }
1366 1365
1367 std::vector<ExtensionPage> 1366 std::vector<ExtensionPage>
1368 ExtensionSettingsHandler::GetInspectablePagesForExtension( 1367 ExtensionSettingsHandler::GetInspectablePagesForExtension(
1369 const Extension* extension, bool extension_is_enabled) { 1368 const Extension* extension, bool extension_is_enabled) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 extension_service_->EnableExtension(extension_id); 1506 extension_service_->EnableExtension(extension_id);
1508 } else { 1507 } else {
1509 ExtensionErrorReporter::GetInstance()->ReportError( 1508 ExtensionErrorReporter::GetInstance()->ReportError(
1510 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1509 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1511 true); // Be noisy. 1510 true); // Be noisy.
1512 } 1511 }
1513 requirements_checker_.reset(); 1512 requirements_checker_.reset();
1514 } 1513 }
1515 1514
1516 } // namespace extensions 1515 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_extension_system.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698