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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/history/history_panel_view_controller.h" 5 #import "ios/chrome/browser/ui/history/history_panel_view_controller.h"
6 6
7 #include "base/ios/block_types.h" 7 #include "base/ios/block_types.h"
8 #include "base/ios/ios_util.h" 8 #include "base/ios/ios_util.h"
9 #include "base/ios/weak_nsobject.h"
9 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
10 #include "components/strings/grit/components_strings.h" 11 #include "components/strings/grit/components_strings.h"
11 #import "ios/chrome/browser/ui/history/clear_browsing_bar.h" 12 #import "ios/chrome/browser/ui/history/clear_browsing_bar.h"
12 #import "ios/chrome/browser/ui/history/history_collection_view_controller.h" 13 #import "ios/chrome/browser/ui/history/history_collection_view_controller.h"
13 #import "ios/chrome/browser/ui/history/history_search_view_controller.h" 14 #import "ios/chrome/browser/ui/history/history_search_view_controller.h"
14 #import "ios/chrome/browser/ui/icons/chrome_icon.h" 15 #import "ios/chrome/browser/ui/icons/chrome_icon.h"
16 #import "ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h"
15 #import "ios/chrome/browser/ui/material_components/utils.h" 17 #import "ios/chrome/browser/ui/material_components/utils.h"
16 #import "ios/chrome/browser/ui/ntp/recent_tabs/views/panel_bar_view.h" 18 #import "ios/chrome/browser/ui/ntp/recent_tabs/views/panel_bar_view.h"
17 #import "ios/chrome/browser/ui/show_privacy_settings_util.h" 19 #import "ios/chrome/browser/ui/show_privacy_settings_util.h"
18 #import "ios/chrome/browser/ui/uikit_ui_util.h" 20 #import "ios/chrome/browser/ui/uikit_ui_util.h"
19 #import "ios/chrome/browser/ui/url_loader.h" 21 #import "ios/chrome/browser/ui/url_loader.h"
20 #include "ios/chrome/grit/ios_strings.h" 22 #include "ios/chrome/grit/ios_strings.h"
21 #import "ios/third_party/material_components_ios/src/components/AppBar/src/Mater ialAppBar.h" 23 #import "ios/third_party/material_components_ios/src/components/AppBar/src/Mater ialAppBar.h"
22 #import "ios/third_party/material_components_ios/src/components/NavigationBar/sr c/MaterialNavigationBar.h" 24 #import "ios/third_party/material_components_ios/src/components/NavigationBar/sr c/MaterialNavigationBar.h"
23 #include "ui/base/l10n/l10n_util_mac.h" 25 #include "ui/base/l10n/l10n_util_mac.h"
24 26
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 373 }
372 374
373 - (void)configureClearBrowsingBar { 375 - (void)configureClearBrowsingBar {
374 _clearBrowsingBar.get().editing = _historyCollectionController.get().editing; 376 _clearBrowsingBar.get().editing = _historyCollectionController.get().editing;
375 _clearBrowsingBar.get().deleteButtonEnabled = 377 _clearBrowsingBar.get().deleteButtonEnabled =
376 [_historyCollectionController hasSelectedEntries]; 378 [_historyCollectionController hasSelectedEntries];
377 _clearBrowsingBar.get().editButtonEnabled = 379 _clearBrowsingBar.get().editButtonEnabled =
378 [_historyCollectionController hasHistoryEntries]; 380 [_historyCollectionController hasHistoryEntries];
379 } 381 }
380 382
383 #pragma mark - UIResponder
384
385 - (NSArray*)keyCommands {
386 base::WeakNSObject<HistoryPanelViewController> weakSelf(self);
387 return @[ [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape
388 modifierFlags:Cr_UIKeyModifierNone
389 title:nil
390 action:^{
391 [weakSelf closeHistory];
392 }] ];
393 }
394
381 @end 395 @end
OLDNEW
« 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