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

Side by Side Diff: chrome/browser/history/android/android_provider_backend.cc

Issue 10802066: Adds support for saving favicon size into history database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested by Sky and stevenjb Created 8 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/history/android/android_provider_backend.h" 5 #include "chrome/browser/history/android/android_provider_backend.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "chrome/browser/bookmarks/bookmark_service.h" 8 #include "chrome/browser/bookmarks/bookmark_service.h"
9 #include "chrome/common/chrome_notification_types.h" 9 #include "chrome/common/chrome_notification_types.h"
10 #include "chrome/browser/history/android/android_time.h" 10 #include "chrome/browser/history/android/android_time.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 scoped_ptr<URLsDeletedDetails> deleted_details(new URLsDeletedDetails); 959 scoped_ptr<URLsDeletedDetails> deleted_details(new URLsDeletedDetails);
960 scoped_ptr<FaviconChangeDetails> favicon_details(new FaviconChangeDetails); 960 scoped_ptr<FaviconChangeDetails> favicon_details(new FaviconChangeDetails);
961 scoped_ptr<URLsModifiedDetails> modified(new URLsModifiedDetails); 961 scoped_ptr<URLsModifiedDetails> modified(new URLsModifiedDetails);
962 URLRow old_url_row; 962 URLRow old_url_row;
963 if (!history_db_->GetURLRow(ids[0].url_id, &old_url_row)) 963 if (!history_db_->GetURLRow(ids[0].url_id, &old_url_row))
964 return false; 964 return false;
965 deleted_details->rows.push_back(old_url_row); 965 deleted_details->rows.push_back(old_url_row);
966 966
967 FaviconID favicon_id = statement->statement()->ColumnInt64(4); 967 FaviconID favicon_id = statement->statement()->ColumnInt64(4);
968 if (favicon_id) { 968 if (favicon_id) {
969 std::vector<unsigned char> favicon; 969 std::vector<FaviconBitmap> favicon_bitmaps;
970 if (!thumbnail_db_->GetFavicon(favicon_id, NULL, &favicon, NULL, NULL)) 970 if (!thumbnail_db_->GetFavicons(favicon_id, &favicon_bitmaps))
971 return false; 971 return false;
972 if (!favicon.empty()) 972 if (favicon_bitmaps[0].bitmap_data->size() > 0)
973 new_row.set_favicon(favicon); 973 new_row.set_favicon(favicon_bitmaps[0].bitmap_data);
974 favicon_details->urls.insert(old_url_row.url()); 974 favicon_details->urls.insert(old_url_row.url());
975 favicon_details->urls.insert(row.url()); 975 favicon_details->urls.insert(row.url());
976 } 976 }
977 new_row.set_is_bookmark(statement->statement()->ColumnBool(5)); 977 new_row.set_is_bookmark(statement->statement()->ColumnBool(5));
978 978
979 // The SQLHandler vector is not used here because the row in android_url 979 // The SQLHandler vector is not used here because the row in android_url
980 // shouldn't be deleted, we need keep the AndroidUIID unchanged, so it 980 // shouldn't be deleted, we need keep the AndroidUIID unchanged, so it
981 // appears update to the client. 981 // appears update to the client.
982 if (!urls_handler_->Delete(ids)) 982 if (!urls_handler_->Delete(ids))
983 return false; 983 return false;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 return false; 1164 return false;
1165 1165
1166 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(), 1166 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(),
1167 values.template_url_id(), values.search_term())) 1167 values.template_url_id(), values.search_term()))
1168 return false; 1168 return false;
1169 } 1169 }
1170 return true; 1170 return true;
1171 } 1171 }
1172 1172
1173 } // namespace history 1173 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698