OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Adds a new TemplateURL to this model. TemplateURLModel will own the | 116 // Adds a new TemplateURL to this model. TemplateURLModel will own the |
117 // reference, and delete it when the TemplateURL is removed. | 117 // reference, and delete it when the TemplateURL is removed. |
118 void Add(TemplateURL* template_url); | 118 void Add(TemplateURL* template_url); |
119 | 119 |
120 // Removes the keyword from the model. This deletes the supplied TemplateURL. | 120 // Removes the keyword from the model. This deletes the supplied TemplateURL. |
121 // This fails if the supplied template_url is the default search provider. | 121 // This fails if the supplied template_url is the default search provider. |
122 void Remove(const TemplateURL* template_url); | 122 void Remove(const TemplateURL* template_url); |
123 | 123 |
124 // Removes all auto-generated keywords that were created in the specified | 124 // Removes all auto-generated keywords that were created in the specified |
125 // range. | 125 // range. |
126 void RemoveAutoGeneratedBetween(Time created_after, Time created_before); | 126 void RemoveAutoGeneratedBetween(base::Time created_after, base::Time created_b
efore); |
127 | 127 |
128 // Replaces existing_turl with new_turl. new_turl is given the same ID as | 128 // Replaces existing_turl with new_turl. new_turl is given the same ID as |
129 // existing_turl. If existing_turl was the default, new_turl is made the | 129 // existing_turl. If existing_turl was the default, new_turl is made the |
130 // default. After this call existing_turl is deleted. As with Add, | 130 // default. After this call existing_turl is deleted. As with Add, |
131 // TemplateURLModel takes ownership of existing_turl. | 131 // TemplateURLModel takes ownership of existing_turl. |
132 void Replace(const TemplateURL* existing_turl, | 132 void Replace(const TemplateURL* existing_turl, |
133 TemplateURL* new_turl); | 133 TemplateURL* new_turl); |
134 | 134 |
135 // Removes all auto-generated keywords that were created on or after the | 135 // Removes all auto-generated keywords that were created on or after the |
136 // date passed in. | 136 // date passed in. |
137 void RemoveAutoGeneratedSince(Time created_after); | 137 void RemoveAutoGeneratedSince(base::Time created_after); |
138 | 138 |
139 // Returns the set of URLs describing the keywords. The elements are owned | 139 // Returns the set of URLs describing the keywords. The elements are owned |
140 // by TemplateURLModel and should not be deleted. | 140 // by TemplateURLModel and should not be deleted. |
141 std::vector<const TemplateURL*> GetTemplateURLs() const; | 141 std::vector<const TemplateURL*> GetTemplateURLs() const; |
142 | 142 |
143 // Increment the usage count of a keyword. | 143 // Increment the usage count of a keyword. |
144 // Called when a URL is loaded that was generated from a keyword. | 144 // Called when a URL is loaded that was generated from a keyword. |
145 void IncrementUsageCount(const TemplateURL* url); | 145 void IncrementUsageCount(const TemplateURL* url); |
146 | 146 |
147 // Resets the title, keyword and search url of the specified TemplateURL. | 147 // Resets the title, keyword and search url of the specified TemplateURL. |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 // ID assigned to next TemplateURL added to this model. This is an ever | 340 // ID assigned to next TemplateURL added to this model. This is an ever |
341 // increasing integer that is initialized from the database. | 341 // increasing integer that is initialized from the database. |
342 TemplateURL::IDType next_id_; | 342 TemplateURL::IDType next_id_; |
343 | 343 |
344 DISALLOW_EVIL_CONSTRUCTORS(TemplateURLModel); | 344 DISALLOW_EVIL_CONSTRUCTORS(TemplateURLModel); |
345 }; | 345 }; |
346 | 346 |
347 #endif // CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ | 347 #endif // CHROME_BROWSER_TEMPLATE_URL_MODEL_H__ |
348 | 348 |
OLD | NEW |