OLD | NEW |
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 Loading... |
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 scoped_refptr<base::RefCountedBytes> favicon = new base::RefCountedBytes(); | 969 scoped_refptr<base::RefCountedMemory> favicon; |
970 if (!thumbnail_db_->GetFavicon(favicon_id, NULL, &favicon->data(), NULL, | 970 if (!thumbnail_db_->GetFavicon(favicon_id, NULL, &favicon, NULL, NULL)) |
971 NULL)) | |
972 return false; | 971 return false; |
973 if (favicon->size()) | 972 if (favicon.get() && favicon->size()) |
974 new_row.set_favicon(favicon); | 973 new_row.set_favicon(favicon); |
975 favicon_details->urls.insert(old_url_row.url()); | 974 favicon_details->urls.insert(old_url_row.url()); |
976 favicon_details->urls.insert(row.url()); | 975 favicon_details->urls.insert(row.url()); |
977 } | 976 } |
978 new_row.set_is_bookmark(statement->statement()->ColumnBool(5)); | 977 new_row.set_is_bookmark(statement->statement()->ColumnBool(5)); |
979 | 978 |
980 // 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 |
981 // 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 |
982 // appears update to the client. | 981 // appears update to the client. |
983 if (!urls_handler_->Delete(ids)) | 982 if (!urls_handler_->Delete(ids)) |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 return false; | 1164 return false; |
1166 | 1165 |
1167 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(), | 1166 if (!history_db_->SetKeywordSearchTermsForURL(bookmark_row.url_id(), |
1168 values.template_url_id(), values.search_term())) | 1167 values.template_url_id(), values.search_term())) |
1169 return false; | 1168 return false; |
1170 } | 1169 } |
1171 return true; | 1170 return true; |
1172 } | 1171 } |
1173 | 1172 |
1174 } // namespace history | 1173 } // namespace history |
OLD | NEW |