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

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: respond to newt's comments 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..ccefe492996f3744ccc4092da226f6e3aae732b2 100644
--- a/chrome/browser/android/logo_bridge.h
+++ b/chrome/browser/android/logo_bridge.h
@@ -7,23 +7,50 @@
#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);
+ jboolean GetAnimatedLogo(JNIEnv* env,
+ jobject obj,
newt (away) 2015/09/23 20:38:44 indentation
Ian Wen 2015/09/23 21:59:52 Done.
+ 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 logo. NULL when not fetching.
newt (away) 2015/09/23 20:38:44 s/logo/animated logo/
Ian Wen 2015/09/23 21:59:52 Done.
+ scoped_ptr<net::URLFetcher> fetcher_;
+
+ // The URLRequestContextGetter used for network requests.
newt (away) 2015/09/23 20:38:43 "... used to download the animated logo."
Ian Wen 2015/09/23 21:59:52 Done.
+ scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
+
+ base::android::ScopedJavaGlobalRef<jobject> j_callback_;
+
base::WeakPtrFactory<LogoBridge> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(LogoBridge);

Powered by Google App Engine
This is Rietveld 408576698