summaryrefslogtreecommitdiffstats
path: root/chrome/browser/importer
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-24 16:24:13 +0100
committerKristian Monsen <kristianm@google.com>2011-05-25 14:13:32 +0100
commit3f50c38dc070f4bb515c1b64450dae14f316474e (patch)
tree29f309f9534e05c47244eedb438fc612578d133b /chrome/browser/importer
parente23bef148f7be2bdf9c3cb2cd3aa5ceebf1190fb (diff)
downloadexternal_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.zip
external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.gz
external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.bz2
Merge Chromium at r10.0.634.0: Initial merge by git.
Change-Id: Iac2af492818d119bcc2562eb5fdabf5ab0b6df9c
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r--chrome/browser/importer/firefox_importer_unittest_utils_mac.cc1
-rw-r--r--chrome/browser/importer/ie_importer.cc17
-rw-r--r--chrome/browser/importer/importer.cc10
-rw-r--r--chrome/browser/importer/importer_bridge.cc2
-rw-r--r--chrome/browser/importer/importer_list.cc18
-rw-r--r--chrome/browser/importer/importer_list.h1
-rw-r--r--chrome/browser/importer/importer_unittest.cc9
-rw-r--r--chrome/browser/importer/nss_decryptor_win.cc15
-rw-r--r--chrome/browser/importer/profile_writer.cc2
-rw-r--r--chrome/browser/importer/toolbar_importer.cc2
-rw-r--r--chrome/browser/importer/toolbar_importer.h4
11 files changed, 42 insertions, 39 deletions
diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
index 15ac4a2..f27a53c 100644
--- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
+++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
@@ -6,7 +6,6 @@
#include "base/base_switches.h"
#include "base/command_line.h"
-#include "base/debug_on_start.h"
#include "base/file_path.h"
#include "base/message_loop.h"
#include "base/test/test_timeouts.h"
diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc
index efa2a0a..b26c306 100644
--- a/chrome/browser/importer/ie_importer.cc
+++ b/chrome/browser/importer/ie_importer.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -16,7 +16,8 @@
#include <vector>
#include "app/l10n_util.h"
-#include "app/win_util.h"
+#include "app/win/scoped_co_mem.h"
+#include "app/win/scoped_com_initializer.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/scoped_comptr_win.h"
@@ -26,6 +27,7 @@
#include "base/values.h"
#include "base/utf_string_conversions.h"
#include "base/win/registry.h"
+#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/importer/importer_bridge.h"
@@ -48,7 +50,7 @@ namespace {
// Gets the creation time of the given file or directory.
static Time GetFileCreationTime(const std::wstring& file) {
Time creation_time;
- ScopedHandle file_handle(
+ base::win::ScopedHandle file_handle(
CreateFile(file.c_str(), GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
@@ -78,7 +80,7 @@ void IEImporter::StartImport(const ProfileInfo& profile_info,
bridge_->NotifyStarted();
// Some IE settings (such as Protected Storage) are obtained via COM APIs.
- win_util::ScopedCOMInitializer com_initializer;
+ app::win::ScopedCOMInitializer com_initializer;
if ((items & importer::HOME_PAGE) && !cancelled())
ImportHomepage(); // Doesn't have a UI item.
@@ -122,7 +124,7 @@ void IEImporter::ImportFavorites() {
if (!bookmarks.empty() && !cancelled()) {
const std::wstring& first_folder_name =
- l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_IE);
+ UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_IE));
int options = 0;
if (import_to_bookmark_bar())
options = ProfileWriter::IMPORT_TO_BOOKMARK_BAR;
@@ -487,7 +489,8 @@ bool IEImporter::GetFavoritesInfo(IEImporter::FavoritesInfo *info) {
void IEImporter::ParseFavoritesFolder(const FavoritesInfo& info,
BookmarkVector* bookmarks) {
- std::wstring ie_folder = l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_IE);
+ std::wstring ie_folder =
+ UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_IE));
BookmarkVector toolbar_bookmarks;
FilePath file;
std::vector<FilePath::StringType> file_list;
@@ -552,7 +555,7 @@ void IEImporter::ParseFavoritesFolder(const FavoritesInfo& info,
}
std::wstring IEImporter::ResolveInternetShortcut(const std::wstring& file) {
- win_util::CoMemReleaser<wchar_t> url;
+ app::win::ScopedCoMem<wchar_t> url;
ScopedComPtr<IUniformResourceLocator> url_locator;
HRESULT result = url_locator.CreateInstance(CLSID_InternetShortcut, NULL,
CLSCTX_INPROC_SERVER);
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc
index 6379e7b..d69aff4 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/browser/importer/importer.cc
@@ -5,7 +5,8 @@
#include "chrome/browser/importer/importer.h"
#include "app/l10n_util.h"
-#include "base/thread.h"
+#include "base/threading/thread.h"
+#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_list.h"
@@ -29,7 +30,7 @@
// TODO(port): Port these files.
#if defined(OS_WIN)
-#include "app/win_util.h"
+#include "app/win/win_util.h"
#include "chrome/browser/views/importer_lock_view.h"
#include "views/window/window.h"
#elif defined(OS_MACOSX)
@@ -211,9 +212,10 @@ void ImporterHost::StartImportSettings(
// credentials.
if (profile_info.browser_type == importer::GOOGLE_TOOLBAR5) {
if (!toolbar_importer_utils::IsGoogleGAIACookieInstalled()) {
- win_util::MessageBox(
+ app::win::MessageBox(
NULL,
- l10n_util::GetString(IDS_IMPORTER_GOOGLE_LOGIN_TEXT).c_str(),
+ UTF16ToWide(l10n_util::GetStringUTF16(
+ IDS_IMPORTER_GOOGLE_LOGIN_TEXT)).c_str(),
L"",
MB_OK | MB_TOPMOST);
diff --git a/chrome/browser/importer/importer_bridge.cc b/chrome/browser/importer/importer_bridge.cc
index f4fce91..588e365 100644
--- a/chrome/browser/importer/importer_bridge.cc
+++ b/chrome/browser/importer/importer_bridge.cc
@@ -117,7 +117,7 @@ void InProcessImporterBridge::NotifyEnded() {
}
std::wstring InProcessImporterBridge::GetLocalizedString(int message_id) {
- return l10n_util::GetString(message_id);
+ return UTF16ToWideHack(l10n_util::GetStringUTF16(message_id));
}
InProcessImporterBridge::~InProcessImporterBridge() {}
diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc
index 10e1101..9574f95 100644
--- a/chrome/browser/importer/importer_list.cc
+++ b/chrome/browser/importer/importer_list.cc
@@ -23,7 +23,7 @@
#include "chrome/browser/password_manager/ie7_password.h"
#endif
#if defined(OS_MACOSX)
-#include "base/mac_util.h"
+#include "base/mac/mac_util.h"
#include "chrome/browser/importer/safari_importer.h"
#endif
@@ -33,7 +33,7 @@ namespace {
void DetectIEProfiles(std::vector<importer::ProfileInfo*>* profiles) {
// IE always exists and doesn't have multiple profiles.
ProfileInfo* ie = new ProfileInfo();
- ie->description = l10n_util::GetString(IDS_IMPORT_FROM_IE);
+ ie->description = UTF16ToWide(l10n_util::GetStringUTF16(IDS_IMPORT_FROM_IE));
ie->browser_type = importer::MS_IE;
ie->source_path.clear();
ie->app_path.clear();
@@ -46,12 +46,13 @@ void DetectIEProfiles(std::vector<importer::ProfileInfo*>* profiles) {
#if defined(OS_MACOSX)
void DetectSafariProfiles(std::vector<importer::ProfileInfo*>* profiles) {
uint16 items = importer::NONE;
- if (!SafariImporter::CanImport(mac_util::GetUserLibraryPath(), &items))
+ if (!SafariImporter::CanImport(base::mac::GetUserLibraryPath(), &items))
return;
importer::ProfileInfo* safari = new importer::ProfileInfo();
safari->browser_type = importer::SAFARI;
- safari->description = l10n_util::GetString(IDS_IMPORT_FROM_SAFARI);
+ safari->description =
+ UTF16ToWideHack(l10n_util::GetStringUTF16(IDS_IMPORT_FROM_SAFARI));
safari->source_path.clear();
safari->app_path.clear();
safari->services_supported = items;
@@ -84,7 +85,8 @@ void DetectFirefoxProfiles(std::vector<importer::ProfileInfo*>* profiles) {
}
importer::ProfileInfo* firefox = new importer::ProfileInfo();
- firefox->description = l10n_util::GetString(IDS_IMPORT_FROM_FIREFOX);
+ firefox->description =
+ UTF16ToWideHack(l10n_util::GetStringUTF16(IDS_IMPORT_FROM_FIREFOX));
firefox->browser_type = firefox_type;
firefox->source_path = profile_path;
#if defined(OS_WIN)
@@ -105,8 +107,8 @@ void DetectGoogleToolbarProfiles(
importer::ProfileInfo* google_toolbar = new importer::ProfileInfo();
google_toolbar->browser_type = importer::GOOGLE_TOOLBAR5;
- google_toolbar->description = l10n_util::GetString(
- IDS_IMPORT_FROM_GOOGLE_TOOLBAR);
+ google_toolbar->description = UTF16ToWideHack(l10n_util::GetStringUTF16(
+ IDS_IMPORT_FROM_GOOGLE_TOOLBAR));
google_toolbar->source_path.clear();
google_toolbar->app_path.clear();
google_toolbar->services_supported = importer::FAVORITES;
@@ -131,7 +133,7 @@ Importer* ImporterList::CreateImporterByType(importer::ProfileType type) {
return new Toolbar5Importer();
#if defined(OS_MACOSX)
case importer::SAFARI:
- return new SafariImporter(mac_util::GetUserLibraryPath());
+ return new SafariImporter(base::mac::GetUserLibraryPath());
#endif // OS_MACOSX
case importer::NO_PROFILE_TYPE:
NOTREACHED();
diff --git a/chrome/browser/importer/importer_list.h b/chrome/browser/importer/importer_list.h
index f3db148..513a55f 100644
--- a/chrome/browser/importer/importer_list.h
+++ b/chrome/browser/importer/importer_list.h
@@ -10,7 +10,6 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/platform_thread.h"
#include "base/ref_counted.h"
#include "base/scoped_vector.h"
#include "build/build_config.h"
diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc
index 56ac2cc..595a3d7 100644
--- a/chrome/browser/importer/importer_unittest.cc
+++ b/chrome/browser/importer/importer_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -17,6 +17,7 @@
#include <vector>
+#include "app/win/scoped_com_initializer.h"
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/path_service.h"
@@ -34,7 +35,6 @@
#include "webkit/glue/password_form.h"
#if defined(OS_WIN)
-#include "app/win_util.h"
#include "base/scoped_comptr_win.h"
#include "chrome/browser/importer/ie_importer.h"
#include "chrome/browser/password_manager/ie7_password.h"
@@ -357,9 +357,8 @@ void WritePStore(IPStore* pstore, const GUID* type, const GUID* subtype) {
TEST_F(ImporterTest, IEImporter) {
// Sets up a favorites folder.
- win_util::ScopedCOMInitializer com_init;
- std::wstring path = test_path_.ToWStringHack();
- file_util::AppendToPath(&path, L"Favorites");
+ app::win::ScopedCOMInitializer com_init;
+ std::wstring path = test_path_.AppendASCII("Favorites").value();
CreateDirectory(path.c_str(), NULL);
CreateDirectory((path + L"\\SubFolder").c_str(), NULL);
CreateDirectory((path + L"\\Links").c_str(), NULL);
diff --git a/chrome/browser/importer/nss_decryptor_win.cc b/chrome/browser/importer/nss_decryptor_win.cc
index a662abb..a7b5592 100644
--- a/chrome/browser/importer/nss_decryptor_win.cc
+++ b/chrome/browser/importer/nss_decryptor_win.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/importer/nss_decryptor_win.h"
-#include "base/file_util.h"
+
+#include "base/file_path.h"
#include "base/sys_string_conversions.h"
namespace {
@@ -59,9 +60,8 @@ bool NSSDecryptor::Init(const std::wstring& dll_path,
// Fall back on LoadLibraryEx if SetDllDirectory isn't available. We
// actually prefer this method because it doesn't change the DLL search
// path, which is a process-wide property.
- std::wstring path = dll_path;
- file_util::AppendToPath(&path, kNSS3Library);
- nss3_dll_ = LoadLibraryEx(path.c_str(), NULL,
+ FilePath path = FilePath(dll_path).Append(kNSS3Library);
+ nss3_dll_ = LoadLibraryEx(path.value().c_str(), NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
if (nss3_dll_ == NULL)
return false;
@@ -76,9 +76,8 @@ bool NSSDecryptor::Init(const std::wstring& dll_path,
// LOAD_WITH_ALTERED_SEARCH_PATH flag. This helps because LoadLibrary
// doesn't load a DLL again if it's already loaded. This workaround is
// harmless for NSS 3.11.
- path = dll_path;
- file_util::AppendToPath(&path, kSoftokn3Library);
- softokn3_dll_ = LoadLibraryEx(path.c_str(), NULL,
+ path = FilePath(dll_path).Append(kSoftokn3Library);
+ softokn3_dll_ = LoadLibraryEx(path.value().c_str(), NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
if (softokn3_dll_ == NULL) {
Free();
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index 68e5c96..00e8dcf 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/importer/profile_writer.h"
#include "base/string_util.h"
-#include "base/thread.h"
+#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/importer/importer.h"
diff --git a/chrome/browser/importer/toolbar_importer.cc b/chrome/browser/importer/toolbar_importer.cc
index cc3411c..adcea0c 100644
--- a/chrome/browser/importer/toolbar_importer.cc
+++ b/chrome/browser/importer/toolbar_importer.cc
@@ -135,7 +135,7 @@ void Toolbar5Importer::Cancel() {
void Toolbar5Importer::OnURLFetchComplete(
const URLFetcher* source,
const GURL& url,
- const URLRequestStatus& status,
+ const net::URLRequestStatus& status,
int response_code,
const ResponseCookies& cookies,
const std::string& data) {
diff --git a/chrome/browser/importer/toolbar_importer.h b/chrome/browser/importer/toolbar_importer.h
index f83135a..e0b87e5 100644
--- a/chrome/browser/importer/toolbar_importer.h
+++ b/chrome/browser/importer/toolbar_importer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -54,7 +54,7 @@ class Toolbar5Importer : public URLFetcher::Delegate, public Importer {
// URLFetcher::Delegate method called back from the URLFetcher object.
virtual void OnURLFetchComplete(const URLFetcher* source,
const GURL& url,
- const URLRequestStatus& status,
+ const net::URLRequestStatus& status,
int response_code,
const ResponseCookies& cookies,
const std::string& data);