| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ie_importer.h" | 5 #include "chrome/browser/importer/ie_importer.h" |
| 6 | 6 |
| 7 #include <ole2.h> | 7 #include <ole2.h> |
| 8 #include <intshcut.h> | 8 #include <intshcut.h> |
| 9 #include <pstore.h> | 9 #include <pstore.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 } | 579 } |
| 580 | 580 |
| 581 std::string url(WideToUTF8(wide_url)); | 581 std::string url(WideToUTF8(wide_url)); |
| 582 SearchEnginesMap::iterator t_iter = search_engines_map.find(url); | 582 SearchEnginesMap::iterator t_iter = search_engines_map.find(url); |
| 583 if (t_iter == search_engines_map.end()) { | 583 if (t_iter == search_engines_map.end()) { |
| 584 // First time we see that URL. | 584 // First time we see that URL. |
| 585 GURL gurl(url); | 585 GURL gurl(url); |
| 586 if (gurl.is_valid()) { | 586 if (gurl.is_valid()) { |
| 587 TemplateURLData data; | 587 TemplateURLData data; |
| 588 data.short_name = name; | 588 data.short_name = name; |
| 589 data.SetKeyword(TemplateURLService::GenerateKeyword(gurl, false)); | 589 data.SetKeyword(TemplateURLService::GenerateKeyword(gurl)); |
| 590 data.SetURL(url); | 590 data.SetURL(url); |
| 591 data.show_in_default_list = true; | 591 data.show_in_default_list = true; |
| 592 t_iter = search_engines_map.insert(std::make_pair(url, | 592 t_iter = search_engines_map.insert(std::make_pair(url, |
| 593 new TemplateURL(NULL, data))).first; | 593 new TemplateURL(NULL, data))).first; |
| 594 } | 594 } |
| 595 } | 595 } |
| 596 } | 596 } |
| 597 | 597 |
| 598 // ProfileWriter::AddKeywords() requires a vector and we have a map. | 598 // ProfileWriter::AddKeywords() requires a vector and we have a map. |
| 599 std::vector<TemplateURL*> search_engines; | 599 std::vector<TemplateURL*> search_engines; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 static int version = -1; | 752 static int version = -1; |
| 753 if (version < 0) { | 753 if (version < 0) { |
| 754 wchar_t buffer[128]; | 754 wchar_t buffer[128]; |
| 755 DWORD buffer_length = sizeof(buffer); | 755 DWORD buffer_length = sizeof(buffer); |
| 756 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); | 756 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); |
| 757 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 757 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
| 758 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); | 758 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); |
| 759 } | 759 } |
| 760 return version; | 760 return version; |
| 761 } | 761 } |
| OLD | NEW |