diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-29 17:16:13 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-29 17:16:13 +0000 |
commit | e36ee2522d4c0e980807c39403deafdc7739e9f1 (patch) | |
tree | 848deff63bcb353cf6142fe340320745250a87e8 /chrome/browser/search_engines/search_host_to_urls_map.h | |
parent | c679be260c4a87f9daad3ab3110bf44395732f8b (diff) | |
download | chromium_src-e36ee2522d4c0e980807c39403deafdc7739e9f1.zip chromium_src-e36ee2522d4c0e980807c39403deafdc7739e9f1.tar.gz chromium_src-e36ee2522d4c0e980807c39403deafdc7739e9f1.tar.bz2 |
Add code to get the search provider install state.
BUG=38475
TEST=unit_test --gtest_filter=SearchHost*
Review URL: http://codereview.chromium.org/3269001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines/search_host_to_urls_map.h')
-rw-r--r-- | chrome/browser/search_engines/search_host_to_urls_map.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/search_engines/search_host_to_urls_map.h b/chrome/browser/search_engines/search_host_to_urls_map.h index 1a22ddc..90ae63d 100644 --- a/chrome/browser/search_engines/search_host_to_urls_map.h +++ b/chrome/browser/search_engines/search_host_to_urls_map.h @@ -15,6 +15,7 @@ #include "base/lock.h" #include "base/thread_checker.h" #include "base/ref_counted.h" +#include "chrome/browser/search_engines/search_provider_install_data.h" class FilePath; class GURL; @@ -23,13 +24,12 @@ class TemplateURL; class WebDataService; // Holds the host to template url mappings for the search providers. All public -// methods should happen from the same thread except for -// GetSearchProviderInstallState which may be invoked on any thread. -// WARNING: This class does not own any TemplateURLs passed to it and it is -// up to the caller to ensure the right lifetime of them. -// TODO(levin): Add GetSearchProviderInstallState. +// methods should happen from the same thread except for GetInstallState which +// may be invoked on any thread. WARNING: This class does not own any +// TemplateURLs passed to it and it is up to the caller to ensure the right +// lifetime of them. class SearchHostToURLsMap - : public base::RefCountedThreadSafe<SearchHostToURLsMap>, + : public SearchProviderInstallData, public ThreadChecker { public: typedef std::set<const TemplateURL*> TemplateURLSet; @@ -70,13 +70,17 @@ class SearchHostToURLsMap // none. const TemplateURLSet* GetURLsForHost(const std::string& host) const; + // Returns the search provider install state for the given origin. + // This method may be called on any thread. + // TODO(levin): Make the above statement true about "any thread". + virtual State GetInstallState(const GURL& requested_origin); + private: - friend class base::RefCountedThreadSafe<SearchHostToURLsMap>; friend class SearchHostToURLsMapTest; typedef std::map<std::string, TemplateURLSet> HostToURLsMap; - ~SearchHostToURLsMap(); + virtual ~SearchHostToURLsMap(); // Same as Add but the lock should already be taken. void AddNoLock(const TemplateURL* template_url); |