OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TEMPLATE_URL_MODEL_H__ | 5 #ifndef CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ |
6 #define CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ | 6 #define CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // This exists and is virtual for testing. | 205 // This exists and is virtual for testing. |
206 virtual void SetKeywordSearchTermsForURL(const TemplateURL* t_url, | 206 virtual void SetKeywordSearchTermsForURL(const TemplateURL* t_url, |
207 const GURL& url, | 207 const GURL& url, |
208 const std::wstring& term); | 208 const std::wstring& term); |
209 | 209 |
210 private: | 210 private: |
211 FRIEND_TEST(TemplateURLModelTest, BuildQueryTerms); | 211 FRIEND_TEST(TemplateURLModelTest, BuildQueryTerms); |
212 FRIEND_TEST(TemplateURLModelTest, UpdateKeywordSearchTermsForURL); | 212 FRIEND_TEST(TemplateURLModelTest, UpdateKeywordSearchTermsForURL); |
213 FRIEND_TEST(TemplateURLModelTest, DontUpdateKeywordSearchForNonReplaceable); | 213 FRIEND_TEST(TemplateURLModelTest, DontUpdateKeywordSearchForNonReplaceable); |
214 FRIEND_TEST(TemplateURLModelTest, ChangeGoogleBaseValue); | 214 FRIEND_TEST(TemplateURLModelTest, ChangeGoogleBaseValue); |
| 215 FRIEND_TEST(TemplateURLModelTest, MergeDeletesUnusedProviders); |
215 friend class TemplateURLModelTest; | 216 friend class TemplateURLModelTest; |
216 | 217 |
217 typedef std::map<std::wstring, const TemplateURL*> KeywordToTemplateMap; | 218 typedef std::map<std::wstring, const TemplateURL*> KeywordToTemplateMap; |
218 typedef std::vector<const TemplateURL*> TemplateURLVector; | 219 typedef std::vector<const TemplateURL*> TemplateURLVector; |
219 typedef std::set<const TemplateURL*> TemplateURLSet; | 220 typedef std::set<const TemplateURL*> TemplateURLSet; |
220 typedef std::map<std::string, TemplateURLSet> HostToURLsMap; | 221 typedef std::map<std::string, TemplateURLSet> HostToURLsMap; |
221 | 222 |
222 // Helper functor for FindMatchingKeywords(), for finding the range of | 223 // Helper functor for FindMatchingKeywords(), for finding the range of |
223 // keywords which begin with a prefix. | 224 // keywords which begin with a prefix. |
224 class LessWithPrefix; | 225 class LessWithPrefix; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 scoped_ptr<TemplateURL> prefs_default_search_provider_; | 345 scoped_ptr<TemplateURL> prefs_default_search_provider_; |
345 | 346 |
346 // ID assigned to next TemplateURL added to this model. This is an ever | 347 // ID assigned to next TemplateURL added to this model. This is an ever |
347 // increasing integer that is initialized from the database. | 348 // increasing integer that is initialized from the database. |
348 TemplateURL::IDType next_id_; | 349 TemplateURL::IDType next_id_; |
349 | 350 |
350 DISALLOW_EVIL_CONSTRUCTORS(TemplateURLModel); | 351 DISALLOW_EVIL_CONSTRUCTORS(TemplateURLModel); |
351 }; | 352 }; |
352 | 353 |
353 #endif // CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ | 354 #endif // CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ |
OLD | NEW |