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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_
6 #define CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_
10 #include "base/android/scoped_java_ref.h"
11 #include "base/compiler_specific.h"
12 #include "chrome/browser/profiles/profile.h"
13 #include "content/public/browser/notification_observer.h"
14 #include "content/public/browser/notification_registrar.h"
16 // Provides the list of most visited sites and their thumbnails to Java.
17 class MostVisitedSites
: public content::NotificationObserver
{
19 explicit MostVisitedSites(Profile
* profile
);
20 void Destroy(JNIEnv
* env
, jobject obj
);
21 void SetMostVisitedURLsObserver(JNIEnv
* env
,
25 void GetURLThumbnail(JNIEnv
* env
,
29 void BlacklistUrl(JNIEnv
* env
, jobject obj
, jstring j_url
);
31 // content::NotificationObserver implementation.
32 virtual void Observe(int type
,
33 const content::NotificationSource
& source
,
34 const content::NotificationDetails
& details
) OVERRIDE
;
36 // Registers JNI methods.
37 static bool Register(JNIEnv
* env
);
40 virtual ~MostVisitedSites();
41 void QueryMostVisitedURLs();
43 // The profile whose most visited sites will be queried.
46 // The observer to be notified when the list of most visited sites changes.
47 base::android::ScopedJavaGlobalRef
<jobject
> observer_
;
49 // The maximum number of most visited sites to return.
52 content::NotificationRegistrar registrar_
;
54 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites
);
57 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_