| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEMPLATE_URL_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // not want to auto-add keywords, such as keywords for searches on pages that | 84 // not want to auto-add keywords, such as keywords for searches on pages that |
| 85 // themselves come from form submissions. | 85 // themselves come from form submissions. |
| 86 static string16 GenerateKeyword(const GURL& url, bool autodetected); | 86 static string16 GenerateKeyword(const GURL& url, bool autodetected); |
| 87 | 87 |
| 88 // Removes any unnecessary characters from a user input keyword. | 88 // Removes any unnecessary characters from a user input keyword. |
| 89 // This removes the leading scheme, "www." and any trailing slash. | 89 // This removes the leading scheme, "www." and any trailing slash. |
| 90 static string16 CleanUserInputKeyword(const string16& keyword); | 90 static string16 CleanUserInputKeyword(const string16& keyword); |
| 91 | 91 |
| 92 // Returns the search url for t_url. Returns an empty GURL if t_url has no | 92 // Returns the search url for t_url. Returns an empty GURL if t_url has no |
| 93 // url(). | 93 // url(). |
| 94 static GURL GenerateSearchURL(const TemplateURL* t_url); | 94 static GURL GenerateSearchURL(const TemplateURL* t_url, Profile* profile); |
| 95 | 95 |
| 96 // Just like GenerateSearchURL except that it takes SearchTermsData to supply | 96 // Just like GenerateSearchURL except that it takes SearchTermsData to supply |
| 97 // the data for some search terms. Most of the time GenerateSearchURL should | 97 // the data for some search terms. Most of the time GenerateSearchURL should |
| 98 // be called. | 98 // be called. |
| 99 static GURL GenerateSearchURLUsingTermsData( | 99 static GURL GenerateSearchURLUsingTermsData( |
| 100 const TemplateURL* t_url, | 100 const TemplateURL* t_url, |
| 101 const SearchTermsData& search_terms_data); | 101 const SearchTermsData& search_terms_data); |
| 102 | 102 |
| 103 // Returns true if there is no TemplateURL that conflicts with the | 103 // Returns true if there is no TemplateURL that conflicts with the |
| 104 // keyword/url pair, or there is one but it can be replaced. If there is an | 104 // keyword/url pair, or there is one but it can be replaced. If there is an |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 // List of extension IDs waiting for Load to have keywords registered. | 454 // List of extension IDs waiting for Load to have keywords registered. |
| 455 std::vector<std::string> pending_extension_ids_; | 455 std::vector<std::string> pending_extension_ids_; |
| 456 | 456 |
| 457 // Function returning current time in base::Time units. | 457 // Function returning current time in base::Time units. |
| 458 TimeProvider* time_provider_; | 458 TimeProvider* time_provider_; |
| 459 | 459 |
| 460 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 460 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 461 }; | 461 }; |
| 462 | 462 |
| 463 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 463 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |