-
Notifications
You must be signed in to change notification settings - Fork 888
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
Fix #11444: Google accounts should not show in the profile menu #6516
Conversation
bbb7201
to
0b2b2f2
Compare
|
||
#include "brave/browser/profiles/brave_gaia_info_update_service.h" | ||
|
||
#define GAIAInfoUpdateService BraveGAIAInfoUpdateService |
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 am getting an error in Debug build on Windows:
lld-link: error: undefined symbol: public: static class GAIAInfoUpdateService * __cdecl GAIAInfoUpdateServiceFactory::GetForProfile(class Profile *) >>> referenced by C:\bb4\brave-browser\src\chrome\browser\profiles\profile_impl.cc:671
This changes the return type of GAIAInfoUpdateService* GAIAInfoUpdateServiceFactory::GetForProfile
as well.
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.
It might be easier to override ShouldUseGAIAProfileInfo
directly by adding chromium_src override of gaia_info_update_service.h
like so:
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ #define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_ #define ShouldUseGAIAProfileInfo \ ShouldUseGAIAProfileInfo_ChromiumImpl(Profile* profile); \ static bool ShouldUseGAIAProfileInfo #include "../../../../../chrome/browser/profiles/gaia_info_update_service.h" #undef ShouldUseGAIAProfileInfo #endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_H_
and changing the gaia_info_update_service.cc
override to be:
#include "chrome/browser/profiles/gaia_info_update_service.h" #define ShouldUseGAIAProfileInfo ShouldUseGAIAProfileInfo_ChromiumImpl #include "../../../../../chrome/browser/profiles/gaia_info_update_service.cc" #undef ShouldUseGAIAProfileInfo // static bool GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(Profile* profile) { return false; }
and then there will be no need for browser/profiles/brave_gaia_info_update_service.{h,cc} or
chromium_src/chrome/browser/profiles/gaia_info_update_service_factory.cc` overrides.
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.
this is helpful, thanks @mkarolin. I'll update
@@ -33,6 +33,9 @@ void BraveProfileMenuView::BuildAutofillButtons() {} | |||
// We don't want to show any Chromium sync info. | |||
void BraveProfileMenuView::BuildSyncInfo() {} | |||
|
|||
// We don't want any feature buttons like MANAGE_GOOGLE_ACCOUNT | |||
void BraveProfileMenuView::BuildFeatureButtons() {} |
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 believe we want to keep the IDS_PROFILES_CLOSE_X_WINDOWS_BUTTON
here. At least it's part of the intended design change here brave/brave-browser#8807
#include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h" | ||
|
||
#define BRAVE_DISABLE_RPH_FROM_REQUEST \ | ||
*error = "Unsupported"; return nullptr; |
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.
Will be reverted when this is merged: #6522
--- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc | ||
+++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc | ||
@@ -89,6 +89,7 @@ content::RenderProcessHost* WebrtcLoggingPrivateFunction::RphFromRequest( | ||
const api::webrtc_logging_private::RequestInfo& request, | ||
const std::string& security_origin, | ||
std::string* error) { | ||
+ return nullptr; // feature disabled in Brave | ||
+ BRAVE_DISABLE_RPH_FROM_REQUEST //feature disabled in Brave |
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.
Will be reverted when this is merged: #6522
8ac3807
to
0414d4e
Compare
#include "chrome/browser/profiles/profile_attributes_entry.h" | ||
#include "chrome/browser/profiles/profile_manager.h" | ||
#include "chrome/browser/profiles/profile_window.h" | ||
#include "chrome/browser/ui/browser_finder.h" | ||
#include "chrome/grit/generated_resources.h" | ||
#include "components/vector_icons/vector_icons.h" |
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.
are there existing deps for this and ui/base?
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.
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.
chromium_src changes look ok, someone else should verify functionality
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.
Changes LGTM - ran through the test plan on Windows and it works great 😄
Also ran unit tests + browser tests locally; every single one passed (no retries, etc). Looking perfect!
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.
Didn't get a chance to run it, but code looks good. Only left an optional nit!
@@ -59,6 +60,9 @@ cr.define('settings', function() { | |||
getWeb3ProviderList() { | |||
return new Promise(resolve => chrome.braveWallet.getWeb3ProviderList(resolve)) | |||
} | |||
wasSignInEnabledAtStartup() { |
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.
nit (see related): doesn't need to be in proxy since not sending any data
@@ -101,5 +102,10 @@ Polymer({ | |||
openWebStoreUrl_: function() { | |||
window.open(loadTimeData.getString('getMoreExtensionsUrl')); | |||
}, | |||
|
|||
shouldShowRestartForGoogleLogin_: function(value) { | |||
return this.browserProxy_.wasSignInEnabledAtStartup() != value; |
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.
nit: this doesn't need to be either a function (since it's static) or something from browserProxy (since this component can access loadTimeData
just fine). Can simply be a polymer property initialized with the value of loadTimeData.getBoolean('signInAllowedOnNextStartupInitialValue')
. Still, just a nit and only mentioning to reduce code or for the future.
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.
LGTM
Verified using PR build provided by PJ using Verified STR from PR description Step 2: Confirmed no Step 3: Confirmed Step 3: Confirmed toggling Step 3: Confirmed Step 4: Able to use Google Keep extension Step 5: Able to use Google Calendar extension Step 6: Confirmed profile menu doesn't show any Google sign in data Step 9: Confirmed after removing site data, disabling Also verified the below scenarios: Scenario 1
Scenario 2:
Verification passed on Windows 10 x64 using local build given by @jumde
Step 2: Confirmed no Step 3: Confirmed Confirmed Step 4: Able to use Google Keep extension Step 5: Able to use Google Calendar extension Step 6: Confirmed profile menu doesn't show any Google sign-in data Step 9: Confirmed after removing site data, disabling Also verified the below scenarios: Scenario 1 (This PR fixed the issue #11493)
Scenario 2:
|
CI failure for |
Fix #11444: Google accounts should not show in the profile menu
Verified using
Verified STR from PR descriptionStep 2: Confirmed no Step 3: Confirmed Step 3: Confirmed toggling Step 3: Confirmed Step 4: Able to use Google Keep extension Step 5: Able to use Google Calendar extension Step 6: Confirmed profile menu doesn't show any Google sign in data for either profile Step 9: Confirmed after removing site data, disabling Also verified the below scenarios: Scenario 1 - install extension before signing into Google
NOTE - if you leave sign in page open in step 5, you will encounter brave/brave-browser#11493. Discussed with @jumde and #11493 has been labeled Scenario 2 - toggle setting multiple times
Scenario 3 - STR from brave/brave-browser/issues/11444
Also tried signing in/out various times, enabling/disabling the |
this.restartBrowser_ = this.restartBrowser_.bind(this) | ||
}, | ||
|
||
shouldShowRestart_: function(value) { |
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.
@jumde this function and setSignInEnabledAtNextStartup_
below have been removed from this .js but they are still referenced in the HTML. Were they meant to stay and just have their functionality moved here from the proxy?
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.
checking
Resolves brave/brave-browser#11444
Description
Google Login for extensions
tobrave://settings/extensions
which is disabled by default.ProfileViewMenu
should not display google profile info when the user has enabledGoogle Login
for extensions.Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
gmail.com
.Accounts in Token Service
orRefresh token events
Google Login for extensions
and RelaunchProfiles > Add Profile
and verify that theProfile Menu
next to the hamburger menu doesn't show your google login information.Google Login for extensions
and RelaunchSign In
will not work.Reviewer Checklist:
After-merge Checklist:
changes has landed on.