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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_WEB_PAGE_NOTIFIER_SOURCE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_WEB_PAGE_NOTIFIER_SOURCE_H_
7
8 #include "chrome/browser/notifications/notifier_source.h"
9 #include "components/content_settings/core/common/content_settings_pattern.h"
10
11 namespace base {
12 class CancelableTaskTracker;
13 }
14
15 namespace favicon_base {
16 struct FaviconImageResult;
17 }
18
19 class WebPageNotifiereSource : public NotifierSource {
20 public:
21 explicit WebPageNotifiereSource(Observer* observer);
22 ~WebPageNotifiereSource() override;
23
24 std::vector<std::unique_ptr<message_center::Notifier>> GetNotifierList(
25 Profile* profile) override;
26
27 void SetNotifierEnabled(Profile* profile,
28 const message_center::Notifier& notifier,
29 bool enabled) override;
30
31 void OnNotifierSettingsClosing() override;
32
33 message_center::NotifierId::NotifierType GetNotifierType() override;
34
35 private:
36 void OnFaviconLoaded(const GURL& url,
37 const favicon_base::FaviconImageResult& favicon_result);
38
39 std::map<base::string16, ContentSettingsPattern> patterns_;
40
41 // The task tracker for loading favicons.
42 std::unique_ptr<base::CancelableTaskTracker> favicon_tracker_;
43
44 // Lifetime of parent must be longer than the source.
45 Observer* observer_;
46 };
47
48 #endif // CHROME_BROWSER_NOTIFICATIONS_WEB_PAGE_NOTIFIER_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698