OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/glue/bookmark_change_processor.h" | 5 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <stack> | 8 #include <stack> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 } | 863 } |
864 sync_node->SetBookmarkSpecifics(specifics); | 864 sync_node->SetBookmarkSpecifics(specifics); |
865 } | 865 } |
866 | 866 |
867 // static | 867 // static |
868 void BookmarkChangeProcessor::ApplyBookmarkFavicon( | 868 void BookmarkChangeProcessor::ApplyBookmarkFavicon( |
869 const BookmarkNode* bookmark_node, | 869 const BookmarkNode* bookmark_node, |
870 Profile* profile, | 870 Profile* profile, |
871 const GURL& icon_url, | 871 const GURL& icon_url, |
872 const scoped_refptr<base::RefCountedMemory>& bitmap_data) { | 872 const scoped_refptr<base::RefCountedMemory>& bitmap_data) { |
873 HistoryService* history = | 873 HistoryService* history = HistoryServiceFactory::GetForProfile( |
874 HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS); | 874 profile, ServiceAccessType::EXPLICIT_ACCESS); |
875 FaviconService* favicon_service = | 875 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( |
876 FaviconServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS); | 876 profile, ServiceAccessType::EXPLICIT_ACCESS); |
877 | 877 |
878 history->AddPageNoVisitForBookmark(bookmark_node->url(), | 878 history->AddPageNoVisitForBookmark(bookmark_node->url(), |
879 bookmark_node->GetTitle()); | 879 bookmark_node->GetTitle()); |
880 // The client may have cached the favicon at 2x. Use MergeFavicon() as not to | 880 // The client may have cached the favicon at 2x. Use MergeFavicon() as not to |
881 // overwrite the cached 2x favicon bitmap. Sync favicons are always | 881 // overwrite the cached 2x favicon bitmap. Sync favicons are always |
882 // gfx::kFaviconSize in width and height. Store the favicon into history | 882 // gfx::kFaviconSize in width and height. Store the favicon into history |
883 // as such. | 883 // as such. |
884 gfx::Size pixel_size(gfx::kFaviconSize, gfx::kFaviconSize); | 884 gfx::Size pixel_size(gfx::kFaviconSize, gfx::kFaviconSize); |
885 favicon_service->MergeFavicon(bookmark_node->url(), | 885 favicon_service->MergeFavicon(bookmark_node->url(), |
886 icon_url, | 886 icon_url, |
(...skipping 17 matching lines...) Expand all Loading... |
904 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); | 904 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); |
905 sync_node->SetBookmarkSpecifics(updated_specifics); | 905 sync_node->SetBookmarkSpecifics(updated_specifics); |
906 } | 906 } |
907 } | 907 } |
908 | 908 |
909 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { | 909 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { |
910 return bookmark_model_->client()->CanSyncNode(node); | 910 return bookmark_model_->client()->CanSyncNode(node); |
911 } | 911 } |
912 | 912 |
913 } // namespace browser_sync | 913 } // namespace browser_sync |
OLD | NEW |