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

Unified Diff: chrome/browser/android/logo_bridge.h

Issue 1343913002: Introduce Animated Logo to Chrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/logo_bridge.h
diff --git a/chrome/browser/android/logo_bridge.h b/chrome/browser/android/logo_bridge.h
index 37d30ee225ca32e80a6ba8b8781500bd41644879..be5b4aa09eefec6002153f3b8613a93372a1b46c 100644
--- a/chrome/browser/android/logo_bridge.h
+++ b/chrome/browser/android/logo_bridge.h
@@ -7,23 +7,51 @@
#include <jni.h>
+#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "net/url_request/url_fetcher_delegate.h"
class LogoService;
+namespace net {
+class URLFetcher;
+class URLRequestContextGetter;
+}
+
// The C++ counterpart to LogoBridge.java. Enables Java code to access the
// default search provider's logo.
-class LogoBridge {
+class LogoBridge : public net::URLFetcherDelegate {
public:
explicit LogoBridge(jobject j_profile);
void Destroy(JNIEnv* env, jobject obj);
void GetCurrentLogo(JNIEnv* env, jobject obj, jobject j_logo_observer);
+ void GetAnimatedLogo(JNIEnv* env,
+ jobject obj,
+ jobject j_callback,
+ jstring j_url);
+
+ // net::URLFetcherDelegate:
+ void OnURLFetchComplete(const net::URLFetcher* source) override;
+
private:
- ~LogoBridge();
+ ~LogoBridge() override;
+
+ // Clears and resets the URLFetcher for animated logo.
+ void ClearFetcher();
LogoService* logo_service_;
+
+ // The URLFetcher currently fetching the animated logo. NULL when not
+ // fetching.
+ scoped_ptr<net::URLFetcher> fetcher_;
+
+ // The URLRequestContextGetter used to download the animated logo.
+ scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
+
+ base::android::ScopedJavaGlobalRef<jobject> j_callback_;
+
base::WeakPtrFactory<LogoBridge> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(LogoBridge);
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java ('k') | chrome/browser/android/logo_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698