OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/favicon/core/favicon_driver.h" | 5 #include "components/favicon/core/favicon_driver.h" |
6 | 6 |
7 #include "components/favicon/core/favicon_driver_observer.h" | |
8 | |
9 namespace favicon { | 7 namespace favicon { |
10 | 8 |
11 void FaviconDriver::AddObserver(FaviconDriverObserver* observer) { | 9 void FaviconDriver::AddObserver(FaviconDriverObserver* observer) { |
12 observer_list_.AddObserver(observer); | 10 observer_list_.AddObserver(observer); |
13 } | 11 } |
14 | 12 |
15 void FaviconDriver::RemoveObserver(FaviconDriverObserver* observer) { | 13 void FaviconDriver::RemoveObserver(FaviconDriverObserver* observer) { |
16 observer_list_.RemoveObserver(observer); | 14 observer_list_.RemoveObserver(observer); |
17 } | 15 } |
18 | 16 |
19 FaviconDriver::FaviconDriver() { | 17 FaviconDriver::FaviconDriver() { |
20 } | 18 } |
21 | 19 |
22 FaviconDriver::~FaviconDriver() { | 20 FaviconDriver::~FaviconDriver() { |
23 } | 21 } |
24 | 22 |
25 void FaviconDriver::NotifyFaviconAvailable(const gfx::Image& image) { | 23 void FaviconDriver::NotifyFaviconUpdatedObservers( |
| 24 FaviconDriverObserver::NotificationIconType notification_icon_type, |
| 25 const GURL& icon_url, |
| 26 bool icon_url_changed, |
| 27 const gfx::Image& image) { |
26 FOR_EACH_OBSERVER(FaviconDriverObserver, observer_list_, | 28 FOR_EACH_OBSERVER(FaviconDriverObserver, observer_list_, |
27 OnFaviconAvailable(image)); | 29 OnFaviconUpdated(this, notification_icon_type, icon_url, |
28 } | 30 icon_url_changed, image)); |
29 | |
30 void FaviconDriver::NotifyFaviconUpdated(bool icon_url_changed) { | |
31 FOR_EACH_OBSERVER(FaviconDriverObserver, observer_list_, | |
32 OnFaviconUpdated(this, icon_url_changed)); | |
33 } | 31 } |
34 | 32 |
35 } // namespace favicon | 33 } // namespace favicon |
OLD | NEW |