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

Side by Side Diff: ios/shared/chrome/browser/ui/commands/command_dispatcher.h

Issue 2785153002: Add protocol APIs to CommandDispatcher. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef IOS_SHARED_CHROME_BROWSER_UI_COMMANDS_COMMAND_DISPATCHER_H_ 5 #ifndef IOS_SHARED_CHROME_BROWSER_UI_COMMANDS_COMMAND_DISPATCHER_H_
6 #define IOS_SHARED_CHROME_BROWSER_UI_COMMANDS_COMMAND_DISPATCHER_H_ 6 #define IOS_SHARED_CHROME_BROWSER_UI_COMMANDS_COMMAND_DISPATCHER_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 9
10 // CommandDispatcher allows coordinators to register as command handlers for 10 // CommandDispatcher allows coordinators to register as command handlers for
11 // specific selectors. Other objects can call these methods on the dispatcher, 11 // specific selectors. Other objects can call these methods on the dispatcher,
12 // which in turn will forward the call to the registered handler. 12 // which in turn will forward the call to the registered handler.
13 @interface CommandDispatcher : NSObject 13 @interface CommandDispatcher : NSObject
14 14
15 // Registers the given |target| to receive forwarded messages for the given 15 // Registers the given |target| to receive forwarded messages for the given
16 // |selector|. 16 // |selector|.
17 - (void)startDispatchingToTarget:(id)target forSelector:(SEL)selector; 17 - (void)startDispatchingToTarget:(id)target forSelector:(SEL)selector;
18 18
19 // Registers the given |target| to receive forwarded messages for the methods of
20 // the given |protocol|. Only required instance methods are registered. The
21 // other definitions in the protocol are ignored.
22 - (void)startDispatchingToTarget:(id)target forProtocol:(Protocol*)protocol;
23
19 // Removes forwarding registration for the given |selector|. 24 // Removes forwarding registration for the given |selector|.
20 - (void)stopDispatchingForSelector:(SEL)selector; 25 - (void)stopDispatchingForSelector:(SEL)selector;
21 26
27 // Removes forwarding registration for the given |selector|. Only dispatching to
28 // required instance methods is removed. The other definitions in the protocol
29 // are ignored.
30 - (void)stopDispatchingForProtocol:(Protocol*)protocol;
31
22 // Removes all forwarding registrations for the given |target|. 32 // Removes all forwarding registrations for the given |target|.
23 - (void)stopDispatchingToTarget:(id)target; 33 - (void)stopDispatchingToTarget:(id)target;
24 34
25 @end 35 @end
26 36
27 #endif // IOS_SHARED_CHROME_BROWSER_UI_COMMANDS_COMMAND_DISPATCHER_H_ 37 #endif // IOS_SHARED_CHROME_BROWSER_UI_COMMANDS_COMMAND_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698