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[] = ...@@ -153,11 +153,6 @@ const char kOmniboxGeolocationAuthorizationState[] =
const char kOmniboxGeolocationLastAuthorizationAlertVersion[] = const char kOmniboxGeolocationLastAuthorizationAlertVersion[] =
"ios.omnibox.geolocation_last_authorization_alert_version"; "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 // Index of the entry point that initiated sending the SMS to the user for the
// "desktop to iOS" promotion (see DesktopIOSPromotion.IOSSigninReason histogram // "desktop to iOS" promotion (see DesktopIOSPromotion.IOSSigninReason histogram
// for details). // for details).
......
...@@ -50,8 +50,6 @@ extern const char kSigninShouldPromptForSigninAgain[]; ...@@ -50,8 +50,6 @@ extern const char kSigninShouldPromptForSigninAgain[];
extern const char kOmniboxGeolocationAuthorizationState[]; extern const char kOmniboxGeolocationAuthorizationState[];
extern const char kOmniboxGeolocationLastAuthorizationAlertVersion[]; extern const char kOmniboxGeolocationLastAuthorizationAlertVersion[];
extern const char kRateThisAppDialogLastShownTime[];
extern const char kDesktopIOSPromotionSMSEntryPoint[]; extern const char kDesktopIOSPromotionSMSEntryPoint[];
extern const char kDesktopIOSPromotionShownEntryPoints[]; extern const char kDesktopIOSPromotionShownEntryPoints[];
extern const char kDesktopIOSPromotionLastImpression[]; extern const char kDesktopIOSPromotionLastImpression[];
......
...@@ -146,8 +146,6 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) { ...@@ -146,8 +146,6 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterStringPref(prefs::kDefaultCharset, registry->RegisterStringPref(prefs::kDefaultCharset,
l10n_util::GetStringUTF8(IDS_DEFAULT_ENCODING), l10n_util::GetStringUTF8(IDS_DEFAULT_ENCODING),
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterInt64Pref(prefs::kRateThisAppDialogLastShownTime, 0,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref( registry->RegisterBooleanPref(
prefs::kNetworkPredictionEnabled, true, prefs::kNetworkPredictionEnabled, true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
#include "ios/chrome/browser/metrics/tab_usage_recorder.h" #include "ios/chrome/browser/metrics/tab_usage_recorder.h"
#import "ios/chrome/browser/passwords/password_controller.h" #import "ios/chrome/browser/passwords/password_controller.h"
#include "ios/chrome/browser/passwords/password_tab_helper.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/preload_controller_delegate.h"
#import "ios/chrome/browser/prerender/prerender_service.h" #import "ios/chrome/browser/prerender/prerender_service.h"
#import "ios/chrome/browser/prerender/prerender_service_factory.h" #import "ios/chrome/browser/prerender/prerender_service_factory.h"
...@@ -239,7 +238,6 @@ ...@@ -239,7 +238,6 @@
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/net/request_tracker.h" #import "ios/net/request_tracker.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.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/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_controller.h"
#include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h"
...@@ -415,7 +413,6 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -415,7 +413,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
#pragma mark - BVC #pragma mark - BVC
@interface BrowserViewController ()<ActivityServicePresentation, @interface BrowserViewController ()<ActivityServicePresentation,
AppRatingPromptDelegate,
BubblePresenterDelegate, BubblePresenterDelegate,
CaptivePortalDetectorTabHelperDelegate, CaptivePortalDetectorTabHelperDelegate,
ConsentBumpCoordinatorDelegate, ConsentBumpCoordinatorDelegate,
...@@ -532,9 +529,6 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -532,9 +529,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
// button. // button.
BookmarkInteractionController* _bookmarkInteractionController; 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. // Native controller vended to tab before Tab is added to the tab model.
__weak id _temporaryNativeController; __weak id _temporaryNativeController;
...@@ -779,11 +773,6 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -779,11 +773,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers - (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers
atOffset:(CGFloat)headerOffset; atOffset:(CGFloat)headerOffset;
// Showing and Dismissing child UI
// -------------------------------
// Dismisses the "rate this app" dialog.
- (void)dismissRateThisAppDialog;
// Find Bar UI // Find Bar UI
// ----------- // -----------
// Update find bar with model data. If |shouldFocus| is set to YES, the text // Update find bar with model data. If |shouldFocus| is set to YES, the text
...@@ -1524,7 +1513,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint { ...@@ -1524,7 +1513,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
[self.dispatcher dismissPopupMenuAnimated:NO]; [self.dispatcher dismissPopupMenuAnimated:NO];
[_contextMenuCoordinator stop]; [_contextMenuCoordinator stop];
[_passKitCoordinator stop]; [_passKitCoordinator stop];
[self dismissRateThisAppDialog];
if (self.presentedViewController) { if (self.presentedViewController) {
// Dismisses any other modal controllers that may be present, e.g. Recent // Dismisses any other modal controllers that may be present, e.g. Recent
...@@ -1581,7 +1569,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint { ...@@ -1581,7 +1569,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
[[UpgradeCenter sharedInstance] unregisterClient:self]; [[UpgradeCenter sharedInstance] unregisterClient:self];
if (_voiceSearchController) if (_voiceSearchController)
_voiceSearchController->SetDispatcher(nil); _voiceSearchController->SetDispatcher(nil);
[_rateThisAppDialog setDelegate:nil];
[_model closeAllTabs]; [_model closeAllTabs];
[_paymentRequestManager setActiveWebState:nullptr]; [_paymentRequestManager setActiveWebState:nullptr];
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
...@@ -2668,17 +2655,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint { ...@@ -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 #pragma mark - Private Methods: Find Bar UI
- (void)hideFindBarWithAnimation:(BOOL)animate { - (void)hideFindBarWithAnimation:(BOOL)animate {
...@@ -4525,39 +4501,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint { ...@@ -4525,39 +4501,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
} }
#endif // !defined(NDEBUG) #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 { - (void)showFindInPage {
if (!self.canShowFindBar) if (!self.canShowFindBar)
return; return;
...@@ -5289,24 +5232,6 @@ nativeContentHeaderHeightForPreloadController:(PreloadController*)controller ...@@ -5289,24 +5232,6 @@ nativeContentHeaderHeightForPreloadController:(PreloadController*)controller
[self.dialogPresenter cancelDialogForWebState:tab.webState]; [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) #pragma mark - LogoAnimationControllerOwnerOwner (Public)
- (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
......
...@@ -69,9 +69,6 @@ class GURL; ...@@ -69,9 +69,6 @@ class GURL;
- (void)viewSource; - (void)viewSource;
#endif #endif
// Shows the "rate this app" dialog.
- (void)showRateThisAppDialog;
// Shows the Find In Page bar. // Shows the Find In Page bar.
- (void)showFindInPage; - (void)showFindInPage;
......
...@@ -279,7 +279,7 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse( ...@@ -279,7 +279,7 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse(
- (void)testPromoTap { - (void)testPromoTap {
// Setup the promo. // Setup the promo.
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:experimental_flags::WHATS_NEW_APP_RATING [defaults setInteger:experimental_flags::WHATS_NEW_MOVE_TO_DOCK_TIP
forKey:@"WhatsNewPromoStatus"]; forKey:@"WhatsNewPromoStatus"];
PrefService* local_state = GetApplicationContext()->GetLocalState(); PrefService* local_state = GetApplicationContext()->GetLocalState();
ios::NotificationPromo::MigrateUserPrefs(local_state); ios::NotificationPromo::MigrateUserPrefs(local_state);
......
...@@ -61,9 +61,6 @@ const char kNTPHelpURL[] = ...@@ -61,9 +61,6 @@ const char kNTPHelpURL[] =
// The What's New promo command that shows the Bookmarks Manager. // The What's New promo command that shows the Bookmarks Manager.
const char kBookmarkCommand[] = "bookmark"; const char kBookmarkCommand[] = "bookmark";
// The What's New promo command that launches Rate This App.
const char kRateThisAppCommand[] = "ratethisapp";
} // namespace } // namespace
@interface NTPHomeMediator ()<CRWWebStateObserver, @interface NTPHomeMediator ()<CRWWebStateObserver,
...@@ -359,8 +356,6 @@ const char kRateThisAppCommand[] = "ratethisapp"; ...@@ -359,8 +356,6 @@ const char kRateThisAppCommand[] = "ratethisapp";
std::string command = notificationPromo->command(); std::string command = notificationPromo->command();
if (command == kBookmarkCommand) { if (command == kBookmarkCommand) {
[self.dispatcher showBookmarksManager]; [self.dispatcher showBookmarksManager];
} else if (command == kRateThisAppCommand) {
[self.dispatcher showRateThisAppDialog];
} else { } else {
NOTREACHED() << "Promo command is not valid."; NOTREACHED() << "Promo command is not valid.";
} }
......
...@@ -114,6 +114,7 @@ class ChromeBrowserProvider { ...@@ -114,6 +114,7 @@ class ChromeBrowserProvider {
CGRect frame) const NS_RETURNS_RETAINED; CGRect frame) const NS_RETURNS_RETAINED;
// Creates and returns an app ratings prompt object. Can return nil if app // Creates and returns an app ratings prompt object. Can return nil if app
// ratings prompts are not supported by the provider. // ratings prompts are not supported by the provider.
// TODO(crbug.com/863559): DEPRECATED: DO NOT USE
virtual id<AppRatingPrompt> CreateAppRatingPrompt() const NS_RETURNS_RETAINED; virtual id<AppRatingPrompt> CreateAppRatingPrompt() const NS_RETURNS_RETAINED;
// Initializes the cast service. Should be called soon after the given // Initializes the cast service. Should be called soon after the given
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
// AppRatingPromptDelegate declares methods that are called when significant // AppRatingPromptDelegate declares methods that are called when significant
// actions are performed on an AppRatingPrompt. // actions are performed on an AppRatingPrompt.
// TODO(crbug.com/863559): DEPRECATED: DO NOT USE
@protocol AppRatingPromptDelegate<NSObject> @protocol AppRatingPromptDelegate<NSObject>
@optional @optional
...@@ -28,6 +29,7 @@ ...@@ -28,6 +29,7 @@
// An AppRatingPrompt displays a modal dialog prompting the user to rate the // An AppRatingPrompt displays a modal dialog prompting the user to rate the
// current app, with additional options to send feedback or dismiss the dialog. // current app, with additional options to send feedback or dismiss the dialog.
// TODO(crbug.com/863559): DEPRECATED: DO NOT USE
@protocol AppRatingPrompt<NSObject> @protocol AppRatingPrompt<NSObject>
@required @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