| 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/importer/importer.h" | 5 #include "chrome/browser/importer/importer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "app/gfx/favicon_size.h" | 10 #include "app/gfx/favicon_size.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // 'http://...{Language}...'. As {Language} is not a valid OSDD parameter value | 184 // 'http://...{Language}...'. As {Language} is not a valid OSDD parameter value |
| 185 // the TemplateURL is invalid. | 185 // the TemplateURL is invalid. |
| 186 static std::string BuildHostPathKey(const TemplateURL* t_url, | 186 static std::string BuildHostPathKey(const TemplateURL* t_url, |
| 187 bool try_url_if_invalid) { | 187 bool try_url_if_invalid) { |
| 188 if (t_url->url()) { | 188 if (t_url->url()) { |
| 189 if (try_url_if_invalid && !t_url->url()->IsValid()) | 189 if (try_url_if_invalid && !t_url->url()->IsValid()) |
| 190 return HostPathKeyForURL(GURL(WideToUTF8(t_url->url()->url()))); | 190 return HostPathKeyForURL(GURL(WideToUTF8(t_url->url()->url()))); |
| 191 | 191 |
| 192 if (t_url->url()->SupportsReplacement()) { | 192 if (t_url->url()->SupportsReplacement()) { |
| 193 return HostPathKeyForURL( | 193 return HostPathKeyForURL( |
| 194 t_url->url()->ReplaceSearchTerms( | 194 GURL(WideToUTF8(t_url->url()->ReplaceSearchTerms( |
| 195 *t_url, L"random string", | 195 *t_url, L"random string", |
| 196 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())); | 196 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())))); |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 return std::string(); | 199 return std::string(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 // Builds a set that contains an entry of the host+path for each TemplateURL in | 202 // Builds a set that contains an entry of the host+path for each TemplateURL in |
| 203 // the TemplateURLModel that has a valid search url. | 203 // the TemplateURLModel that has a valid search url. |
| 204 static void BuildHostPathMap(const TemplateURLModel& model, | 204 static void BuildHostPathMap(const TemplateURLModel& model, |
| 205 HostPathMap* host_path_map) { | 205 HostPathMap* host_path_map) { |
| 206 std::vector<const TemplateURL*> template_urls = model.GetTemplateURLs(); | 206 std::vector<const TemplateURL*> template_urls = model.GetTemplateURLs(); |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 ProfileInfo* google_toolbar = new ProfileInfo(); | 755 ProfileInfo* google_toolbar = new ProfileInfo(); |
| 756 google_toolbar->browser_type = GOOGLE_TOOLBAR5; | 756 google_toolbar->browser_type = GOOGLE_TOOLBAR5; |
| 757 google_toolbar->description = l10n_util::GetString( | 757 google_toolbar->description = l10n_util::GetString( |
| 758 IDS_IMPORT_FROM_GOOGLE_TOOLBAR); | 758 IDS_IMPORT_FROM_GOOGLE_TOOLBAR); |
| 759 google_toolbar->source_path.clear(); | 759 google_toolbar->source_path.clear(); |
| 760 google_toolbar->app_path.clear(); | 760 google_toolbar->app_path.clear(); |
| 761 google_toolbar->services_supported = FAVORITES; | 761 google_toolbar->services_supported = FAVORITES; |
| 762 source_profiles_.push_back(google_toolbar); | 762 source_profiles_.push_back(google_toolbar); |
| 763 } | 763 } |
| 764 } | 764 } |
| OLD | NEW |