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

Side by Side Diff: chrome/browser/android/most_visited_sites.h

Issue 1772363002: Start using the whitelist icon on the NTP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 4 years, 9 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 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
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 // This will be empty for all suggestions expect whitelist entry points.
newt (away) 2016/03/08 22:09:04 s/expect/except/ Or phrase this as "Only valid fo
atanasova 2016/03/09 11:40:55 Done.
93 base::FilePath large_icon_path;
91 MostVisitedSource source; 94 MostVisitedSource source;
92 // Only valid for source == SUGGESTIONS_SERVICE (-1 otherwise). 95 // Only valid for source == SUGGESTIONS_SERVICE (-1 otherwise).
93 int provider_index; 96 int provider_index;
94 97
95 Suggestion(const base::string16& title, 98 Suggestion(const base::string16& title,
96 const std::string& url, 99 const std::string& url,
97 MostVisitedSource source); 100 MostVisitedSource source);
98 Suggestion(const base::string16& title, 101 Suggestion(const base::string16& title,
99 const GURL& url, 102 const GURL& url,
103 const base::FilePath& large_icon_path,
newt (away) 2016/03/08 22:09:04 for consistency, "large_icon_path" should go after
atanasova 2016/03/09 11:40:56 Done.
104 MostVisitedSource source);
105 Suggestion(const base::string16& title,
106 const GURL& url,
100 MostVisitedSource source); 107 MostVisitedSource source);
101 Suggestion(const base::string16& title, 108 Suggestion(const base::string16& title,
102 const std::string& url, 109 const std::string& url,
103 MostVisitedSource source, 110 MostVisitedSource source,
104 int provider_index); 111 int provider_index);
105 ~Suggestion(); 112 ~Suggestion();
106 113
107 // Get the Histogram name associated with the source. 114 // Get the Histogram name associated with the source.
108 std::string GetSourceHistogramName() const; 115 std::string GetSourceHistogramName() const;
109 116
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 244
238 SuggestionsVector current_suggestions_; 245 SuggestionsVector current_suggestions_;
239 246
240 // For callbacks may be run after destruction. 247 // For callbacks may be run after destruction.
241 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; 248 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_;
242 249
243 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); 250 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites);
244 }; 251 };
245 252
246 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ 253 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698