Reland "Mash cleanup: message center part 4."
This relands commit 243f71cb511ba566fcc64af909597cfd0de3a9ff.
Difference to original: SetQuietMode remains a part of the
interface for now.
Original change's description:
> Mash cleanup: message center part 4.
>
> This pulls all notifier related code out of AshMessageCenterController
> and AshMessageCenterClient into new C++ interfaces
> NotifierSettingsController and NotifierSettingsObserver.
>
> [email protected],[email protected]
>
> Bug: 958191
> Change-Id: Ice561f2f1f4e90979847c5f410779a34691926a6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1653858
> Reviewed-by: Evan Stade <[email protected]>
> Reviewed-by: Steven Bennetts <[email protected]>
> Reviewed-by: Xiyuan Xia <[email protected]>
> Commit-Queue: Evan Stade <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#669417}
[email protected]
Change-Id: I63dd4a2d46e39609573debd4268436d163b896df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1662596
Reviewed-by: Evan Stade <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Reviewed-by: Steven Bennetts <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Commit-Queue: Evan Stade <[email protected]>
Cr-Commit-Position: refs/heads/master@{#669844}
diff --git a/chrome/browser/notifications/extension_notifier_controller.cc b/chrome/browser/notifications/extension_notifier_controller.cc
index 9c0e575..6b1b9a748 100644
--- a/chrome/browser/notifications/extension_notifier_controller.cc
+++ b/chrome/browser/notifications/extension_notifier_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/notifications/extension_notifier_controller.h"
+#include "ash/public/cpp/notifier_metadata.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/chrome_app_icon_loader.h"
#include "chrome/browser/notifications/notifier_state_tracker.h"
@@ -22,9 +23,9 @@
ExtensionNotifierController::~ExtensionNotifierController() {}
-std::vector<ash::mojom::NotifierUiDataPtr>
-ExtensionNotifierController::GetNotifierList(Profile* profile) {
- std::vector<ash::mojom::NotifierUiDataPtr> ui_data;
+std::vector<ash::NotifierMetadata> ExtensionNotifierController::GetNotifierList(
+ Profile* profile) {
+ std::vector<ash::NotifierMetadata> notifiers;
const extensions::ExtensionSet& extension_set =
extensions::ExtensionRegistry::Get(profile)->enabled_extensions();
// The extension icon size has to be 32x32 at least to load bigger icons if
@@ -53,14 +54,14 @@
message_center::NotifierType::APPLICATION, extension->id());
NotifierStateTracker* const notifier_state_tracker =
NotifierStateTrackerFactory::GetForProfile(profile);
- ui_data.push_back(ash::mojom::NotifierUiData::New(
+ notifiers.emplace_back(
notifier_id, base::UTF8ToUTF16(extension->name()),
notifier_state_tracker->IsNotifierEnabled(notifier_id),
- false /* enforced */, gfx::ImageSkia()));
+ false /* enforced */, gfx::ImageSkia());
app_icon_loader_->FetchImage(extension->id());
}
- return ui_data;
+ return notifiers;
}
void ExtensionNotifierController::SetNotifierEnabled(