Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: chrome/browser/history/thumbnail_database.cc

Issue 8469018: Provide assumed favicon for intents if service provider page was never visited. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed review issues. Fixed merge issues due to MaybeShowIntentInfoBar Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/thumbnail_database.h ('k') | chrome/browser/history/thumbnail_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/thumbnail_database.cc
diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc
index 111f6078ee557f6cf39431a6f5e8c8a4d9b12480..4f1b5040c209519b96b2ee066d328a0f2d246fdb 100644
--- a/chrome/browser/history/thumbnail_database.cc
+++ b/chrome/browser/history/thumbnail_database.cc
@@ -545,6 +545,35 @@ bool ThumbnailDatabase::HasMappingFor(FaviconID id) {
return statement.Step();
}
+bool ThumbnailDatabase::CloneIconMapping(const GURL& old_page_url,
+ const GURL& new_page_url) {
+ sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
+ "SELECT COUNT(*) FROM icon_mapping "
brettw 2011/11/15 00:02:42 I'm not doing real reviews since I'm on leave, so
groby-ooo-7-16 2011/11/16 00:31:39 Done.
+ "WHERE page_url=?"));
+ if (!statement)
+ return false;
+
+ statement.BindString(0, URLDatabase::GURLToDatabaseURL(new_page_url));
+ if (!statement.Step())
+ return false;
+
+ // Do nothing if there are existing bindings
+ if (statement.ColumnInt(0) != 0)
+ return true;
+
+ statement.Assign(db_.GetCachedStatement(SQL_FROM_HERE,
+ "INSERT INTO icon_mapping (page_url, icon_id) "
+ "SELECT ?, icon_id FROM icon_mapping "
+ "WHERE page_url = ?"));
+ if (!statement)
+ return false;
+
+ statement.BindString(0, URLDatabase::GURLToDatabaseURL(new_page_url));
+ statement.BindString(1, URLDatabase::GURLToDatabaseURL(old_page_url));
+ return statement.Run();
+}
+
+
bool ThumbnailDatabase::MigrateIconMappingData(URLDatabase* url_db) {
URLDatabase::IconMappingEnumerator e;
if (!url_db->InitIconMappingEnumeratorForEverything(&e))
« no previous file with comments | « chrome/browser/history/thumbnail_database.h ('k') | chrome/browser/history/thumbnail_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698