| OLD | NEW |
| (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_ |
| OLD | NEW |