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

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

Issue 2749813002: [Doodle] Hook up LogoBridge to the new DoodleService (Closed)
Patch Set: disable by default Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/android/logo_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/logo_bridge.h
diff --git a/chrome/browser/android/logo_bridge.h b/chrome/browser/android/logo_bridge.h
index 368a8c337694fd2bf27e758e3dcfb631d2b062ca..71d8784502fb758b006ff26f9d0326f7bdbdb52e 100644
--- a/chrome/browser/android/logo_bridge.h
+++ b/chrome/browser/android/logo_bridge.h
@@ -7,15 +7,32 @@
#include <jni.h>
+#include <memory>
+
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
+#include "base/scoped_observer.h"
+#include "components/doodle/doodle_service.h"
class LogoService;
+namespace doodle {
+class DoodleService;
+} // namespace doodle
+
+namespace gfx {
+class Image;
+} // namespace gfx
+
+namespace image_fetcher {
+class ImageFetcher;
+} // namespace image_fetcher
+
// The C++ counterpart to LogoBridge.java. Enables Java code to access the
// default search provider's logo.
-class LogoBridge {
+class LogoBridge : public doodle::DoodleService::Observer {
public:
explicit LogoBridge(jobject j_profile);
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
@@ -39,10 +56,33 @@ class LogoBridge {
private:
class AnimatedLogoFetcher;
- ~LogoBridge();
+ virtual ~LogoBridge();
+ // doodle::DoodleService::Observer implementation.
+ void OnDoodleConfigUpdated(
+ const base::Optional<doodle::DoodleConfig>& maybe_doodle_config) override;
+
+ void DoodleConfigReceived(
+ const base::Optional<doodle::DoodleConfig>& maybe_doodle_config,
+ bool from_cache);
+
+ void DoodleImageFetched(bool config_from_cache,
+ const GURL& on_click_url,
+ const std::string& alt_text,
+ const GURL& animated_image_url,
+ const std::string& image_fetch_id,
+ const gfx::Image& image);
+
+ // Only valid if UseNewDoodleApi is disabled.
LogoService* logo_service_;
+ // Only valid if UseNewDoodleApi is enabled.
+ doodle::DoodleService* doodle_service_;
+ std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher_;
+ base::android::ScopedJavaGlobalRef<jobject> j_logo_observer_;
+ ScopedObserver<doodle::DoodleService, doodle::DoodleService::Observer>
+ doodle_observer_;
+
std::unique_ptr<AnimatedLogoFetcher> animated_logo_fetcher_;
base::WeakPtrFactory<LogoBridge> weak_ptr_factory_;
« no previous file with comments | « no previous file | chrome/browser/android/logo_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698