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

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

Issue 12893: Get rid of kPathSeparator on windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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) 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>
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // Remove the dot and the file extension, and the directory path. 488 // Remove the dot and the file extension, and the directory path.
489 std::wstring relative_path = it->substr(info.path.size(), 489 std::wstring relative_path = it->substr(info.path.size(),
490 it->size() - filename.size() - info.path.size()); 490 it->size() - filename.size() - info.path.size());
491 TrimString(relative_path, L"\\", &relative_path); 491 TrimString(relative_path, L"\\", &relative_path);
492 492
493 ProfileWriter::BookmarkEntry entry; 493 ProfileWriter::BookmarkEntry entry;
494 entry.title = filename.substr(0, filename.size() - (extension.size() + 1)); 494 entry.title = filename.substr(0, filename.size() - (extension.size() + 1));
495 entry.url = url; 495 entry.url = url;
496 entry.creation_time = GetFileCreationTime(*it); 496 entry.creation_time = GetFileCreationTime(*it);
497 if (!relative_path.empty()) 497 if (!relative_path.empty())
498 SplitString(relative_path, file_util::kPathSeparator, &entry.path); 498 file_util::PathComponents(relative_path, &entry.path);
499 499
500 // Flatten the bookmarks in Link folder onto bookmark toolbar. Otherwise, 500 // Flatten the bookmarks in Link folder onto bookmark toolbar. Otherwise,
501 // put it into "Other bookmarks". 501 // put it into "Other bookmarks".
502 if (first_run() && 502 if (first_run() &&
503 (entry.path.size() > 0 && entry.path[0] == info.links_folder)) { 503 (entry.path.size() > 0 && entry.path[0] == info.links_folder)) {
504 entry.in_toolbar = true; 504 entry.in_toolbar = true;
505 entry.path.erase(entry.path.begin()); 505 entry.path.erase(entry.path.begin());
506 toolbar_bookmarks.push_back(entry); 506 toolbar_bookmarks.push_back(entry);
507 } else { 507 } else {
508 // After the first run, we put the bookmarks in a "Imported From IE" 508 // After the first run, we put the bookmarks in a "Imported From IE"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 if (version < 0) { 547 if (version < 0) {
548 wchar_t buffer[128]; 548 wchar_t buffer[128];
549 DWORD buffer_length = sizeof(buffer); 549 DWORD buffer_length = sizeof(buffer);
550 bool result = ReadFromRegistry(HKEY_LOCAL_MACHINE, 550 bool result = ReadFromRegistry(HKEY_LOCAL_MACHINE,
551 L"Software\\Microsoft\\Internet Explorer", 551 L"Software\\Microsoft\\Internet Explorer",
552 L"Version", buffer, &buffer_length); 552 L"Version", buffer, &buffer_length);
553 version = (result ? _wtoi(buffer) : 0); 553 version = (result ? _wtoi(buffer) : 0);
554 } 554 }
555 return version; 555 return version;
556 } 556 }
OLDNEW
« no previous file with comments | « chrome/browser/history/visit_database_unittest.cc ('k') | chrome/browser/safe_browsing/database_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698