| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Sets the favicon for |profile| and |node|. |profile| may be | 223 // Sets the favicon for |profile| and |node|. |profile| may be |
| 224 // |test()->verifier()|. | 224 // |test()->verifier()|. |
| 225 void SetFaviconImpl(Profile* profile, | 225 void SetFaviconImpl(Profile* profile, |
| 226 const BookmarkNode* node, | 226 const BookmarkNode* node, |
| 227 const GURL& icon_url, | 227 const GURL& icon_url, |
| 228 const gfx::Image& image, | 228 const gfx::Image& image, |
| 229 bookmarks_helper::FaviconSource favicon_source) { | 229 bookmarks_helper::FaviconSource favicon_source) { |
| 230 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); | 230 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); |
| 231 | 231 |
| 232 FaviconChangeObserver observer(model, node); | 232 FaviconChangeObserver observer(model, node); |
| 233 FaviconService* favicon_service = | 233 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( |
| 234 FaviconServiceFactory::GetForProfile(profile, | 234 profile, ServiceAccessType::EXPLICIT_ACCESS); |
| 235 Profile::EXPLICIT_ACCESS); | |
| 236 if (favicon_source == bookmarks_helper::FROM_UI) { | 235 if (favicon_source == bookmarks_helper::FROM_UI) { |
| 237 favicon_service->SetFavicons( | 236 favicon_service->SetFavicons( |
| 238 node->url(), icon_url, favicon_base::FAVICON, image); | 237 node->url(), icon_url, favicon_base::FAVICON, image); |
| 239 } else { | 238 } else { |
| 240 browser_sync::BookmarkChangeProcessor::ApplyBookmarkFavicon( | 239 browser_sync::BookmarkChangeProcessor::ApplyBookmarkFavicon( |
| 241 node, profile, icon_url, image.As1xPNGBytes()); | 240 node, profile, icon_url, image.As1xPNGBytes()); |
| 242 } | 241 } |
| 243 | 242 |
| 244 // Wait for the favicon for |node| to be invalidated. | 243 // Wait for the favicon for |node| to be invalidated. |
| 245 observer.WaitForSetFavicon(); | 244 observer.WaitForSetFavicon(); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 | 831 |
| 833 std::string IndexedSubfolderName(int i) { | 832 std::string IndexedSubfolderName(int i) { |
| 834 return base::StringPrintf("Subfolder Name %d", i); | 833 return base::StringPrintf("Subfolder Name %d", i); |
| 835 } | 834 } |
| 836 | 835 |
| 837 std::string IndexedSubsubfolderName(int i) { | 836 std::string IndexedSubsubfolderName(int i) { |
| 838 return base::StringPrintf("Subsubfolder Name %d", i); | 837 return base::StringPrintf("Subsubfolder Name %d", i); |
| 839 } | 838 } |
| 840 | 839 |
| 841 } // namespace bookmarks_helper | 840 } // namespace bookmarks_helper |
| OLD | NEW |