Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / android / most_visited_sites.h
bloba9bee0f71e635f71d511c61b032cc92fb0b07e22
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_
8 #include <jni.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 {
18 public:
19 explicit MostVisitedSites(Profile* profile);
20 void Destroy(JNIEnv* env, jobject obj);
21 void SetMostVisitedURLsObserver(JNIEnv* env,
22 jobject obj,
23 jobject j_observer,
24 jint num_sites);
25 void GetURLThumbnail(JNIEnv* env,
26 jobject obj,
27 jstring url,
28 jobject j_callback);
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);
39 private:
40 virtual ~MostVisitedSites();
41 void QueryMostVisitedURLs();
43 // The profile whose most visited sites will be queried.
44 Profile* profile_;
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.
50 int num_sites_;
52 content::NotificationRegistrar registrar_;
54 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites);
57 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_