Commit 3c12de2e authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[multiball] Fix safe mode in multiwindow.

Fix the way localized strings are accessed in UI blocker to allow them
to be safely loaded in multiwindow.
Also remove the "." in "Switch to Open Window."

Fixed: 1126071
Change-Id: I4346d84c288ef8a88375e6a985e27e5b550481e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2398545
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805813}
parent 6708b223
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
<string>IDS_IOS_SAFE_MODE_CRASH_REPORT_SENT</string> <string>IDS_IOS_SAFE_MODE_CRASH_REPORT_SENT</string>
<string>IDS_IOS_SAFE_MODE_RELOAD_CHROME</string> <string>IDS_IOS_SAFE_MODE_RELOAD_CHROME</string>
<string>IDS_IOS_SAFE_MODE_AW_SNAP</string> <string>IDS_IOS_SAFE_MODE_AW_SNAP</string>
<string>IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_DESCRIPTION</string>
<string>IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_SWITCH_WINDOW_ACTION</string>
</array> </array>
</dict> </dict>
<dict> <dict>
...@@ -64,12 +66,12 @@ ...@@ -64,12 +66,12 @@
<key>output</key> <key>output</key>
<string>Z6KvRw</string> <string>Z6KvRw</string>
</dict> </dict>
<dict> <dict>
<key>input</key> <key>input</key>
<string>IDS_IOS_INTENTS_SEARCH_IN_CHROME_PARAMETER_COMBINATION_TITLE</string> <string>IDS_IOS_INTENTS_SEARCH_IN_CHROME_PARAMETER_COMBINATION_TITLE</string>
<key>output</key> <key>output</key>
<string>TqBLdA</string> <string>TqBLdA</string>
</dict> </dict>
<dict> <dict>
<key>input</key> <key>input</key>
<string>IDS_IOS_INTENTS_OPEN_IN_CHROME_PARAMETER_COMBINATION_TITLE</string> <string>IDS_IOS_INTENTS_OPEN_IN_CHROME_PARAMETER_COMBINATION_TITLE</string>
......
...@@ -2615,7 +2615,7 @@ New Search ...@@ -2615,7 +2615,7 @@ New Search
Finish what you were doing in your other open Chrome window. Finish what you were doing in your other open Chrome window.
</message> </message>
<message name="IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_SWITCH_WINDOW_ACTION" desc="Button label that appears on a button to switch to some other window, when the user has multiple windows open, and one window is showing a dialog that has to be interacted with before any other window can be used."> <message name="IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_SWITCH_WINDOW_ACTION" desc="Button label that appears on a button to switch to some other window, when the user has multiple windows open, and one window is showing a dialog that has to be interacted with before any other window can be used.">
Switch to Open Window. Switch to Open Window
</message> </message>
</messages> </messages>
</release> </release>
......
e448023f24ac158305420ed7805ebb815672c2f3 c95d540e199725667b9c55a84e699a267bcdc70b
\ No newline at end of file \ No newline at end of file
...@@ -15,6 +15,5 @@ source_set("blocking_overlay") { ...@@ -15,6 +15,5 @@ source_set("blocking_overlay") {
"//ios/chrome/app/strings:ios_strings", "//ios/chrome/app/strings:ios_strings",
"//ios/chrome/common/ui/colors", "//ios/chrome/common/ui/colors",
"//ios/chrome/common/ui/util", "//ios/chrome/common/ui/util",
"//ui/base",
] ]
} }
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/chrome/common/ui/util/constraints_ui_util.h" #import "ios/chrome/common/ui/util/constraints_ui_util.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -22,6 +21,9 @@ const CGFloat kButtonSpacing = 20.0f; ...@@ -22,6 +21,9 @@ const CGFloat kButtonSpacing = 20.0f;
} // namespace } // namespace
// This view controller is used in Safe Mode. This means everything used here
// must not require any advanced initialization that only happens after safe
// mode.
@implementation BlockingOverlayViewController @implementation BlockingOverlayViewController
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
...@@ -41,8 +43,11 @@ const CGFloat kButtonSpacing = 20.0f; ...@@ -41,8 +43,11 @@ const CGFloat kButtonSpacing = 20.0f;
AddSameConstraints(self.view, backgroundBlurEffect); AddSameConstraints(self.view, backgroundBlurEffect);
UILabel* label = [[UILabel alloc] init]; UILabel* label = [[UILabel alloc] init];
label.text = // Here and everywhere, use NSLocalizedString because the usual localization
l10n_util::GetNSString(IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_DESCRIPTION); // method with l10n_util::GetNSString() requires initialization that happens
// after safe mode completes.
label.text = NSLocalizedString(
@"IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_DESCRIPTION", @"");
label.textColor = [UIColor colorNamed:kGrey800Color]; label.textColor = [UIColor colorNamed:kGrey800Color];
label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
label.textAlignment = NSTextAlignmentCenter; label.textAlignment = NSTextAlignmentCenter;
...@@ -56,9 +61,11 @@ const CGFloat kButtonSpacing = 20.0f; ...@@ -56,9 +61,11 @@ const CGFloat kButtonSpacing = 20.0f;
UIButton* button = [[UIButton alloc] init]; UIButton* button = [[UIButton alloc] init];
button.translatesAutoresizingMaskIntoConstraints = NO; button.translatesAutoresizingMaskIntoConstraints = NO;
[button setTitle:l10n_util::GetNSString( [button
IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_SWITCH_WINDOW_ACTION) setTitle:NSLocalizedString(
forState:UIControlStateNormal]; @"IDS_IOS_UI_BLOCKED_USE_OTHER_WINDOW_SWITCH_WINDOW_ACTION",
@"")
forState:UIControlStateNormal];
[button setTitleColor:[UIColor colorNamed:kBlueColor] [button setTitleColor:[UIColor colorNamed:kBlueColor]
forState:UIControlStateNormal]; forState:UIControlStateNormal];
button.titleLabel.font = button.titleLabel.font =
......
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