Commit 0c02e4d1 authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Remove flag kEnableMyGoogle for experiment released in M86.

Bug: 1043080
Change-Id: I7bd96ba2327ce5bc292990cf863f968c4029a4c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2538214Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828676}
parent 9951f681
......@@ -82,8 +82,6 @@ const size_t kNumberOfChromeHostURLs = base::size(kChromeHostURLs);
const char kSyncGoogleDashboardURL[] =
"https://www.google.com/settings/chrome/sync/";
const char kManageYourGoogleAccountURL[] = "https://myaccount.google.com/";
const char kPageInfoHelpCenterURL[] =
"https://support.google.com/chrome?p=ui_security_indicator&ios=1";
......
......@@ -67,9 +67,6 @@ extern const size_t kNumberOfChromeHostURLs;
// URL to the sync google dashboard.
extern const char kSyncGoogleDashboardURL[];
// URL to the Google account configuration page.
extern const char kManageYourGoogleAccountURL[];
// "What do these mean?" URL for the Page Info bubble.
extern const char kPageInfoHelpCenterURL[];
......
......@@ -9,7 +9,6 @@
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h"
#import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h"
#import "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
......@@ -23,8 +22,6 @@
#error "This file requires ARC support."
#endif
using chrome_test_util::ButtonWithAccessibilityLabel;
using chrome_test_util::ButtonWithAccessibilityLabelId;
using chrome_test_util::PrimarySignInButton;
using chrome_test_util::SettingsAccountButton;
using chrome_test_util::SettingsDoneButton;
......@@ -35,12 +32,6 @@ namespace {
// Constant for timeout while waiting for asynchronous sync operations.
const NSTimeInterval kSyncOperationTimeout = 10.0;
// Returns a matcher for a button that matches the userEmail in the given
// |fakeIdentity|.
id<GREYMatcher> ButtonWithFakeIdentity(FakeChromeIdentity* fakeIdentity) {
return ButtonWithAccessibilityLabel(fakeIdentity.userEmail);
}
// Returns a matcher for when there are no bookmarks saved.
id<GREYMatcher> NoBookmarksLabel() {
return grey_text(l10n_util::GetNSString(IDS_IOS_BOOKMARK_NO_BOOKMARKS_LABEL));
......@@ -130,16 +121,7 @@ id<GREYMatcher> NoBookmarksLabel() {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()];
// Remove |fakeIdentity2| from the device.
if (base::FeatureList::IsEnabled(kEnableMyGoogle)) {
[SigninEarlGreyUI tapRemoveAccountFromDeviceWithFakeIdentity:fakeIdentity2];
} else {
[[EarlGrey selectElementWithMatcher:ButtonWithFakeIdentity(fakeIdentity2)]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabel(
@"Remove account")]
performAction:grey_tap()];
}
[SigninEarlGreyUI tapRemoveAccountFromDeviceWithFakeIdentity:fakeIdentity2];
// Check that |fakeIdentity2| isn't available anymore on the Account Settings.
[[EarlGrey
......@@ -163,16 +145,8 @@ id<GREYMatcher> NoBookmarksLabel() {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()];
// Remove |fakeIdentity| from the device.
if (base::FeatureList::IsEnabled(kEnableMyGoogle)) {
[SigninEarlGreyUI tapRemoveAccountFromDeviceWithFakeIdentity:fakeIdentity];
} else {
[[EarlGrey selectElementWithMatcher:ButtonWithFakeIdentity(fakeIdentity)]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabel(
@"Remove account")]
performAction:grey_tap()];
}
[SigninEarlGreyUI tapRemoveAccountFromDeviceWithFakeIdentity:fakeIdentity];
// Check that the user is signed out and the Main Settings screen is shown.
[[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
assertWithMatcher:grey_sufficientlyVisible()];
......
......@@ -427,74 +427,69 @@ typedef NS_ENUM(NSInteger, ItemType) {
- (void)showAccountDetails:(ChromeIdentity*)identity
itemView:(UIView*)itemView {
if ([_alertCoordinator isVisible])
if (_alertCoordinator.isVisible) {
return;
if (base::FeatureList::IsEnabled(kEnableMyGoogle)) {
_alertCoordinator = [[ActionSheetCoordinator alloc]
initWithBaseViewController:self
browser:_browser
title:nil
message:identity.userEmail
rect:itemView.frame
view:itemView];
[_alertCoordinator
addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_MANAGE_YOUR_GOOGLE_ACCOUNT_TITLE)
action:^{
_dimissAccountDetailsViewControllerBlock =
ios::GetChromeBrowserProvider()
->GetChromeIdentityService()
->PresentAccountDetailsController(identity, self,
/*animated=*/YES);
}
style:UIAlertActionStyleDefault];
self.removeAccountCoordinator = [[AlertCoordinator alloc]
initWithBaseViewController:self
browser:_browser
title:l10n_util::GetNSStringF(
IDS_IOS_REMOVE_ACCOUNT_ALERT_TITLE,
base::SysNSStringToUTF16(
identity.userEmail))
message:
l10n_util::GetNSString(
IDS_IOS_REMOVE_ACCOUNT_CONFIRMATION_MESSAGE)];
__weak AccountsTableViewController* weakSelf = self;
[_alertCoordinator
addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_REMOVE_GOOGLE_ACCOUNT_TITLE)
action:^{
[weakSelf.removeAccountCoordinator
addItemWithTitle:l10n_util::GetNSString(IDS_CANCEL)
action:nil
style:UIAlertActionStyleCancel];
[weakSelf.removeAccountCoordinator
addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_REMOVE_ACCOUNT_LABEL)
action:^{
weakSelf.uiDisabled = YES;
ios::GetChromeBrowserProvider()
->GetChromeIdentityService()
->ForgetIdentity(
identity, ^(NSError* error) {
weakSelf.uiDisabled = NO;
});
}
style:UIAlertActionStyleDestructive];
[weakSelf.removeAccountCoordinator start];
}
style:UIAlertActionStyleDestructive];
[_alertCoordinator start];
} else {
_dimissAccountDetailsViewControllerBlock =
ios::GetChromeBrowserProvider()
->GetChromeIdentityService()
->PresentAccountDetailsController(identity, self, /*animated=*/YES);
}
_alertCoordinator = [[ActionSheetCoordinator alloc]
initWithBaseViewController:self
browser:_browser
title:nil
message:identity.userEmail
rect:itemView.frame
view:itemView];
[_alertCoordinator
addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_MANAGE_YOUR_GOOGLE_ACCOUNT_TITLE)
action:^{
_dimissAccountDetailsViewControllerBlock =
ios::GetChromeBrowserProvider()
->GetChromeIdentityService()
->PresentAccountDetailsController(identity, self,
/*animated=*/YES);
}
style:UIAlertActionStyleDefault];
self.removeAccountCoordinator = [[AlertCoordinator alloc]
initWithBaseViewController:self
browser:_browser
title:l10n_util::GetNSStringF(
IDS_IOS_REMOVE_ACCOUNT_ALERT_TITLE,
base::SysNSStringToUTF16(
identity.userEmail))
message:
l10n_util::GetNSString(
IDS_IOS_REMOVE_ACCOUNT_CONFIRMATION_MESSAGE)];
__weak AccountsTableViewController* weakSelf = self;
[_alertCoordinator
addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_REMOVE_GOOGLE_ACCOUNT_TITLE)
action:^{
[weakSelf.removeAccountCoordinator
addItemWithTitle:l10n_util::GetNSString(IDS_CANCEL)
action:nil
style:UIAlertActionStyleCancel];
[weakSelf.removeAccountCoordinator
addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_REMOVE_ACCOUNT_LABEL)
action:^{
weakSelf.uiDisabled = YES;
ios::GetChromeBrowserProvider()
->GetChromeIdentityService()
->ForgetIdentity(
identity, ^(NSError* error) {
weakSelf.uiDisabled = NO;
});
}
style:UIAlertActionStyleDestructive];
[weakSelf.removeAccountCoordinator start];
}
style:UIAlertActionStyleDestructive];
[_alertCoordinator start];
}
- (void)showSignOutWithClearData:(BOOL)forceClearData
......
......@@ -20,10 +20,6 @@
// Opens the "Manage Your Google Account" view.
- (void)openManageGoogleAccount;
// Opens the "Manage Your Google Account" web page.
// TODO(crbug.com/1043080): Remove web page API once MyGoogle UI is launched.
- (void)openManageGoogleAccountWebPage;
@end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_GOOGLE_SERVICES_GOOGLE_SERVICES_SETTINGS_COMMAND_HANDLER_H_
......@@ -301,16 +301,6 @@ using signin_metrics::PromoAction;
self.googleServicesSettingsViewController, /*animated=*/YES);
}
- (void)openManageGoogleAccountWebPage {
GURL url = google_util::AppendGoogleLocaleParam(
GURL(kManageYourGoogleAccountURL),
GetApplicationContext()->GetApplicationLocale());
OpenNewTabCommand* command = [OpenNewTabCommand commandWithURLFromChrome:url];
id<ApplicationCommands> handler = HandlerForProtocol(
self.browser->GetCommandDispatcher(), ApplicationCommands);
[handler closeSettingsUIAndOpenURL:command];
}
#pragma mark - GoogleServicesSettingsViewControllerPresentationDelegate
- (void)googleServicesSettingsViewControllerDidRemove:
......
......@@ -895,11 +895,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
[self.commandHandler openAccountSettings];
break;
case ManageGoogleAccountItemType:
if (base::FeatureList::IsEnabled(kEnableMyGoogle)) {
[self.commandHandler openManageGoogleAccount];
} else {
[self.commandHandler openManageGoogleAccountWebPage];
}
[self.commandHandler openManageGoogleAccount];
break;
case SignInItemType:
[self.commandHandler showSignIn];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment