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

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

Issue 268643002: Use the DefaultSearchManager as the exclusive authority on DSE, ignoring Web Data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: D'oh. Created 6 years, 7 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/search_provider_install_data.h
diff --git a/chrome/browser/search_engines/search_provider_install_data.h b/chrome/browser/search_engines/search_provider_install_data.h
index dc196eaa55df71bddc5c08a39c5a52fd1d19da32..853e4493e7b8cce4ead52dfbf858a5f6e9ebd337 100644
--- a/chrome/browser/search_engines/search_provider_install_data.h
+++ b/chrome/browser/search_engines/search_provider_install_data.h
@@ -13,11 +13,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/webdata/web_data_service.h"
class GURL;
+class Profile;
class SearchHostToURLsMap;
class TemplateURL;
+class TemplateURLService;
namespace content {
class RenderProcessHost;
@@ -27,7 +28,7 @@ class RenderProcessHost;
// loading the data on demand (when CallWhenLoaded is called) and then throwing
// away the results after the callbacks are done, so the results are always up
// to date with what is in the database.
-class SearchProviderInstallData : public WebDataServiceConsumer {
+class SearchProviderInstallData {
public:
enum State {
// The search provider is not installed.
@@ -61,13 +62,9 @@ class SearchProviderInstallData : public WebDataServiceConsumer {
void OnGoogleURLChange(const std::string& google_base_url);
private:
- // WebDataServiceConsumer
- // Notification that the keywords have been loaded.
- // This is invoked from WebDataService, and should not be directly
- // invoked.
- virtual void OnWebDataServiceRequestDone(
- WebDataService::Handle h,
- const WDTypedResult* result) OVERRIDE;
+ // Receives a copy of the TemplateURLService's keywords on the IO thread.
+ void OnTemplateURLsLoaded(ScopedVector<TemplateURL> template_urls,
+ TemplateURL* default_provider);
// Stores information about the default search provider.
void SetDefault(const TemplateURL* template_url);
@@ -80,14 +77,12 @@ class SearchProviderInstallData : public WebDataServiceConsumer {
// install state has been loaded.
void NotifyLoaded();
- // The list of closures to call after the load has finished.
- std::vector<base::Closure> closure_queue_;
-
- // Service used to store entries.
- scoped_refptr<WebDataService> web_service_;
+ // The original data source. Only accessed on the UI thread.
+ TemplateURLService* template_url_service_;
- // If non-zero, we're waiting on a load.
- WebDataService::Handle load_handle_;
+ // The list of closures to call after the load has finished. If empty, there
+ // is no pending load.
+ std::vector<base::Closure> closure_queue_;
// Holds results of a load that was done using this class.
scoped_ptr<SearchHostToURLsMap> provider_map_;

Powered by Google App Engine
This is Rietveld 408576698