OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ |
6 #define CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ | 6 #define CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/files/file_path.h" | |
16 #include "base/macros.h" | 17 #include "base/macros.h" |
17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
19 #include "base/scoped_observer.h" | 20 #include "base/scoped_observer.h" |
20 #include "chrome/browser/supervised_user/supervised_user_service.h" | 21 #include "chrome/browser/supervised_user/supervised_user_service.h" |
21 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" | 22 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" |
22 #include "components/history/core/browser/history_types.h" | 23 #include "components/history/core/browser/history_types.h" |
23 #include "components/history/core/browser/top_sites_observer.h" | 24 #include "components/history/core/browser/top_sites_observer.h" |
24 #include "components/suggestions/proto/suggestions.pb.h" | 25 #include "components/suggestions/proto/suggestions.pb.h" |
25 #include "components/sync_driver/sync_service_observer.h" | 26 #include "components/sync_driver/sync_service_observer.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 82 |
82 private: | 83 private: |
83 friend class MostVisitedSitesTest; | 84 friend class MostVisitedSitesTest; |
84 | 85 |
85 // The source of the Most Visited sites. | 86 // The source of the Most Visited sites. |
86 enum MostVisitedSource { TOP_SITES, SUGGESTIONS_SERVICE, POPULAR, WHITELIST }; | 87 enum MostVisitedSource { TOP_SITES, SUGGESTIONS_SERVICE, POPULAR, WHITELIST }; |
87 | 88 |
88 struct Suggestion { | 89 struct Suggestion { |
89 base::string16 title; | 90 base::string16 title; |
90 GURL url; | 91 GURL url; |
92 base::FilePath local_large_icon_path; | |
Marc Treib
2016/03/08 14:27:12
Maybe add a comment that this will usually be empt
atanasova
2016/03/08 15:53:58
Done.
| |
91 MostVisitedSource source; | 93 MostVisitedSource source; |
92 // Only valid for source == SUGGESTIONS_SERVICE (-1 otherwise). | 94 // Only valid for source == SUGGESTIONS_SERVICE (-1 otherwise). |
93 int provider_index; | 95 int provider_index; |
94 | 96 |
95 Suggestion(const base::string16& title, | 97 Suggestion(const base::string16& title, |
96 const std::string& url, | 98 const std::string& url, |
97 MostVisitedSource source); | 99 MostVisitedSource source); |
98 Suggestion(const base::string16& title, | 100 Suggestion(const base::string16& title, |
99 const GURL& url, | 101 const GURL& url, |
102 const base::FilePath& local_large_icon_path, | |
103 MostVisitedSource source); | |
104 Suggestion(const base::string16& title, | |
105 const GURL& url, | |
100 MostVisitedSource source); | 106 MostVisitedSource source); |
101 Suggestion(const base::string16& title, | 107 Suggestion(const base::string16& title, |
102 const std::string& url, | 108 const std::string& url, |
103 MostVisitedSource source, | 109 MostVisitedSource source, |
104 int provider_index); | 110 int provider_index); |
105 ~Suggestion(); | 111 ~Suggestion(); |
106 | 112 |
107 // Get the Histogram name associated with the source. | 113 // Get the Histogram name associated with the source. |
108 std::string GetSourceHistogramName() const; | 114 std::string GetSourceHistogramName() const; |
109 | 115 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 | 243 |
238 SuggestionsVector current_suggestions_; | 244 SuggestionsVector current_suggestions_; |
239 | 245 |
240 // For callbacks may be run after destruction. | 246 // For callbacks may be run after destruction. |
241 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 247 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
242 | 248 |
243 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 249 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
244 }; | 250 }; |
245 | 251 |
246 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ | 252 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ |
OLD | NEW |