-
Notifications
You must be signed in to change notification settings - Fork 0
/
8.diff
95 lines (95 loc) · 4.15 KB
/
8.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
diff --git a/ios/chrome/browser/ui/bookmarks/BUILD.gn b/ios/chrome/browser/ui/bookmarks/BUILD.gn
index 763ad52..0d7e2f9 100644
--- a/ios/chrome/browser/ui/bookmarks/BUILD.gn
+++ b/ios/chrome/browser/ui/bookmarks/BUILD.gn
@@ -130,6 +130,7 @@
"//ios/chrome/browser/ui/keyboard",
"//ios/chrome/browser/ui/material_components",
"//ios/chrome/browser/ui/ntp",
+ "//ios/chrome/browser/ui/util",
"//ios/chrome/browser/undo",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/ui",
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm b/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm
index fbdd23a..ac4d94f 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.mm
@@ -29,6 +29,7 @@
#import "ios/chrome/browser/ui/commands/application_commands.h"
#include "ios/chrome/browser/ui/uikit_ui_util.h"
#include "ios/chrome/browser/ui/url_loader.h"
+#import "ios/chrome/browser/ui/util/form_sheet_navigation_controller.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/Snackbar/src/MaterialSnackbar.h"
#include "ios/web/public/referrer.h"
@@ -184,8 +185,9 @@
if (bookmark_utils_ios::GetBookmarkUIPositionCache(self.bookmarkModel)) {
self.bookmarkBrowser.isReconstructingFromCache = YES;
}
- UINavigationController* navController = [[UINavigationController alloc]
- initWithRootViewController:self.bookmarkBrowser];
+ FormSheetNavigationController* navController =
+ [[FormSheetNavigationController alloc]
+ initWithRootViewController:self.bookmarkBrowser];
[navController setModalPresentationStyle:UIModalPresentationFormSheet];
[_parentController presentViewController:navController
animated:YES
diff --git a/ios/chrome/browser/ui/util/BUILD.gn b/ios/chrome/browser/ui/util/BUILD.gn
index b60dc1e..8b46d82 100644
--- a/ios/chrome/browser/ui/util/BUILD.gn
+++ b/ios/chrome/browser/ui/util/BUILD.gn
@@ -9,6 +9,8 @@
"CRUILabel+AttributeUtils.mm",
"core_text_util.h",
"core_text_util.mm",
+ "form_sheet_navigation_controller.h",
+ "form_sheet_navigation_controller.mm",
"i18n_string.h",
"i18n_string.mm",
"label_link_controller.h",
diff --git a/ios/chrome/browser/ui/util/form_sheet_navigation_controller.h b/ios/chrome/browser/ui/util/form_sheet_navigation_controller.h
new file mode 100644
index 0000000..c1315c2
--- /dev/null
+++ b/ios/chrome/browser/ui/util/form_sheet_navigation_controller.h
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_UTIL_FORM_SHEET_NAVIGATION_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_UTIL_FORM_SHEET_NAVIGATION_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+// A navigation controller subclass that respects the
+// disablesAutomaticKeyboardDismissal of its top view controller. This is useful
+// when presenting some view controllers in a navigation controller with
+// UIModalPresentationFormSheet.
+@interface FormSheetNavigationController : UINavigationController
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_UTIL_FORM_SHEET_NAVIGATION_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/util/form_sheet_navigation_controller.mm b/ios/chrome/browser/ui/util/form_sheet_navigation_controller.mm
new file mode 100644
index 0000000..ceb16e7
--- /dev/null
+++ b/ios/chrome/browser/ui/util/form_sheet_navigation_controller.mm
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/util/form_sheet_navigation_controller.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@implementation FormSheetNavigationController
+
+- (BOOL)disablesAutomaticKeyboardDismissal {
+ return self.topViewController.disablesAutomaticKeyboardDismissal;
+}
+
+@end