large_icon_bridge.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2015 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.
  4. #ifndef COMPONENTS_FAVICON_ANDROID_LARGE_ICON_BRIDGE_H_
  5. #define COMPONENTS_FAVICON_ANDROID_LARGE_ICON_BRIDGE_H_
  6. #include <jni.h>
  7. #include "base/android/scoped_java_ref.h"
  8. #include "base/task/cancelable_task_tracker.h"
  9. namespace favicon {
  10. // The C++ counterpart to Java's LargeIconBridge. Together these classes expose
  11. // LargeIconService to Java.
  12. class LargeIconBridge {
  13. public:
  14. LargeIconBridge();
  15. LargeIconBridge(const LargeIconBridge& bridge) = delete;
  16. LargeIconBridge& operator=(const LargeIconBridge& bridge) = delete;
  17. void Destroy(JNIEnv* env);
  18. jboolean GetLargeIconForURL(
  19. JNIEnv* env,
  20. const base::android::JavaParamRef<jobject>& j_browser_context,
  21. const base::android::JavaParamRef<jobject>& j_page_url,
  22. jint min_source_size_px,
  23. const base::android::JavaParamRef<jobject>& j_callback);
  24. private:
  25. virtual ~LargeIconBridge();
  26. base::CancelableTaskTracker cancelable_task_tracker_;
  27. };
  28. } // namespace favicon
  29. #endif // COMPONENTS_FAVICON_ANDROID_LARGE_ICON_BRIDGE_H_