Commit af603aee authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][DarkMode] Pass user interface style in the crash logs

Bug: 1004397
Change-Id: Ie20fcd85eacbdab152f33fbb5db46611a0c943bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807315Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696886}
parent 4d37cd54
......@@ -68,6 +68,8 @@
- (void)updateBreakpad {
breakpad_helper::SetCurrentHorizontalSizeClass(
self.traitCollection.horizontalSizeClass);
breakpad_helper::SetCurrentUserInterfaceStyle(
self.traitCollection.userInterfaceStyle);
}
#pragma mark - UITraitEnvironment
......@@ -87,6 +89,7 @@
[self.userInterfaceStyleRecorder
userInterfaceStyleDidChange:self.traitCollection.userInterfaceStyle];
}
[self updateBreakpad];
}
}
......
......@@ -97,6 +97,11 @@ void SetCurrentOrientation(int statusBarOrientation, int deviceOrientation);
// values from 0 to 2).
void SetCurrentHorizontalSizeClass(int horizontalSizeClass);
// Sets a key in browser_state dictionary to store the device user interface
// style. The values are from the UIKit UIUserInterfaceStyle enum (decimal
// values from 0 to 2).
void SetCurrentUserInterfaceStyle(int userInterfaceStyle);
// Sets a key in browser_state dictionary to store the count of regular tabs.
void SetRegularTabCount(int tabCount);
......
......@@ -57,6 +57,7 @@ NSString* const kGridToVisibleTabAnimation = @"grid_to_visible_tab_animation";
// These are the values grouped in the user_application_state parameter.
NSString* const kOrientationState = @"orient";
NSString* const kHorizontalSizeClass = @"sizeclass";
NSString* const kUserInterfaceStyle = @"user_interface_style";
NSString* const kSignedIn = @"signIn";
NSString* const kIsShowingPDF = @"pdf";
NSString* const kVideoPlaying = @"avplay";
......@@ -319,6 +320,12 @@ void SetCurrentHorizontalSizeClass(int horizontalSizeClass) {
withValue:horizontalSizeClass];
}
void SetCurrentUserInterfaceStyle(int userInterfaceStyle) {
[[CrashReportUserApplicationState sharedInstance]
setValue:kUserInterfaceStyle
withValue:userInterfaceStyle];
}
void SetCurrentlySignedIn(bool signedIn) {
if (signedIn) {
[[CrashReportUserApplicationState sharedInstance] setValue:kSignedIn
......
......@@ -60,6 +60,7 @@ TEST_F(BreakpadHelperTest, CrashReportUserApplicationStateAllKeys) {
// single breakpad record.
breakpad_helper::SetCurrentOrientation(3, 7);
breakpad_helper::SetCurrentHorizontalSizeClass(2);
breakpad_helper::SetCurrentUserInterfaceStyle(2);
breakpad_helper::SetRegularTabCount(999);
breakpad_helper::SetIncognitoTabCount(999);
breakpad_helper::SetDestroyingAndRebuildingIncognitoBrowserState(true);
......
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