Index: ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
diff --git a/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm b/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
index 89e24dd73f2053badc7997a03dd697bae4a59555..10cf192b2b99a5a169b42ed42ff470e3a6d64c6b 100644 |
--- a/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
+++ b/ios/chrome/browser/ui/sad_tab/sad_tab_view.mm |
@@ -20,6 +20,7 @@ |
#import "ios/chrome/browser/ui/util/label_link_controller.h" |
#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" |
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" |
+#include "ios/web/public/browser_state.h" |
#include "ios/web/public/navigation_manager.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "url/gurl.h" |
@@ -240,13 +241,25 @@ NSString* const kMessageTextViewBulletRTLFormat = @"\u202E%@\u202C"; |
NSMutableAttributedString* feedbackString = |
[[NSMutableAttributedString alloc] |
initWithString:feedbackIntroductionString]; |
+ |
+ BOOL isAlreadyInIncognitoMode = |
+ _navigationManager->GetBrowserState()->IsOffTheRecord(); |
+ NSMutableArray* stringsArray = [NSMutableArray |
+ arrayWithObjects:l10n_util::GetNSString( |
+ IDS_SAD_TAB_RELOAD_CLOSE_NOTABS), |
+ l10n_util::GetNSString( |
+ IDS_SAD_TAB_RELOAD_RESTART_BROWSER), |
+ l10n_util::GetNSString( |
+ IDS_SAD_TAB_RELOAD_RESTART_DEVICE), |
+ nil]; |
kkhorimoto
2017/06/22 00:33:31
I think the formatting here would be much better i
PL
2017/06/22 15:15:38
I agree, but unfortunately I am not able to make m
kkhorimoto
2017/06/22 18:20:10
[@[] mutableCopy], or [NSMutableArray arrayWithArr
|
+ if (!isAlreadyInIncognitoMode) { |
+ [stringsArray |
+ insertObject:l10n_util::GetNSString(IDS_SAD_TAB_RELOAD_INCOGNITO) |
kkhorimoto
2017/06/22 00:33:31
Maybe declare the string on a separate line to hel
PL
2017/06/22 15:15:38
Done! Thanks!
kkhorimoto
2017/06/22 18:20:10
You said Done, but there's no new patch :)
|
+ atIndex:1]; |
+ } |
+ |
NSAttributedString* bulletedListString = |
- [[self class] bulletedAttributedStringFromStrings:@[ |
- l10n_util::GetNSString(IDS_SAD_TAB_RELOAD_CLOSE_NOTABS), |
- l10n_util::GetNSString(IDS_SAD_TAB_RELOAD_INCOGNITO), |
- l10n_util::GetNSString(IDS_SAD_TAB_RELOAD_RESTART_BROWSER), |
- l10n_util::GetNSString(IDS_SAD_TAB_RELOAD_RESTART_DEVICE) |
- ]]; |
+ [[self class] bulletedAttributedStringFromStrings:stringsArray]; |
[feedbackString appendAttributedString:bulletedListString]; |
label = feedbackString; |
break; |