| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_SEARCH_HOST_TO_URLS_MAP_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_SEARCH_HOST_TO_URLS_MAP_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_HOST_TO_URLS_MAP_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_HOST_TO_URLS_MAP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Initializes the map. | 26 // Initializes the map. |
| 27 void Init(const TemplateURLService::TemplateURLVector& template_urls, | 27 void Init(const TemplateURLService::TemplateURLVector& template_urls, |
| 28 const SearchTermsData& search_terms_data); | 28 const SearchTermsData& search_terms_data); |
| 29 | 29 |
| 30 // Adds a new TemplateURL to the map. Since |template_url| is owned | 30 // Adds a new TemplateURL to the map. Since |template_url| is owned |
| 31 // externally, Remove or RemoveAll should be called if it becomes invalid. | 31 // externally, Remove or RemoveAll should be called if it becomes invalid. |
| 32 void Add(TemplateURL* template_url, | 32 void Add(TemplateURL* template_url, |
| 33 const SearchTermsData& search_terms_data); | 33 const SearchTermsData& search_terms_data); |
| 34 | 34 |
| 35 // Removes the TemplateURL from the lookup. | 35 // Removes the TemplateURL from the lookup. |
| 36 void Remove(TemplateURL* template_url); | 36 void Remove(TemplateURL* template_url, |
| 37 | 37 const SearchTermsData& search_terms_data); |
| 38 // Updates all search providers which have a google base url. | |
| 39 void UpdateGoogleBaseURLs(const SearchTermsData& search_terms_data); | |
| 40 | 38 |
| 41 // Returns the first TemplateURL found with a URL using the specified |host|, | 39 // Returns the first TemplateURL found with a URL using the specified |host|, |
| 42 // or NULL if there are no such TemplateURLs | 40 // or NULL if there are no such TemplateURLs |
| 43 TemplateURL* GetTemplateURLForHost(const std::string& host); | 41 TemplateURL* GetTemplateURLForHost(const std::string& host); |
| 44 | 42 |
| 45 // Return the TemplateURLSet for the given the |host| or NULL if there are | 43 // Return the TemplateURLSet for the given the |host| or NULL if there are |
| 46 // none. | 44 // none. |
| 47 TemplateURLSet* GetURLsForHost(const std::string& host); | 45 TemplateURLSet* GetURLsForHost(const std::string& host); |
| 48 | 46 |
| 49 private: | 47 private: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 66 // The security origin for the default search provider. | 64 // The security origin for the default search provider. |
| 67 std::string default_search_origin_; | 65 std::string default_search_origin_; |
| 68 | 66 |
| 69 // Has Init been called? | 67 // Has Init been called? |
| 70 bool initialized_; | 68 bool initialized_; |
| 71 | 69 |
| 72 DISALLOW_COPY_AND_ASSIGN(SearchHostToURLsMap); | 70 DISALLOW_COPY_AND_ASSIGN(SearchHostToURLsMap); |
| 73 }; | 71 }; |
| 74 | 72 |
| 75 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_HOST_TO_URLS_MAP_H_ | 73 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_HOST_TO_URLS_MAP_H_ |
| OLD | NEW |