summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/glue/session_model_associator.cc
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 04:56:52 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 04:56:52 +0000
commite6337c04312f67e9229a73f55ef7da1f4c0e0d45 (patch)
treef5abad80bf116eec765ad20bfd7744275a11dd11 /chrome/browser/sync/glue/session_model_associator.cc
parent2ecd26eab5a8276544c37787d1a206d64479e339 (diff)
downloadchromium_src-e6337c04312f67e9229a73f55ef7da1f4c0e0d45.zip
chromium_src-e6337c04312f67e9229a73f55ef7da1f4c0e0d45.tar.gz
chromium_src-e6337c04312f67e9229a73f55ef7da1f4c0e0d45.tar.bz2
[Sync] Add sync logic to FaviconCache
This enables syncing favicons behind the --enable-sync-favicons switch. No expiration of favicons is performed yet, and only low resolutions favicons are currently synced. BUG=154886 Review URL: https://chromiumcodereview.appspot.com/12509004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188260 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/glue/session_model_associator.cc')
-rw-r--r--chrome/browser/sync/glue/session_model_associator.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index 5b74fda..7904aca 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -900,7 +900,9 @@ void SessionModelAssociator::LoadForeignTabFavicon(
const std::string& favicon_url = tab.navigation(i).favicon_url();
favicon_cache_.OnReceivedSyncFavicon(GURL(page_url),
GURL(favicon_url),
- std::string());
+ std::string(),
+ syncer::TimeToProtoTime(
+ base::Time::Now()));
}
}
@@ -929,7 +931,11 @@ void SessionModelAssociator::LoadForeignTabFavicon(
const std::string& favicon = tab.favicon();
DVLOG(1) << "Storing synced favicon for url " << navigation_url.spec()
<< " with size " << favicon.size() << " bytes.";
- favicon_cache_.OnReceivedSyncFavicon(navigation_url, favicon_source, favicon);
+ favicon_cache_.OnReceivedSyncFavicon(navigation_url,
+ favicon_source,
+ favicon,
+ syncer::TimeToProtoTime(
+ base::Time::Now()));
}
bool SessionModelAssociator::UpdateSyncModelDataFromClient(
@@ -1113,7 +1119,7 @@ void SessionModelAssociator::QuitLoopForSubtleTesting() {
}
}
-FaviconCache* SessionModelAssociator::GetFaviconCacheForTesting() {
+FaviconCache* SessionModelAssociator::GetFaviconCache() {
return &favicon_cache_;
}