summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/android/navigation_popup.h
blob: 094143ceccf96ad6c1d8e848d8a6dee17b354d49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_ANDROID_NAVIGATION_POPUP_H_
#define CHROME_BROWSER_UI_ANDROID_NAVIGATION_POPUP_H_

#include <jni.h>

#include "base/android/jni_weak_ref.h"
#include "base/basictypes.h"
#include "base/task/cancelable_task_tracker.h"

class GURL;

namespace favicon_base {
struct FaviconImageResult;
}

// The native bridge for the history navigation popup that provides additional
// functionality to the UI widget.
class NavigationPopup {
 public:
  NavigationPopup(JNIEnv* env, jobject obj);

  void Destroy(JNIEnv* env, jobject obj);
  void FetchFaviconForUrl(JNIEnv* env, jobject obj, jstring jurl);

  void OnFaviconDataAvailable(
      GURL navigation_entry_url,
      const favicon_base::FaviconImageResult& image_result);

  static bool RegisterNavigationPopup(JNIEnv* env);

 protected:
  virtual ~NavigationPopup();

 private:
  JavaObjectWeakGlobalRef weak_jobject_;

  base::CancelableTaskTracker cancelable_task_tracker_;

  DISALLOW_COPY_AND_ASSIGN(NavigationPopup);
};

#endif  // CHROME_BROWSER_UI_ANDROID_NAVIGATION_POPUP_H_