Home | History | Annotate | Download | only in history

Lines Matching refs:url

95       const GURL& url = data_.most_visited[i].url;
96 if (ShouldFetchThumbnailFor(url)) {
98 backend->GetPageThumbnailDirectly(url, &data);
99 data_.url_to_thumbnail_map[url] = data;
110 bool ShouldFetchThumbnailFor(const GURL& url) {
111 return ignore_urls_.find(url.spec()) == ignore_urls_.end();
185 bool TopSites::SetPageThumbnail(const GURL& url,
197 if (!IsKnownURL(url)) {
201 return false; // This URL is not known to us.
205 if (!HistoryService::CanAddURL(url))
215 RemoveTemporaryThumbnailByURL(url);
216 AddTemporaryThumbnail(url, thumbnail_data, score);
220 return SetPageThumbnailEncoded(url, thumbnail_data, score);
246 bool TopSites::GetPageThumbnail(const GURL& url,
250 return thread_safe_cache_->GetPageThumbnail(url, bytes);
253 bool TopSites::GetPageThumbnailScore(const GURL& url,
257 return thread_safe_cache_->GetPageThumbnailScore(url, score);
260 bool TopSites::GetTemporaryPageThumbnailScore(const GURL& url,
264 if (i->first == url) {
273 // Returns the index of |url| in |urls|, or -1 if not found.
274 static int IndexOf(const MostVisitedURLList& urls, const GURL& url) {
276 if (urls[i].url == url)
305 data.url_to_thumbnail_map.find(data.most_visited[i].url);
307 SetPageThumbnailEncoded(data.most_visited[i].url,
347 void TopSites::AddBlacklistedURL(const GURL& url) {
350 RemovePinnedURL(url);
356 blacklist->SetWithoutPathExpansion(GetURLHash(url), dummy);
362 void TopSites::RemoveBlacklistedURL(const GURL& url) {
368 blacklist->RemoveWithoutPathExpansion(GetURLHash(url), NULL);
373 bool TopSites::IsBlacklisted(const GURL& url) {
375 return blacklist_->HasKey(GetURLHash(url));
389 void TopSites::AddPinnedURL(const GURL& url, size_t pinned_index) {
396 if (IsURLPinned(url))
397 RemovePinnedURL(url);
405 pinned_urls->SetWithoutPathExpansion(GetURLString(url), index);
411 bool TopSites::IsURLPinned(const GURL& url) {
413 return pinned_urls_->GetIntegerWithoutPathExpansion(GetURLString(url), &tmp);
416 void TopSites::RemovePinnedURL(const GURL& url) {
423 pinned_urls->RemoveWithoutPathExpansion(GetURLString(url), NULL);
429 bool TopSites::GetPinnedURLAtIndex(size_t index, GURL* url) {
435 *url = GURL(*it);
460 all_old_urls[old_list[i].url] = i;
468 std::map<GURL, size_t>::iterator found = all_old_urls.find(new_list[i].url);
471 added.url = new_list[i];
477 moved.url = new_list[i];
486 // there wasn't a "new" URL that mapped to it, so it was deleted.
511 bool TopSites::IsKnownURL(const GURL& url) {
512 return loaded_ && cache_->IsKnownURL(url);
522 bool TopSites::SetPageThumbnailNoDB(const GURL& url,
525 // This should only be invoked when we know about the url.
526 DCHECK(cache_->IsKnownURL(url));
529 cache_->top_sites()[cache_->GetURLIndex(url)];
530 Images* image = cache_->GetImage(url);
537 GetRedirectDistanceForURL(most_visited, url);
551 bool TopSites::SetPageThumbnailEncoded(const GURL& url,
554 if (!SetPageThumbnailNoDB(url, thumbnail, score))
558 if (!cache_->IsKnownURL(url))
561 size_t index = cache_->GetURLIndex(url);
565 *(cache_->GetImage(most_visited.url)));
589 void TopSites::RemoveTemporaryThumbnailByURL(const GURL& url) {
592 if (i->first == url) {
599 void TopSites::AddTemporaryThumbnail(const GURL& url,
606 image.first = url;
618 const GURL& url) {
620 if (most_visited.redirects[i] == url)
623 NOTREACHED() << "URL should always be found.";
632 MostVisitedURL& url = urls[i];
633 url.url = GURL(l10n_util::GetStringUTF8(kPrepopulatePageIDs[i]));
634 url.redirects.push_back(url.url);
635 url.favicon_url = GURL(kPrepopulateFaviconURLs[i]);
636 url.title = l10n_util::GetStringUTF16(kPrepopulateTitleIDs[i]);
647 IndexOf(*urls, prepopulate_urls[i].url) == -1) {
669 if (dict->GetString("url", &url_string) &&
691 if (!IsBlacklisted(urls[i].url))
696 GURL url;
697 bool found = GetPinnedURLAtIndex(pinned_index, &url);
701 DCHECK(!url.is_empty());
702 int cur_index = IndexOf(urls_copy, url);
705 // Pinned URL not in urls.
706 tmp.url = url;
724 if ((*out)[i].url.is_empty()) {
735 std::string TopSites::GetURLString(const GURL& url) {
736 return cache_->GetCanonicalURL(url).spec();
739 std::string TopSites::GetURLHash(const GURL& url) {
742 return MD5String(url.spec());
794 RemovePinnedURL(new_top_sites[index].url);
806 const GURL& url = load_details->entry->url();
807 if (!cache_->IsKnownURL(url) && HistoryService::CanAddURL(url)) {
808 // To avoid slamming history we throttle requests when the url updates.
838 GURL canonical_url = cache_->GetCanonicalURL(mv.url);
844 SetPageThumbnailEncoded(mv.url,