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

Unified Diff: chrome/browser/notifications/web_page_notifier_source.h

Issue 2064363002: Refactor MessageCenterSettingsController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix misspell. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/web_page_notifier_source.h
diff --git a/chrome/browser/notifications/web_page_notifier_source.h b/chrome/browser/notifications/web_page_notifier_source.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b9fe38f6ec2ed83402b42a06c0c0ecea715de84
--- /dev/null
+++ b/chrome/browser/notifications/web_page_notifier_source.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NOTIFICATIONS_WEB_PAGE_NOTIFIER_SOURCE_H_
+#define CHROME_BROWSER_NOTIFICATIONS_WEB_PAGE_NOTIFIER_SOURCE_H_
+
+#include "chrome/browser/notifications/notifier_source.h"
+#include "components/content_settings/core/common/content_settings_pattern.h"
+
+namespace base {
+class CancelableTaskTracker;
+}
+
+namespace favicon_base {
+struct FaviconImageResult;
+}
+
+class WebPageNotifiereSource : public NotifierSource {
+ public:
+ explicit WebPageNotifiereSource(Observer* observer);
+ ~WebPageNotifiereSource() override;
+
+ std::vector<std::unique_ptr<message_center::Notifier>> GetNotifierList(
+ Profile* profile) override;
+
+ void SetNotifierEnabled(Profile* profile,
+ const message_center::Notifier& notifier,
+ bool enabled) override;
+
+ void OnNotifierSettingsClosing() override;
+
+ message_center::NotifierId::NotifierType GetNotifierType() override;
+
+ private:
+ void OnFaviconLoaded(const GURL& url,
+ const favicon_base::FaviconImageResult& favicon_result);
+
+ std::map<base::string16, ContentSettingsPattern> patterns_;
+
+ // The task tracker for loading favicons.
+ std::unique_ptr<base::CancelableTaskTracker> favicon_tracker_;
+
+ // Lifetime of parent must be longer than the source.
+ Observer* observer_;
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_WEB_PAGE_NOTIFIER_SOURCE_H_

Powered by Google App Engine
This is Rietveld 408576698