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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 url_ids[1] = main_db_->AddURL(url_row2); | 223 url_ids[1] = main_db_->AddURL(url_row2); |
224 thumb_db_->AddIconMapping(url_row2.url(), favicon1); | 224 thumb_db_->AddIconMapping(url_row2.url(), favicon1); |
225 | 225 |
226 URLRow url_row3(GURL("http://www.google.com/3")); | 226 URLRow url_row3(GURL("http://www.google.com/3")); |
227 url_row3.set_last_visit(visit_times[3]); | 227 url_row3.set_last_visit(visit_times[3]); |
228 url_row3.set_visit_count(1); | 228 url_row3.set_visit_count(1); |
229 url_ids[2] = main_db_->AddURL(url_row3); | 229 url_ids[2] = main_db_->AddURL(url_row3); |
230 thumb_db_->AddIconMapping(url_row3.url(), favicon2); | 230 thumb_db_->AddIconMapping(url_row3.url(), favicon2); |
231 | 231 |
232 // Thumbnails for each URL. |thumbnail| takes ownership of decoded SkBitmap. | 232 // Thumbnails for each URL. |thumbnail| takes ownership of decoded SkBitmap. |
233 scoped_ptr<SkBitmap> thumbnail_bitmap( | 233 gfx::Image thumbnail( |
234 gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); | 234 gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); |
235 gfx::Image thumbnail(*thumbnail_bitmap); | |
236 ThumbnailScore score(0.25, true, true, Time::Now()); | 235 ThumbnailScore score(0.25, true, true, Time::Now()); |
237 | 236 |
238 Time time; | 237 Time time; |
239 GURL gurl; | 238 GURL gurl; |
240 top_sites_->SetPageThumbnail(url_row1.url(), &thumbnail, score); | 239 top_sites_->SetPageThumbnail(url_row1.url(), &thumbnail, score); |
241 top_sites_->SetPageThumbnail(url_row2.url(), &thumbnail, score); | 240 top_sites_->SetPageThumbnail(url_row2.url(), &thumbnail, score); |
242 top_sites_->SetPageThumbnail(url_row3.url(), &thumbnail, score); | 241 top_sites_->SetPageThumbnail(url_row3.url(), &thumbnail, score); |
243 | 242 |
244 // Four visits. | 243 // Four visits. |
245 VisitRow visit_row1; | 244 VisitRow visit_row1; |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 main_db_->GetVisitsForURL(url_id, &archived_visits); | 955 main_db_->GetVisitsForURL(url_id, &archived_visits); |
957 EXPECT_EQ(0U, archived_visits.size()); | 956 EXPECT_EQ(0U, archived_visits.size()); |
958 } | 957 } |
959 | 958 |
960 // TODO(brettw) add some visits with no URL to make sure everything is updated | 959 // TODO(brettw) add some visits with no URL to make sure everything is updated |
961 // properly. Have the visits also refer to nonexistent FTS rows. | 960 // properly. Have the visits also refer to nonexistent FTS rows. |
962 // | 961 // |
963 // Maybe also refer to invalid favicons. | 962 // Maybe also refer to invalid favicons. |
964 | 963 |
965 } // namespace history | 964 } // namespace history |
OLD | NEW |