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

Unified Diff: ios/chrome/browser/ui/key_commands_provider.mm

Issue 2804703002: [ObjC ARC] Converts ios/chrome/browser/ui:ui_internal_arc to ARC. (Closed)
Patch Set: comments Created 3 years, 8 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/fullscreen_controller.mm ('k') | ios/chrome/browser/ui/open_in_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/key_commands_provider.mm
diff --git a/ios/chrome/browser/ui/key_commands_provider.mm b/ios/chrome/browser/ui/key_commands_provider.mm
index 6165af2e75b7e30ada3929e24b3c398353846f42..72c99b7b024c6cb77ee312e1ad97661a1bbb6f00 100644
--- a/ios/chrome/browser/ui/key_commands_provider.mm
+++ b/ios/chrome/browser/ui/key_commands_provider.mm
@@ -4,7 +4,6 @@
#import "ios/chrome/browser/ui/key_commands_provider.h"
-#import "base/ios/weak_nsobject.h"
#include "base/logging.h"
#include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/commands/generic_chrome_command.h"
@@ -14,22 +13,26 @@
#include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
@implementation KeyCommandsProvider
- (NSArray*)keyCommandsForConsumer:(id<KeyCommandsPlumbing>)consumer
editingText:(BOOL)editingText {
- base::WeakNSProtocol<id<KeyCommandsPlumbing>> weakConsumer(consumer);
+ __weak id<KeyCommandsPlumbing> weakConsumer = consumer;
// Block to execute a command from the |tag|.
- void (^execute)(NSInteger) = [[^(NSInteger tag) {
+ void (^execute)(NSInteger) = ^(NSInteger tag) {
[weakConsumer
chromeExecuteCommand:[GenericChromeCommand commandWithTag:tag]];
- } copy] autorelease];
+ };
// Block to have the tab model open the tab at |index|, if there is one.
- void (^focusTab)(NSUInteger) = [[^(NSUInteger index) {
+ void (^focusTab)(NSUInteger) = ^(NSUInteger index) {
[weakConsumer focusTabAtIndex:index];
- } copy] autorelease];
+ };
const BOOL hasTabs = [consumer tabsCount] > 0;
@@ -42,14 +45,14 @@
const int browseRightDescriptionID = useRTLLayout
? IDS_IOS_KEYBOARD_HISTORY_BACK
: IDS_IOS_KEYBOARD_HISTORY_FORWARD;
- BOOL (^canBrowseLeft)() = [[^() {
+ BOOL (^canBrowseLeft)() = ^() {
return useRTLLayout ? [weakConsumer canGoForward]
: [weakConsumer canGoBack];
- } copy] autorelease];
- BOOL (^canBrowseRight)() = [[^() {
+ };
+ BOOL (^canBrowseRight)() = ^() {
return useRTLLayout ? [weakConsumer canGoBack]
: [weakConsumer canGoForward];
- } copy] autorelease];
+ };
// Initialize the array of commands with an estimated capacity.
NSMutableArray* keyCommands = [NSMutableArray arrayWithCapacity:32];
« no previous file with comments | « ios/chrome/browser/ui/fullscreen_controller.mm ('k') | ios/chrome/browser/ui/open_in_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698