Add ICU message format support
[chromium-blink-merge.git] / ios / web / web_state / js / crw_js_invoke_parameter_queue.h
blob7a6811a8d1f286bd67d3c2aedda9677e73992463
1 // Copyright 2012 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_WEB_WEB_STATE_JS_CRW_JS_INVOKE_PARAMETER_QUEUE_H_
6 #define IOS_WEB_WEB_STATE_JS_CRW_JS_INVOKE_PARAMETER_QUEUE_H_
8 #import <UIKit/UIKit.h>
10 class GURL;
12 // Manages access to individual invoke parameters.
13 @interface CRWJSInvokeParameters : NSObject
15 // The designated initializer.
16 - (id)initWithCommandString:(NSString*)commandString
17 userIsInteracting:(BOOL)userIsInteracting
18 originURL:(const GURL&)originURL
19 forWindowId:(NSString*)windowId;
21 // An escaped string with commands requested by JavaScript.
22 @property(nonatomic, readonly) NSString* commandString;
24 // Whether the user was interacting when the command was issued.
25 @property(nonatomic, readonly) BOOL userIsInteracting;
27 // Returns window id of the originating window.
28 @property(nonatomic, readonly) NSString* windowId;
30 // Returns URL that was current when the crwebinvoke was issued.
31 @property(nonatomic, readonly) const GURL& originURL;
33 @end
36 // Stores parameters passed from JavaScript for deferred processing.
37 @interface CRWJSInvokeParameterQueue : NSObject
39 // YES if there are no more queued messages.
40 @property(nonatomic, readonly) BOOL isEmpty;
42 // Adds a new item to the queue. |commandString| is the escaped command string,
43 // |userIsInteracting| is true if the user was interacting with the page,
44 // |originURL| is the URL the command came from, and |windowId| is the id of the
45 // window that sent the command.
46 - (void)addCommandString:(NSString*)commandString
47 userIsInteracting:(BOOL)userIsInteracting
48 originURL:(const GURL&)originURL
49 forWindowId:(NSString*)windowId;
51 // Removes from |queue_| any CRWJSInvokeParameters whose command string contains
52 // |commandString|.
53 - (void)removeCommandString:(NSString*)commandString;
55 // Removes the oldest item from the queue and returns it.
56 - (CRWJSInvokeParameters*)popInvokeParameters;
58 @end
60 @interface CRWJSInvokeParameterQueue (Testing)
61 // The number of items in the queue.
62 @property(nonatomic, readonly) NSUInteger queueLength;
63 @end
65 #endif // IOS_WEB_WEB_STATE_JS_CRW_JS_INVOKE_PARAMETER_QUEUE_H_