1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_PASSWORDS_PASSWORD_GENERATION_UTILS_H_
6 #define IOS_CHROME_BROWSER_PASSWORDS_PASSWORD_GENERATION_UTILS_H_
8 #import <Foundation/Foundation.h>
9 #import <CoreGraphics/CoreGraphics.h>
13 // Returns the frame determined by moving |inner_frame| inside |outer_frame|
14 // for the password generation input accessory views.
15 CGRect
GetGenerationAccessoryFrame(CGRect outer_frame
, CGRect inner_frame
);
17 // Block types for |RunSearchPipeline|.
18 typedef void (^PipelineBlock
)(void (^completion
)(BOOL
));
19 typedef void (^PipelineCompletionBlock
)(NSUInteger index
);
21 // Executes each PipelineBlock in |blocks| in order until one invokes its
22 // completion with YES, in which case |on_complete| will be invoked with the
23 // |index| of the succeeding block, or until they all invoke their completions
24 // with NO, in which case |on_complete| will be invoked with NSNotFound.
25 void RunSearchPipeline(NSArray
* blocks
, PipelineCompletionBlock on_complete
);
27 } // namespace passwords
29 #endif // IOS_CHROME_BROWSER_PASSWORDS_PASSWORD_GENERATION_UTILS_H_