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

Unified Diff: chrome/browser/search_engines/template_url_service_android.h

Issue 23710022: Convert NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED to CallbackList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/search_engines/template_url_service_android.h
diff --git a/chrome/browser/search_engines/template_url_service_android.h b/chrome/browser/search_engines/template_url_service_android.h
index f2543b7a92ca9410de1febaa1cff6636dad9ac9b..761e2460748719c7fd1149b97454686f27d6aae6 100644
--- a/chrome/browser/search_engines/template_url_service_android.h
+++ b/chrome/browser/search_engines/template_url_service_android.h
@@ -7,17 +7,16 @@
#include "base/android/jni_helper.h"
#include "base/android/scoped_java_ref.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/search_engines/template_url_service.h"
class TemplateURL;
-class TemplateURLService;
// Android wrapper of the TemplateUrlService which provides access from the Java
// layer. Note that on Android, there's only a single profile, and therefore
// a single instance of this wrapper.
-class TemplateUrlServiceAndroid : public content::NotificationObserver {
+class TemplateUrlServiceAndroid {
public:
TemplateUrlServiceAndroid(JNIEnv* env, jobject obj);
@@ -41,24 +40,22 @@ class TemplateUrlServiceAndroid : public content::NotificationObserver {
jstring jquery,
jstring jcurrent_url);
- // NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
static bool Register(JNIEnv* env);
private:
- virtual ~TemplateUrlServiceAndroid();
+ ~TemplateUrlServiceAndroid();
bool IsPrepopulatedTemplate(TemplateURL* url);
+ void OnTemplateURLServiceLoaded();
+
JavaObjectWeakGlobalRef weak_java_obj_;
- content::NotificationRegistrar registrar_;
// Pointer to the TemplateUrlService for the main profile.
TemplateURLService* template_url_service_;
+ scoped_ptr<TemplateURLService::Subscription> template_url_subscription_;
+
DISALLOW_COPY_AND_ASSIGN(TemplateUrlServiceAndroid);
};
« no previous file with comments | « chrome/browser/search_engines/template_url_service.cc ('k') | chrome/browser/search_engines/template_url_service_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698