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

Issue 2734863002: [ios] Adds a CommandDispatcher to proxy method calls to UI handlers. (Closed)

Created:
3 years, 9 months ago by rohitrao (ping after 24h)
Modified:
3 years, 9 months ago
CC:
chromium-reviews, marq+scrutinize_chromium.org, lpromero+watch_chromium.org, ios-reviews+clean_chromium.org, ios-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[ios] Adds a CommandDispatcher to proxy method calls to UI handlers. This class will be used by the command architecture in the clean skeleton app. View controllers will receive a pointer to a CommandDispatcher and can use it to send command methods to the appropriate coordinators. BUG=698748 TEST=None Review-Url: https://codereview.chromium.org/2734863002 Cr-Commit-Position: refs/heads/master@{#456075} Committed: https://chromium.googlesource.com/chromium/src/+/5dc19b0874e342a145a3a648a2c82a05406065c0

Patch Set 1 #

Patch Set 2 : Fix GN. #

Total comments: 17

Patch Set 3 : Review. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -0 lines) Patch
M ios/clean/chrome/browser/ui/commands/BUILD.gn View 1 1 chunk +19 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/commands/command_dispatcher.h View 1 2 1 chunk +24 lines, -0 lines 8 comments Download
A ios/clean/chrome/browser/ui/commands/command_dispatcher.mm View 1 2 1 chunk +55 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/commands/command_dispatcher_unittest.mm View 1 2 1 chunk +233 lines, -0 lines 0 comments Download
M ios/clean/chrome/test/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 36 (18 generated)
rohitrao (ping after 24h)
Rough draft. Is this all I need, or can you think of anything that's missing? ...
3 years, 9 months ago (2017-03-06 14:41:32 UTC) #4
sdefresne
Yes, I think that this is all that is needed to implement the CommandDispatcher as ...
3 years, 9 months ago (2017-03-06 22:32:59 UTC) #11
lpromero
To Sylvain's point about private conformance to a protocol: I would put it publicly. For ...
3 years, 9 months ago (2017-03-07 10:04:17 UTC) #13
sdefresne
On 2017/03/07 10:04:17, lpromero wrote: > To Sylvain's point about private conformance to a protocol: ...
3 years, 9 months ago (2017-03-07 17:04:16 UTC) #14
lpromero
On 2017/03/07 17:04:16, sdefresne wrote: > The problem is that we expect to have ~40 ...
3 years, 9 months ago (2017-03-07 17:58:43 UTC) #15
sdefresne
On 2017/03/07 17:58:43, lpromero wrote: > On 2017/03/07 17:04:16, sdefresne wrote: > > The problem ...
3 years, 9 months ago (2017-03-07 18:00:46 UTC) #16
rohitrao (ping after 24h)
I'm not convinced that conforming to protocols will actually help. Even if the dispatcher conforms ...
3 years, 9 months ago (2017-03-07 18:53:59 UTC) #17
sdefresne
https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h File ios/clean/chrome/browser/ui/commands/command_dispatcher.h (right): https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h#newcode10 ios/clean/chrome/browser/ui/commands/command_dispatcher.h:10: @interface CommandDispatcher : NSObject Can you document the class ...
3 years, 9 months ago (2017-03-07 19:12:35 UTC) #18
sdefresne
On 2017/03/07 18:53:59, rohitrao wrote: > I'm not convinced that conforming to protocols will actually ...
3 years, 9 months ago (2017-03-07 19:19:33 UTC) #19
rohitrao (ping after 24h)
https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h File ios/clean/chrome/browser/ui/commands/command_dispatcher.h (right): https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h#newcode10 ios/clean/chrome/browser/ui/commands/command_dispatcher.h:10: @interface CommandDispatcher : NSObject On 2017/03/07 19:12:35, sdefresne wrote: ...
3 years, 9 months ago (2017-03-09 14:41:12 UTC) #22
sdefresne
lgtm https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.mm File ios/clean/chrome/browser/ui/commands/command_dispatcher.mm (right): https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.mm#newcode11 ios/clean/chrome/browser/ui/commands/command_dispatcher.mm:11: On 2017/03/09 14:41:11, rohitrao wrote: > On 2017/03/07 ...
3 years, 9 months ago (2017-03-09 15:38:07 UTC) #23
lpromero
lgtm https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.mm File ios/clean/chrome/browser/ui/commands/command_dispatcher.mm (right): https://codereview.chromium.org/2734863002/diff/20001/ios/clean/chrome/browser/ui/commands/command_dispatcher.mm#newcode11 ios/clean/chrome/browser/ui/commands/command_dispatcher.mm:11: On 2017/03/09 14:41:11, rohitrao wrote: > On 2017/03/07 ...
3 years, 9 months ago (2017-03-09 16:16:30 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2734863002/40001
3 years, 9 months ago (2017-03-10 14:42:45 UTC) #28
rohitrao (ping after 24h)
https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h File ios/clean/chrome/browser/ui/commands/command_dispatcher.h (right): https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h#newcode20 ios/clean/chrome/browser/ui/commands/command_dispatcher.h:20: - (void)stopDispatchingForTarget:(id)target; On 2017/03/09 16:16:30, lpromero wrote: > s/…/unregisterTarget: ...
3 years, 9 months ago (2017-03-10 14:44:31 UTC) #29
lpromero
https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h File ios/clean/chrome/browser/ui/commands/command_dispatcher.h (right): https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h#newcode17 ios/clean/chrome/browser/ui/commands/command_dispatcher.h:17: - (void)registerTarget:(id)target forSelector:(SEL)selector; The comment doesn't specify that you ...
3 years, 9 months ago (2017-03-10 16:17:36 UTC) #30
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/5dc19b0874e342a145a3a648a2c82a05406065c0
3 years, 9 months ago (2017-03-10 16:35:12 UTC) #33
marq (ping after 24h)
Post-hoc comments. https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h File ios/clean/chrome/browser/ui/commands/command_dispatcher.h (right): https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browser/ui/commands/command_dispatcher.h#newcode13 ios/clean/chrome/browser/ui/commands/command_dispatcher.h:13: @interface CommandDispatcher : NSObject Doesn't CommandDispatcher need ...
3 years, 9 months ago (2017-03-16 13:54:47 UTC) #35
lpromero
3 years, 9 months ago (2017-03-21 15:15:33 UTC) #36
Message was sent while issue was closed.
https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browse...
File ios/clean/chrome/browser/ui/commands/command_dispatcher.h (right):

https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browse...
ios/clean/chrome/browser/ui/commands/command_dispatcher.h:13: @interface
CommandDispatcher : NSObject
On 2017/03/16 13:54:46, marq wrote:
> Doesn't CommandDispatcher need to publicly conform to all of the command
> protocols?

This is discussed upthread.

https://codereview.chromium.org/2734863002/diff/40001/ios/clean/chrome/browse...
ios/clean/chrome/browser/ui/commands/command_dispatcher.h:20: -
(void)stopDispatchingForTarget:(id)target;
On 2017/03/16 13:54:46, marq wrote:
> On 2017/03/10 16:17:36, lpromero wrote:
> > On 2017/03/10 14:44:31, rohitrao wrote:
> > > On 2017/03/09 16:16:30, lpromero wrote:
> > > > s/…/unregisterTarget: ?
> > > 
> > > I went through a number of iterations:
> > > unregisterTarget
> > > deregisterTarget
> > > stopForwardingForTarget
> > > 
> > > Eventually I settled on stopDispatchingForTarget because it sounded the
> least
> > > odd.  I can change the name if no one else likes it =)
> > > 
> > > I've also been a bit inconsistent about "target" vs "handler".  Do you
have
> a
> > > preference for one vs the other?
> > 
> > Handler might convey more that fact that we can only have one, no?
> 
> I like -stopDispatching:, so much that I'd like to see the other method become
> dispatchToTarget: forSelector:

https://codereview.chromium.org/2766663002/

Powered by Google App Engine
This is Rietveld 408576698