Index: chrome/browser/extensions/api/notification_provider/notification_provider_api.cc |
diff --git a/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc b/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc |
index 6b71abdf7236c2e96ac7d9cecefecc43682a8be9..848336450f88d910c47eb77b1e05912129603910 100644 |
--- a/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc |
+++ b/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc |
@@ -10,11 +10,16 @@ |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/notifications/message_center_settings_controller.h" |
+#include "chrome/browser/profiles/profile_info_cache.h" |
+#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/common/chrome_version_info.h" |
#include "extensions/browser/event_router.h" |
+#include "extensions/browser/extension_system.h" |
#include "extensions/common/extension.h" |
#include "extensions/common/features/feature.h" |
#include "ui/base/layout.h" |
+#include "ui/message_center/notifier_settings.h" |
#include "url/gurl.h" |
namespace extensions { |
@@ -185,8 +190,23 @@ NotificationProviderNotifyOnShowSettingsFunction::Run() { |
api::notification_provider::NotifyOnShowSettings::Params::Create(*args_); |
EXTENSION_FUNCTION_VALIDATE(params.get()); |
+ ProfileInfoCache* profile_info_cache = |
+ &g_browser_process->profile_manager()->GetProfileInfoCache(); |
+ |
+ scoped_ptr<MessageCenterSettingsController> settings_controller( |
+ new MessageCenterSettingsController(profile_info_cache)); |
dewittj
2014/08/11 21:16:16
I'd rather that you use the settings controller th
liyanhou
2014/08/12 17:15:00
Done.
|
+ |
+ message_center::NotifierId notifier_id( |
+ message_center::NotifierId::NotifierType::APPLICATION, |
+ params->notifier_id); |
+ |
+ bool has_advanced_settings = |
+ settings_controller->NotifierHasAdvancedSettings(notifier_id); |
+ if (has_advanced_settings) |
+ settings_controller->OnNotifierAdvancedSettingsRequested(notifier_id, NULL); |
return RespondNow(ArgumentList( |
- api::notification_provider::NotifyOnShowSettings::Results::Create(true))); |
+ api::notification_provider::NotifyOnShowSettings::Results::Create( |
+ has_advanced_settings))); |
} |
NotificationProviderGetNotifierFunction:: |