-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import browser laptop stats #315
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* 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/. */ | ||
|
||
#ifndef BRAVE_COMMON_IMPORTER_BRAVE_STATS_H_ | ||
#define BRAVE_COMMON_IMPORTER_BRAVE_STATS_H_ | ||
|
||
struct BraveStats { | ||
int adblock_count; | ||
int trackingProtection_count; | ||
int httpsEverywhere_count; | ||
|
||
BraveStats() | ||
: adblock_count(0), | ||
trackingProtection_count(0), | ||
httpsEverywhere_count(0) {} | ||
}; | ||
|
||
#endif // BRAVE_COMMON_IMPORTER_BRAVE_STATS_H_ |
6 changes: 4 additions & 2 deletions
6
patches/chrome-browser-extensions-api-settings_private-prefs_util.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
patches/chrome-browser-importer-external_process_importer_client.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
diff --git a/chrome/browser/importer/external_process_importer_client.h b/chrome/browser/importer/external_process_importer_client.h | ||
index 864a6951115dda5ed74963f18b35692960397d50..477c51b320a3f41b75ab36bf7e1780d1aae6e701 100644 | ||
index 864a6951115dda5ed74963f18b35692960397d50..ba056b13fbae07f151286f531e1a8d86e0eac2c5 100644 | ||
--- a/chrome/browser/importer/external_process_importer_client.h | ||
+++ b/chrome/browser/importer/external_process_importer_client.h | ||
@@ -24,6 +24,7 @@ | ||
@@ -24,10 +24,12 @@ | ||
#include "components/favicon_base/favicon_usage_data.h" | ||
#include "components/history/core/browser/history_types.h" | ||
#include "mojo/public/cpp/bindings/binding.h" | ||
+#include "net/cookies/canonical_cookie.h" | ||
|
||
class ExternalProcessImporterHost; | ||
struct ImportedBookmarkEntry; | ||
@@ -88,6 +89,8 @@ class ExternalProcessImporterClient | ||
class InProcessImporterBridge; | ||
+struct BraveStats; | ||
|
||
namespace autofill { | ||
struct PasswordForm; | ||
@@ -88,6 +90,9 @@ class ExternalProcessImporterClient | ||
void OnAutofillFormDataImportGroup( | ||
const std::vector<ImporterAutofillFormDataEntry>& | ||
autofill_form_data_entry_group) override; | ||
+ void OnCookiesImportStart(uint32_t total_cookies_count) override {}; | ||
+ void OnCookiesImportGroup(const std::vector<net::CanonicalCookie>& cookies_group) override {}; | ||
+ void OnStatsImportReady(const BraveStats& stats) override {}; | ||
void OnIE7PasswordReceived( | ||
const importer::ImporterIE7PasswordInfo& importer_password_info) override; | ||
|
9 changes: 7 additions & 2 deletions
9
patches/chrome-browser-resources-settings-people_page-import_data_dialog.html.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
patches/chrome-browser-resources-settings-people_page-import_data_dialog.js.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
diff --git a/chrome/browser/resources/settings/people_page/import_data_dialog.js b/chrome/browser/resources/settings/people_page/import_data_dialog.js | ||
index f59448f4b4a25ab8b5e13c23feafa7957e83fa82..1dcdb0fbfa38deb10418074b9c0f02ee75221591 100644 | ||
index f59448f4b4a25ab8b5e13c23feafa7957e83fa82..bfcb5e3e5c846b99f59ba49274881dece8302e87 100644 | ||
--- a/chrome/browser/resources/settings/people_page/import_data_dialog.js | ||
+++ b/chrome/browser/resources/settings/people_page/import_data_dialog.js | ||
@@ -84,7 +84,9 @@ Polymer({ | ||
@@ -84,7 +84,11 @@ Polymer({ | ||
!(this.getPref('import_dialog_search_engine').value && | ||
this.selected_.search) && | ||
!(this.getPref('import_dialog_autofill_form_data').value && | ||
- this.selected_.autofillFormData); | ||
+ this.selected_.autofillFormData) && | ||
+ !(this.getPref('import_dialog_cookies').value && | ||
+ this.selected_.cookies); | ||
+ this.selected_.cookies) && | ||
+ !(this.getPref('import_dialog_stats').value && | ||
+ this.selected_.stats); | ||
}, | ||
|
||
/** |
5 changes: 3 additions & 2 deletions
5
patches/chrome-browser-ui-webui-settings-md_settings_ui.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chrome/browser/ui/webui/settings/md_settings_ui.cc | ||
index 954647cb963e995c15d903e91689c4927ba3ad29..3d9a2ad9d363cf1504ac7beea248d368f4cb5ace 100644 | ||
index 954647cb963e995c15d903e91689c4927ba3ad29..7ba86990b1f630398bc373c680dd977d9b540d89 100644 | ||
--- a/chrome/browser/ui/webui/settings/md_settings_ui.cc | ||
+++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc | ||
@@ -131,6 +131,7 @@ void MdSettingsUI::RegisterProfilePrefs( | ||
@@ -131,6 +131,8 @@ void MdSettingsUI::RegisterProfilePrefs( | ||
registry->RegisterBooleanPref(prefs::kImportDialogHistory, true); | ||
registry->RegisterBooleanPref(prefs::kImportDialogSavedPasswords, true); | ||
registry->RegisterBooleanPref(prefs::kImportDialogSearchEngine, true); | ||
+ registry->RegisterBooleanPref(prefs::kImportDialogCookies, true); | ||
+ registry->RegisterBooleanPref(prefs::kImportDialogStats, true); | ||
} | ||
|
||
MdSettingsUI::MdSettingsUI(content::WebUI* web_ui) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
patches/chrome-common-importer-importer_data_types.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to block on this @garrettr but if you have time for a follow up I'd prefer to have this take the greater of the 2 stats and use that. That way someone can't as easily game it by importing multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbondy Blocking on that is no problem, it's a quick fix! I'll do it right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was too fast for you, so you'll have to PR again, but can be from the same branch obviously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I wasn't too fast for you but I was too slow to read your reply and too fast to merge 😆