Commit 0e905580 authored by Peter K. Lee's avatar Peter K. Lee Committed by Commit Bot

Removes deprecated Rate This App functionality

This has not been used for a long time and App Store regulations no
longer approves of the use of this type of app rating requests.

Bug: 863559
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I3aa5eb6a190d0577ff202b527c58566702a9ff18
Reviewed-on: https://chromium-review.googlesource.com/c/1278532Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Peter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599363}
parent e099b1d1
......@@ -153,11 +153,6 @@ const char kOmniboxGeolocationAuthorizationState[] =
const char kOmniboxGeolocationLastAuthorizationAlertVersion[] =
"ios.omnibox.geolocation_last_authorization_alert_version";
// Integer which contains the timestamp at which the "Rate This App" dialog was
// last shown.
const char kRateThisAppDialogLastShownTime[] =
"ios.ratethisapp.dialog_last_shown_time";
// Index of the entry point that initiated sending the SMS to the user for the
// "desktop to iOS" promotion (see DesktopIOSPromotion.IOSSigninReason histogram
// for details).
......
......@@ -50,8 +50,6 @@ extern const char kSigninShouldPromptForSigninAgain[];
extern const char kOmniboxGeolocationAuthorizationState[];
extern const char kOmniboxGeolocationLastAuthorizationAlertVersion[];
extern const char kRateThisAppDialogLastShownTime[];
extern const char kDesktopIOSPromotionSMSEntryPoint[];
extern const char kDesktopIOSPromotionShownEntryPoints[];
extern const char kDesktopIOSPromotionLastImpression[];
......
......@@ -146,8 +146,6 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterStringPref(prefs::kDefaultCharset,
l10n_util::GetStringUTF8(IDS_DEFAULT_ENCODING),
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterInt64Pref(prefs::kRateThisAppDialogLastShownTime, 0,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kNetworkPredictionEnabled, true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
......
......@@ -78,7 +78,6 @@
#include "ios/chrome/browser/metrics/tab_usage_recorder.h"
#import "ios/chrome/browser/passwords/password_controller.h"
#include "ios/chrome/browser/passwords/password_tab_helper.h"
#include "ios/chrome/browser/pref_names.h"
#import "ios/chrome/browser/prerender/preload_controller_delegate.h"
#import "ios/chrome/browser/prerender/prerender_service.h"
#import "ios/chrome/browser/prerender/prerender_service_factory.h"
......@@ -239,7 +238,6 @@
#include "ios/chrome/grit/ios_strings.h"
#import "ios/net/request_tracker.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#include "ios/public/provider/chrome/browser/ui/app_rating_prompt.h"
#include "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h"
#include "ios/public/provider/chrome/browser/voice/voice_search_controller.h"
#include "ios/public/provider/chrome/browser/voice/voice_search_provider.h"
......@@ -415,7 +413,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
#pragma mark - BVC
@interface BrowserViewController ()<ActivityServicePresentation,
AppRatingPromptDelegate,
BubblePresenterDelegate,
CaptivePortalDetectorTabHelperDelegate,
ConsentBumpCoordinatorDelegate,
......@@ -532,9 +529,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
// button.
BookmarkInteractionController* _bookmarkInteractionController;
// The currently displayed "Rate This App" dialog, if one exists.
id<AppRatingPrompt> _rateThisAppDialog;
// Native controller vended to tab before Tab is added to the tab model.
__weak id _temporaryNativeController;
......@@ -779,11 +773,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers
atOffset:(CGFloat)headerOffset;
// Showing and Dismissing child UI
// -------------------------------
// Dismisses the "rate this app" dialog.
- (void)dismissRateThisAppDialog;
// Find Bar UI
// -----------
// Update find bar with model data. If |shouldFocus| is set to YES, the text
......@@ -1524,7 +1513,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
[self.dispatcher dismissPopupMenuAnimated:NO];
[_contextMenuCoordinator stop];
[_passKitCoordinator stop];
[self dismissRateThisAppDialog];
if (self.presentedViewController) {
// Dismisses any other modal controllers that may be present, e.g. Recent
......@@ -1581,7 +1569,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
[[UpgradeCenter sharedInstance] unregisterClient:self];
if (_voiceSearchController)
_voiceSearchController->SetDispatcher(nil);
[_rateThisAppDialog setDelegate:nil];
[_model closeAllTabs];
[_paymentRequestManager setActiveWebState:nullptr];
[[NSNotificationCenter defaultCenter] removeObserver:self];
......@@ -2668,17 +2655,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
}
}
#pragma mark - Private Methods: Showing and Dismissing Child UI
- (void)dismissRateThisAppDialog {
if (_rateThisAppDialog) {
base::RecordAction(base::UserMetricsAction(
"IOSRateThisAppDialogDismissedProgramatically"));
[_rateThisAppDialog dismiss];
_rateThisAppDialog = nil;
}
}
#pragma mark - Private Methods: Find Bar UI
- (void)hideFindBarWithAnimation:(BOOL)animate {
......@@ -4525,39 +4501,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
}
#endif // !defined(NDEBUG)
// TODO(crbug.com/634507) Remove base::TimeXXX::ToInternalValue().
- (void)showRateThisAppDialog {
DCHECK(!_rateThisAppDialog);
// Store the current timestamp whenever this dialog is shown.
_browserState->GetPrefs()->SetInt64(prefs::kRateThisAppDialogLastShownTime,
base::Time::Now().ToInternalValue());
// iOS11 no longer supports the itms link to the app store. So, use a deep
// link for iOS11 and the itms link for prior versions.
NSURL* storeURL;
if (base::ios::IsRunningOnIOS11OrLater()) {
storeURL =
[NSURL URLWithString:(@"https://itunes.apple.com/us/app/"
@"google-chrome-the-fast-and-secure-web-browser/"
@"id535886823?action=write-review")];
} else {
storeURL = [NSURL
URLWithString:(@"itms-apps://itunes.apple.com/WebObjects/"
@"MZStore.woa/wa/"
@"viewContentsUserReviews?type=Purple+Software&id="
@"535886823&pt=9008&ct=rating")];
}
base::RecordAction(base::UserMetricsAction("IOSRateThisAppDialogShown"));
[self clearPresentedStateWithCompletion:nil dismissOmnibox:YES];
_rateThisAppDialog = ios::GetChromeBrowserProvider()->CreateAppRatingPrompt();
[_rateThisAppDialog setAppStoreURL:storeURL];
[_rateThisAppDialog setDelegate:self];
[_rateThisAppDialog show];
}
- (void)showFindInPage {
if (!self.canShowFindBar)
return;
......@@ -5289,24 +5232,6 @@ nativeContentHeaderHeightForPreloadController:(PreloadController*)controller
[self.dialogPresenter cancelDialogForWebState:tab.webState];
}
#pragma mark - AppRatingPromptDelegate
- (void)userTappedRateApp:(UIView*)view {
base::RecordAction(base::UserMetricsAction("IOSRateThisAppRateChosen"));
_rateThisAppDialog = nil;
}
- (void)userTappedSendFeedback:(UIView*)view {
base::RecordAction(base::UserMetricsAction("IOSRateThisAppFeedbackChosen"));
_rateThisAppDialog = nil;
[self.dispatcher showReportAnIssueFromViewController:self];
}
- (void)userTappedDismiss:(UIView*)view {
base::RecordAction(base::UserMetricsAction("IOSRateThisAppDismissChosen"));
_rateThisAppDialog = nil;
}
#pragma mark - LogoAnimationControllerOwnerOwner (Public)
- (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
......
......@@ -69,9 +69,6 @@ class GURL;
- (void)viewSource;
#endif
// Shows the "rate this app" dialog.
- (void)showRateThisAppDialog;
// Shows the Find In Page bar.
- (void)showFindInPage;
......
......@@ -279,7 +279,7 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse(
- (void)testPromoTap {
// Setup the promo.
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:experimental_flags::WHATS_NEW_APP_RATING
[defaults setInteger:experimental_flags::WHATS_NEW_MOVE_TO_DOCK_TIP
forKey:@"WhatsNewPromoStatus"];
PrefService* local_state = GetApplicationContext()->GetLocalState();
ios::NotificationPromo::MigrateUserPrefs(local_state);
......
......@@ -61,9 +61,6 @@ const char kNTPHelpURL[] =
// The What's New promo command that shows the Bookmarks Manager.
const char kBookmarkCommand[] = "bookmark";
// The What's New promo command that launches Rate This App.
const char kRateThisAppCommand[] = "ratethisapp";
} // namespace
@interface NTPHomeMediator ()<CRWWebStateObserver,
......@@ -359,8 +356,6 @@ const char kRateThisAppCommand[] = "ratethisapp";
std::string command = notificationPromo->command();
if (command == kBookmarkCommand) {
[self.dispatcher showBookmarksManager];
} else if (command == kRateThisAppCommand) {
[self.dispatcher showRateThisAppDialog];
} else {
NOTREACHED() << "Promo command is not valid.";
}
......
......@@ -114,6 +114,7 @@ class ChromeBrowserProvider {
CGRect frame) const NS_RETURNS_RETAINED;
// Creates and returns an app ratings prompt object. Can return nil if app
// ratings prompts are not supported by the provider.
// TODO(crbug.com/863559): DEPRECATED: DO NOT USE
virtual id<AppRatingPrompt> CreateAppRatingPrompt() const NS_RETURNS_RETAINED;
// Initializes the cast service. Should be called soon after the given
......
......@@ -12,6 +12,7 @@
// AppRatingPromptDelegate declares methods that are called when significant
// actions are performed on an AppRatingPrompt.
// TODO(crbug.com/863559): DEPRECATED: DO NOT USE
@protocol AppRatingPromptDelegate<NSObject>
@optional
......@@ -28,6 +29,7 @@
// An AppRatingPrompt displays a modal dialog prompting the user to rate the
// current app, with additional options to send feedback or dismiss the dialog.
// TODO(crbug.com/863559): DEPRECATED: DO NOT USE
@protocol AppRatingPrompt<NSObject>
@required
......
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