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

Side by Side Diff: chrome/browser/history/history_backend.cc

Issue 8469018: Provide assumed favicon for intents if service provider page was never visited. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed review issues. Fixed merge issues due to MaybeShowIntentInfoBar Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/history_backend.h" 5 #include "chrome/browser/history/history_backend.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 &icon_mappings)) 1652 &icon_mappings))
1653 return; 1653 return;
1654 1654
1655 for (std::vector<IconMapping>::iterator m = icon_mappings.begin(); 1655 for (std::vector<IconMapping>::iterator m = icon_mappings.begin();
1656 m != icon_mappings.end(); ++m) { 1656 m != icon_mappings.end(); ++m) {
1657 thumbnail_db_->SetFaviconLastUpdateTime(m->icon_id, Time()); 1657 thumbnail_db_->SetFaviconLastUpdateTime(m->icon_id, Time());
1658 } 1658 }
1659 ScheduleCommit(); 1659 ScheduleCommit();
1660 } 1660 }
1661 1661
1662 void HistoryBackend::CloneFavicon(const GURL& old_page_url,
1663 const GURL& new_page_url) {
1664 if (!thumbnail_db_.get())
1665 return;
1666
1667 thumbnail_db_->CloneIconMapping(old_page_url, new_page_url);
1668 ScheduleCommit();
1669 }
1670
1662 void HistoryBackend::SetImportedFavicons( 1671 void HistoryBackend::SetImportedFavicons(
1663 const std::vector<ImportedFaviconUsage>& favicon_usage) { 1672 const std::vector<ImportedFaviconUsage>& favicon_usage) {
1664 if (!db_.get() || !thumbnail_db_.get()) 1673 if (!db_.get() || !thumbnail_db_.get())
1665 return; 1674 return;
1666 1675
1667 Time now = Time::Now(); 1676 Time now = Time::Now();
1668 1677
1669 // Track all URLs that had their favicons set or updated. 1678 // Track all URLs that had their favicons set or updated.
1670 std::set<GURL> favicons_changed; 1679 std::set<GURL> favicons_changed;
1671 1680
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2303 break; 2312 break;
2304 } 2313 }
2305 } 2314 }
2306 } 2315 }
2307 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name 2316 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name
2308 TimeTicks::Now() - beginning_time); 2317 TimeTicks::Now() - beginning_time);
2309 return success; 2318 return success;
2310 } 2319 }
2311 2320
2312 } // namespace history 2321 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698