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

Side by Side Diff: components/history/core/browser/history_backend.cc

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 7 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
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 "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 // replace it. 1600 // replace it.
1601 bool bitmap_identical = false; 1601 bool bitmap_identical = false;
1602 bool replaced_bitmap = false; 1602 bool replaced_bitmap = false;
1603 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i) { 1603 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i) {
1604 if (bitmap_id_sizes[i].pixel_size == pixel_size) { 1604 if (bitmap_id_sizes[i].pixel_size == pixel_size) {
1605 if (IsFaviconBitmapDataEqual(bitmap_id_sizes[i].bitmap_id, bitmap_data)) { 1605 if (IsFaviconBitmapDataEqual(bitmap_id_sizes[i].bitmap_id, bitmap_data)) {
1606 thumbnail_db_->SetFaviconBitmapLastUpdateTime( 1606 thumbnail_db_->SetFaviconBitmapLastUpdateTime(
1607 bitmap_id_sizes[i].bitmap_id, base::Time::Now()); 1607 bitmap_id_sizes[i].bitmap_id, base::Time::Now());
1608 bitmap_identical = true; 1608 bitmap_identical = true;
1609 } else { 1609 } else {
1610 // Expire the favicon bitmap because sync can provide incorrect
1611 // |bitmap_data|. See crbug.com/474421 for more details. Expiring the
1612 // favicon bitmap causes it to be redownloaded the next time that the
1613 // user visits any page which uses |icon_url|.
1610 thumbnail_db_->SetFaviconBitmap(bitmap_id_sizes[i].bitmap_id, 1614 thumbnail_db_->SetFaviconBitmap(bitmap_id_sizes[i].bitmap_id,
1611 bitmap_data, base::Time::Now()); 1615 bitmap_data, base::Time());
1612 replaced_bitmap = true; 1616 replaced_bitmap = true;
1613 } 1617 }
1614 break; 1618 break;
1615 } 1619 }
1616 } 1620 }
1617 1621
1618 // Create a vector of the pixel sizes of the favicon bitmaps currently at 1622 // Create a vector of the pixel sizes of the favicon bitmaps currently at
1619 // |icon_url|. 1623 // |icon_url|.
1620 std::vector<gfx::Size> favicon_sizes; 1624 std::vector<gfx::Size> favicon_sizes;
1621 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i) 1625 for (size_t i = 0; i < bitmap_id_sizes.size(); ++i)
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
2635 return true; 2639 return true;
2636 } 2640 }
2637 2641
2638 HistoryClient* HistoryBackend::GetHistoryClient() { 2642 HistoryClient* HistoryBackend::GetHistoryClient() {
2639 if (history_client_) 2643 if (history_client_)
2640 history_client_->BlockUntilBookmarksLoaded(); 2644 history_client_->BlockUntilBookmarksLoaded();
2641 return history_client_; 2645 return history_client_;
2642 } 2646 }
2643 2647
2644 } // namespace history 2648 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/browser/BUILD.gn ('k') | components/history/core/browser/thumbnail_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698