Skip to content

Commit

Permalink
Issue 7044: Do not import cookies from Chrome and Firefox.
Browse files Browse the repository at this point in the history
Note: we do not import cookies from Safari, so nothing to disable.
  • Loading branch information
Ivan Efremov authored and bsclifton committed Dec 11, 2019
1 parent b6c4e72 commit 0b1a2da
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 275 deletions.
8 changes: 5 additions & 3 deletions chromium_src/chrome/utility/importer/importer_creator.cc
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/* Copyright 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "chrome/utility/importer/importer_creator.h"
#define CreateImporterByType CreateImporterByType_ChromiumImpl
#include "../../../../../chrome/utility/importer/importer_creator.cc"
#undef CreateImporterByType

#include "brave/utility/importer/brave_importer.h"
#include "brave/utility/importer/chrome_importer.h"
#include "brave/utility/importer/firefox_importer.h"

namespace importer {

scoped_refptr<Importer> CreateImporterByType(ImporterType type) {
switch (type) {
case TYPE_FIREFOX:
return new brave::FirefoxImporter();
case TYPE_CHROME:
return new ChromeImporter();
case TYPE_BRAVE:
Expand Down
4 changes: 0 additions & 4 deletions common/importer/chrome_importer_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,13 @@ bool ChromeImporterCanImport(const base::FilePath& profile,
profile.Append(base::FilePath::StringType(FILE_PATH_LITERAL("History")));
base::FilePath passwords =
profile.Append(base::FilePath::StringType(FILE_PATH_LITERAL("Login Data")));
base::FilePath cookies =
profile.Append(base::FilePath::StringType(FILE_PATH_LITERAL("Cookies")));

if (base::PathExists(bookmarks))
*services_supported |= importer::FAVORITES;
if (base::PathExists(history))
*services_supported |= importer::HISTORY;
if (base::PathExists(passwords))
*services_supported |= importer::PASSWORDS;
if (base::PathExists(cookies))
*services_supported |= importer::COOKIES;

return *services_supported != importer::NONE;
}
12 changes: 2 additions & 10 deletions patches/chrome-browser-importer-importer_list.cc.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc
index da4c6f6cec37523f59fd6b18e9e1c603c8e6a0df..f613af5207e550b91fb878d7fe56204fbdaecbc7 100644
index da4c6f6cec37523f59fd6b18e9e1c603c8e6a0df..569bb3a108132454c2213ece7abcb4ff23fcbc3c 100644
--- a/chrome/browser/importer/importer_list.cc
+++ b/chrome/browser/importer/importer_list.cc
@@ -29,6 +29,9 @@
Expand Down Expand Up @@ -28,15 +28,7 @@ index da4c6f6cec37523f59fd6b18e9e1c603c8e6a0df..f613af5207e550b91fb878d7fe56204f
if (profile_path.empty())
return;

@@ -127,6 +135,7 @@ void DetectFirefoxProfiles(const std::string locale,
firefox.app_path = app_path;
firefox.services_supported = importer::HISTORY | importer::FAVORITES |
importer::PASSWORDS | importer::SEARCH_ENGINES |
+ importer::COOKIES |
importer::AUTOFILL_FORM_DATA;
firefox.locale = locale;
profiles->push_back(firefox);
@@ -145,21 +154,37 @@ std::vector<importer::SourceProfile> DetectSourceProfilesWorker(
@@ -145,21 +153,37 @@ std::vector<importer::SourceProfile> DetectSourceProfilesWorker(
#if defined(OS_WIN)
if (shell_integration::IsFirefoxDefaultBrowser()) {
DetectFirefoxProfiles(locale, &profiles);
Expand Down
12 changes: 0 additions & 12 deletions patches/chrome-utility-importer-firefox_importer.cc.patch

This file was deleted.

23 changes: 0 additions & 23 deletions patches/chrome-utility-importer-firefox_importer.h.patch

This file was deleted.

1 change: 0 additions & 1 deletion test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ test("brave_unit_tests") {
"../browser/importer/chrome_profile_lock_unittest.cc",
"../utility/importer/chrome_importer_unittest.cc",
"../utility/importer/brave_importer_unittest.cc",
"../utility/importer/firefox_importer_unittest.cc",

# These tests should probably work on Android and compile, but don't pass currently
"//brave/browser/autocomplete/brave_autocomplete_provider_client_unittest.cc",
Expand Down
2 changes: 0 additions & 2 deletions utility/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ source_set("utility") {
"importer/brave_importer.h",
"importer/chrome_importer.cc",
"importer/chrome_importer.h",
"importer/firefox_importer.cc",
"importer/firefox_importer.h",
]

deps += [
Expand Down
6 changes: 1 addition & 5 deletions utility/importer/chrome_importer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ void ChromeImporter::StartImport(const importer::SourceProfile& source_profile,
bridge_->NotifyItemEnded(importer::PASSWORDS);
}

if ((items & importer::COOKIES) && !cancelled()) {
bridge_->NotifyItemStarted(importer::COOKIES);
ImportCookies();
bridge_->NotifyItemEnded(importer::COOKIES);
}
// Note that we do not import cookies from Chrome (issues/7044).

bridge_->NotifyEnded();
}
Expand Down
109 changes: 0 additions & 109 deletions utility/importer/firefox_importer.cc

This file was deleted.

33 changes: 0 additions & 33 deletions utility/importer/firefox_importer.h

This file was deleted.

73 changes: 0 additions & 73 deletions utility/importer/firefox_importer_unittest.cc

This file was deleted.

0 comments on commit 0b1a2da

Please sign in to comment.