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_impl.h" | 5 #include "components/favicon/core/favicon_driver_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 bool FaviconDriverImpl::IsBookmarked(const GURL& url) { | 97 bool FaviconDriverImpl::IsBookmarked(const GURL& url) { |
98 return bookmark_model_ && bookmark_model_->IsBookmarked(url); | 98 return bookmark_model_ && bookmark_model_->IsBookmarked(url); |
99 } | 99 } |
100 | 100 |
101 void FaviconDriverImpl::OnFaviconAvailable(const gfx::Image& image, | 101 void FaviconDriverImpl::OnFaviconAvailable(const gfx::Image& image, |
102 const GURL& icon_url, | 102 const GURL& icon_url, |
103 bool is_active_favicon) { | 103 bool is_active_favicon) { |
| 104 if (!ShouldSendFaviconAvailableNotifications()) |
| 105 return; |
| 106 |
104 if (is_active_favicon) { | 107 if (is_active_favicon) { |
105 bool icon_url_changed = GetActiveFaviconURL() != icon_url; | 108 bool icon_url_changed = GetActiveFaviconURL() != icon_url; |
106 // No matter what happens, we need to mark the favicon as being set. | 109 // No matter what happens, we need to mark the favicon as being set. |
107 SetActiveFaviconValidity(true); | 110 SetActiveFaviconValidity(true); |
108 SetActiveFaviconURL(icon_url); | 111 SetActiveFaviconURL(icon_url); |
109 | 112 |
110 if (image.IsEmpty()) | 113 if (image.IsEmpty()) |
111 return; | 114 return; |
112 | 115 |
113 SetActiveFaviconImage(image); | 116 SetActiveFaviconImage(image); |
(...skipping 30 matching lines...) Expand all Loading... |
144 const std::vector<FaviconURL>& candidates) { | 147 const std::vector<FaviconURL>& candidates) { |
145 DCHECK(!candidates.empty()); | 148 DCHECK(!candidates.empty()); |
146 favicon_handler_->OnUpdateFaviconURL(candidates); | 149 favicon_handler_->OnUpdateFaviconURL(candidates); |
147 if (touch_icon_handler_.get()) | 150 if (touch_icon_handler_.get()) |
148 touch_icon_handler_->OnUpdateFaviconURL(candidates); | 151 touch_icon_handler_->OnUpdateFaviconURL(candidates); |
149 if (large_icon_handler_.get()) | 152 if (large_icon_handler_.get()) |
150 large_icon_handler_->OnUpdateFaviconURL(candidates); | 153 large_icon_handler_->OnUpdateFaviconURL(candidates); |
151 } | 154 } |
152 | 155 |
153 } // namespace favicon | 156 } // namespace favicon |
OLD | NEW |