OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/top_sites_impl.h" | 5 #include "components/history/core/browser/top_sites_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 68 |
69 // Max number of temporary images we'll cache. See comment above | 69 // Max number of temporary images we'll cache. See comment above |
70 // temp_images_ for details. | 70 // temp_images_ for details. |
71 const size_t kMaxTempTopImages = 8; | 71 const size_t kMaxTempTopImages = 8; |
72 | 72 |
73 const int kDaysOfHistory = 90; | 73 const int kDaysOfHistory = 90; |
74 // Time from startup to first HistoryService query. | 74 // Time from startup to first HistoryService query. |
75 const int64 kUpdateIntervalSecs = 15; | 75 const int64 kUpdateIntervalSecs = 15; |
76 // Intervals between requests to HistoryService. | 76 // Intervals between requests to HistoryService. |
77 const int64 kMinUpdateIntervalMinutes = 1; | 77 const int64 kMinUpdateIntervalMinutes = 1; |
78 #if !defined(OS_IOS) | |
78 const int64 kMaxUpdateIntervalMinutes = 60; | 79 const int64 kMaxUpdateIntervalMinutes = 60; |
80 #else | |
81 // On mobile, having the max at 60 results in the topsites database being | |
sky
2015/05/11 15:10:00
Your comment says mobile, you're ifdef says ios. S
sdefresne
2015/05/11 15:49:21
I don't know. Do you know who I can ask?
| |
82 // not updated often enough since the app isn't usually running for long | |
83 // stretches of time. | |
84 const int64 kMaxUpdateIntervalMinutes = 5; | |
85 #endif // !defined(OS_IOS) | |
79 | 86 |
80 // Use 100 quality (highest quality) because we're very sensitive to | 87 // Use 100 quality (highest quality) because we're very sensitive to |
81 // artifacts for these small sized, highly detailed images. | 88 // artifacts for these small sized, highly detailed images. |
82 const int kTopSitesImageQuality = 100; | 89 const int kTopSitesImageQuality = 100; |
83 | 90 |
84 } // namespace | 91 } // namespace |
85 | 92 |
86 // Initially, histogram is not recorded. | 93 // Initially, histogram is not recorded. |
87 bool TopSitesImpl::histogram_recorded_ = false; | 94 bool TopSitesImpl::histogram_recorded_ = false; |
88 | 95 |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
906 for (std::set<size_t>::reverse_iterator i = indices_to_delete.rbegin(); | 913 for (std::set<size_t>::reverse_iterator i = indices_to_delete.rbegin(); |
907 i != indices_to_delete.rend(); i++) { | 914 i != indices_to_delete.rend(); i++) { |
908 new_top_sites.erase(new_top_sites.begin() + *i); | 915 new_top_sites.erase(new_top_sites.begin() + *i); |
909 } | 916 } |
910 SetTopSites(new_top_sites, CALL_LOCATION_FROM_OTHER_PLACES); | 917 SetTopSites(new_top_sites, CALL_LOCATION_FROM_OTHER_PLACES); |
911 } | 918 } |
912 StartQueryForMostVisited(); | 919 StartQueryForMostVisited(); |
913 } | 920 } |
914 | 921 |
915 } // namespace history | 922 } // namespace history |
OLD | NEW |