Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(938)

Side by Side Diff: chrome/browser/importer/ie_importer.cc

Issue 10173001: Add a Profile* member to TemplateURL. This makes some invocations of ReplaceSearchTerms() a bit le… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, false));
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(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;
600 for (SearchEnginesMap::iterator i = search_engines_map.begin(); 600 for (SearchEnginesMap::iterator i = search_engines_map.begin();
601 i != search_engines_map.end(); ++i) 601 i != search_engines_map.end(); ++i)
602 search_engines.push_back(i->second); 602 search_engines.push_back(i->second);
603 603
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698