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

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: Created 8 years, 5 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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 scoped_ptr<FaviconChangeDetails> favicon_details(new FaviconChangeDetails); 943 scoped_ptr<FaviconChangeDetails> favicon_details(new FaviconChangeDetails);
944 scoped_ptr<URLsModifiedDetails> modified(new URLsModifiedDetails); 944 scoped_ptr<URLsModifiedDetails> modified(new URLsModifiedDetails);
945 URLRow old_url_row; 945 URLRow old_url_row;
946 if (!history_db_->GetURLRow(ids[0].url_id, &old_url_row)) 946 if (!history_db_->GetURLRow(ids[0].url_id, &old_url_row))
947 return false; 947 return false;
948 deleted_details->rows.push_back(old_url_row); 948 deleted_details->rows.push_back(old_url_row);
949 949
950 FaviconID favicon_id = statement->statement()->ColumnInt64(4); 950 FaviconID favicon_id = statement->statement()->ColumnInt64(4);
951 if (favicon_id) { 951 if (favicon_id) {
952 std::vector<unsigned char> favicon; 952 std::vector<unsigned char> favicon;
953 if (!thumbnail_db_->GetFavicon(favicon_id, NULL, &favicon, NULL, NULL)) 953 if (!thumbnail_db_->GetFavicon(favicon_id, NULL, &favicon, NULL, NULL,
954 NULL))
954 return false; 955 return false;
955 if (!favicon.empty()) 956 if (!favicon.empty())
956 new_row.set_favicon(favicon); 957 new_row.set_favicon(favicon);
957 favicon_details->urls.insert(old_url_row.url()); 958 favicon_details->urls.insert(old_url_row.url());
958 favicon_details->urls.insert(row.url()); 959 favicon_details->urls.insert(row.url());
959 } 960 }
960 new_row.set_is_bookmark(statement->statement()->ColumnBool(5)); 961 new_row.set_is_bookmark(statement->statement()->ColumnBool(5));
961 962
962 // The SQLHandler vector is not used here because the row in android_url 963 // The SQLHandler vector is not used here because the row in android_url
963 // shouldn't be deleted, we need keep the AndroidUIID unchanged, so it 964 // shouldn't be deleted, we need keep the AndroidUIID unchanged, so it
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 return false; 1148 return false;
1148 1149
1149 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(), 1150 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(),
1150 values.template_url_id(), values.search_term())) 1151 values.template_url_id(), values.search_term()))
1151 return false; 1152 return false;
1152 } 1153 }
1153 return true; 1154 return true;
1154 } 1155 }
1155 1156
1156 } // namespace history 1157 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698