| 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/ie_importer.h" | 5 #include "chrome/browser/importer/ie_importer.h" |
| 6 | 6 |
| 7 #include <intshcut.h> | 7 #include <intshcut.h> |
| 8 #include <pstore.h> | 8 #include <pstore.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 #include <urlhist.h> | 10 #include <urlhist.h> |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 | 12 |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/registry.h" | 14 #include "base/registry.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "base/win_util.h" | 17 #include "base/win_util.h" |
| 18 #include "chrome/browser/bookmarks/bookmark_model.h" | 18 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 19 #include "chrome/browser/ie7_password.h" | 19 #include "chrome/browser/ie7_password.h" |
| 20 #include "chrome/browser/template_url_model.h" | 20 #include "chrome/browser/template_url_model.h" |
| 21 #include "chrome/common/l10n_util.h" | 21 #include "chrome/common/l10n_util.h" |
| 22 #include "chrome/common/time_format.h" | 22 #include "chrome/common/time_format.h" |
| 23 #include "chrome/common/win_util.h" | 23 #include "chrome/common/win_util.h" |
| 24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
| 25 | 25 |
| 26 #include "generated_resources.h" | 26 #include "generated_resources.h" |
| 27 | 27 |
| 28 using base::Time; |
| 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 // Gets the creation time of the given file or directory. | 32 // Gets the creation time of the given file or directory. |
| 31 static Time GetFileCreationTime(const std::wstring& file) { | 33 static Time GetFileCreationTime(const std::wstring& file) { |
| 32 Time creation_time; | 34 Time creation_time; |
| 33 ScopedHandle file_handle( | 35 ScopedHandle file_handle( |
| 34 CreateFile(file.c_str(), GENERIC_READ, | 36 CreateFile(file.c_str(), GENERIC_READ, |
| 35 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, | 37 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, |
| 36 NULL, OPEN_EXISTING, | 38 NULL, OPEN_EXISTING, |
| 37 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL)); | 39 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL)); |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 wchar_t buffer[128]; | 545 wchar_t buffer[128]; |
| 544 DWORD buffer_length = sizeof(buffer); | 546 DWORD buffer_length = sizeof(buffer); |
| 545 bool result = ReadFromRegistry(HKEY_LOCAL_MACHINE, | 547 bool result = ReadFromRegistry(HKEY_LOCAL_MACHINE, |
| 546 L"Software\\Microsoft\\Internet Explorer", | 548 L"Software\\Microsoft\\Internet Explorer", |
| 547 L"Version", buffer, &buffer_length); | 549 L"Version", buffer, &buffer_length); |
| 548 version = (result ? _wtoi(buffer) : 0); | 550 version = (result ? _wtoi(buffer) : 0); |
| 549 } | 551 } |
| 550 return version; | 552 return version; |
| 551 } | 553 } |
| 552 | 554 |
| OLD | NEW |