Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(849)

Unified Diff: ios/chrome/browser/ui/history/history_panel_view_controller.mm

Issue 2611543002: Escape on bluetooth keyboard closes the views (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/history/BUILD.gn ('k') | ios/chrome/browser/ui/reading_list/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/history/history_panel_view_controller.mm
diff --git a/ios/chrome/browser/ui/history/history_panel_view_controller.mm b/ios/chrome/browser/ui/history/history_panel_view_controller.mm
index 41be2faa97542d813293e05832e1e87c99454cf5..158840fa7aab955e35ed54ad2047a4d77147b9da 100644
--- a/ios/chrome/browser/ui/history/history_panel_view_controller.mm
+++ b/ios/chrome/browser/ui/history/history_panel_view_controller.mm
@@ -6,12 +6,14 @@
#include "base/ios/block_types.h"
#include "base/ios/ios_util.h"
+#include "base/ios/weak_nsobject.h"
#include "base/mac/scoped_nsobject.h"
#include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/history/clear_browsing_bar.h"
#import "ios/chrome/browser/ui/history/history_collection_view_controller.h"
#import "ios/chrome/browser/ui/history/history_search_view_controller.h"
#import "ios/chrome/browser/ui/icons/chrome_icon.h"
+#import "ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h"
#import "ios/chrome/browser/ui/material_components/utils.h"
#import "ios/chrome/browser/ui/ntp/recent_tabs/views/panel_bar_view.h"
#import "ios/chrome/browser/ui/show_privacy_settings_util.h"
@@ -378,4 +380,16 @@ CGFloat kShadowOpacity = 0.2f;
[_historyCollectionController hasHistoryEntries];
}
+#pragma mark - UIResponder
+
+- (NSArray*)keyCommands {
+ base::WeakNSObject<HistoryPanelViewController> weakSelf(self);
+ return @[ [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape
+ modifierFlags:Cr_UIKeyModifierNone
+ title:nil
+ action:^{
+ [weakSelf closeHistory];
+ }] ];
+}
+
@end
« no previous file with comments | « ios/chrome/browser/ui/history/BUILD.gn ('k') | ios/chrome/browser/ui/reading_list/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698