| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync/test/integration/bookmarks_helper.h" | 5 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 urls_with_favicons_->find(node->url()) == urls_with_favicons_->end()) { | 226 urls_with_favicons_->find(node->url()) == urls_with_favicons_->end()) { |
| 227 return FaviconData(); | 227 return FaviconData(); |
| 228 } | 228 } |
| 229 // If a favicon was explicitly set, we may need to wait for it to be loaded | 229 // If a favicon was explicitly set, we may need to wait for it to be loaded |
| 230 // via BookmarkModel::GetFavicon(), which is an asynchronous operation. | 230 // via BookmarkModel::GetFavicon(), which is an asynchronous operation. |
| 231 if (!node->is_favicon_loaded()) { | 231 if (!node->is_favicon_loaded()) { |
| 232 FaviconChangeObserver observer(model, node); | 232 FaviconChangeObserver observer(model, node); |
| 233 model->GetFavicon(node); | 233 model->GetFavicon(node); |
| 234 observer.WaitForGetFavicon(); | 234 observer.WaitForGetFavicon(); |
| 235 } | 235 } |
| 236 return FaviconData(model->GetFavicon(node), node->icon_url()); | 236 return FaviconData(model->GetFavicon(node), |
| 237 node->icon_url() ? *node->icon_url() : GURL()); |
| 237 } | 238 } |
| 238 | 239 |
| 239 // Sets the favicon for |profile| and |node|. |profile| may be | 240 // Sets the favicon for |profile| and |node|. |profile| may be |
| 240 // |test()->verifier()|. | 241 // |test()->verifier()|. |
| 241 void SetFaviconImpl(Profile* profile, | 242 void SetFaviconImpl(Profile* profile, |
| 242 const BookmarkNode* node, | 243 const BookmarkNode* node, |
| 243 const GURL& icon_url, | 244 const GURL& icon_url, |
| 244 const gfx::Image& image, | 245 const gfx::Image& image, |
| 245 bookmarks_helper::FaviconSource favicon_source) { | 246 bookmarks_helper::FaviconSource favicon_source) { |
| 246 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile); | 247 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile); |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 } // namespace | 954 } // namespace |
| 954 | 955 |
| 955 BookmarksUrlChecker::BookmarksUrlChecker(int profile, | 956 BookmarksUrlChecker::BookmarksUrlChecker(int profile, |
| 956 const GURL& url, | 957 const GURL& url, |
| 957 int expected_count) | 958 int expected_count) |
| 958 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch, | 959 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch, |
| 959 profile, | 960 profile, |
| 960 base::ConstRef(url), | 961 base::ConstRef(url), |
| 961 expected_count), | 962 expected_count), |
| 962 "Bookmark URL counts match.") {} | 963 "Bookmark URL counts match.") {} |
| OLD | NEW |