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 #include "chrome/browser/template_url_model.h" | 5 #include "chrome/browser/template_url_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "chrome/app/locales/locale_settings.h" | 11 #include "chrome/app/locales/locale_settings.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/google_url_tracker.h" | 13 #include "chrome/browser/google_url_tracker.h" |
14 #include "chrome/browser/history/history.h" | 14 #include "chrome/browser/history/history.h" |
15 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profile.h" |
16 #include "chrome/browser/rlz/rlz.h" | 16 #include "chrome/browser/rlz/rlz.h" |
17 #include "chrome/browser/template_url.h" | 17 #include "chrome/browser/template_url.h" |
18 #include "chrome/browser/template_url_prepopulate_data.h" | 18 #include "chrome/browser/template_url_prepopulate_data.h" |
19 #include "chrome/common/l10n_util.h" | 19 #include "chrome/common/l10n_util.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
21 #include "chrome/common/pref_service.h" | 21 #include "chrome/common/pref_service.h" |
22 #include "chrome/common/stl_util-inl.h" | 22 #include "chrome/common/stl_util-inl.h" |
23 #include "googleurl/src/gurl.h" | 23 #include "googleurl/src/gurl.h" |
24 #include "googleurl/src/url_parse.h" | 24 #include "googleurl/src/url_parse.h" |
25 #include "net/base/net_util.h" | 25 #include "net/base/net_util.h" |
26 #include "unicode/rbbi.h" | 26 #include "unicode/rbbi.h" |
27 #include "unicode/uchar.h" | 27 #include "unicode/uchar.h" |
28 | 28 |
| 29 using base::Time; |
| 30 |
29 // String in the URL that is replaced by the search term. | 31 // String in the URL that is replaced by the search term. |
30 static const wchar_t kSearchTermParameter[] = L"{searchTerms}"; | 32 static const wchar_t kSearchTermParameter[] = L"{searchTerms}"; |
31 | 33 |
32 // String in Initializer that is replaced with kSearchTermParameter. | 34 // String in Initializer that is replaced with kSearchTermParameter. |
33 static const wchar_t kTemplateParameter[](L"%s"); | 35 static const wchar_t kTemplateParameter[](L"%s"); |
34 | 36 |
35 // Term used when generating a search url. Use something obscure so that on | 37 // Term used when generating a search url. Use something obscure so that on |
36 // the rare case the term replaces the URL it's unlikely another keyword would | 38 // the rare case the term replaces the URL it's unlikely another keyword would |
37 // have the same url. | 39 // have the same url. |
38 static const wchar_t kReplacementTerm[] = L"blah.blah.blah.blah.blah"; | 40 static const wchar_t kReplacementTerm[] = L"blah.blah.blah.blah.blah"; |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 AddToMaps(t_url); | 968 AddToMaps(t_url); |
967 something_changed = true; | 969 something_changed = true; |
968 } | 970 } |
969 } | 971 } |
970 | 972 |
971 if (something_changed && loaded_) { | 973 if (something_changed && loaded_) { |
972 FOR_EACH_OBSERVER(TemplateURLModelObserver, model_observers_, | 974 FOR_EACH_OBSERVER(TemplateURLModelObserver, model_observers_, |
973 OnTemplateURLModelChanged()); | 975 OnTemplateURLModelChanged()); |
974 } | 976 } |
975 } | 977 } |
976 | |
OLD | NEW |