OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ | 5 #ifndef IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ |
6 #define IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ | 6 #define IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 @class CRWSessionStorage; | 10 @class CRWSessionStorage; |
11 | 11 |
12 // Encapsulates everything required to save a session "window". For iOS, there | 12 // Encapsulates everything required to save a session "window". For iOS, there |
13 // will only be one window at a time. | 13 // will only be one window at a time. |
14 @interface SessionWindowIOS : NSObject<NSCoding> | 14 @interface SessionWindowIOS : NSObject<NSCoding> |
15 | 15 |
16 // Initializes SessionsWindowIOS using the parameters are initial values for | 16 // Initializes SessionsWindowIOS using the parameters are initial values for |
17 // the |sessions| and |selectedIndex| properties. |selectedIndex| must be a | 17 // the |sessions| and |selectedIndex| properties. |selectedIndex| must be a |
18 // valid indice in |sessions| or NSNotFound if |sessions| is empty. | 18 // valid indice in |sessions| or NSNotFound if |sessions| is empty. |
19 - (instancetype)initWithSessions:(NSArray<CRWSessionStorage*>*)sessions | 19 - (instancetype)initWithSessions:(NSArray<CRWSessionStorage*>*)sessions |
20 selectedIndex:(NSUInteger)selectedIndex | 20 selectedIndex:(NSUInteger)selectedIndex |
21 NS_DESIGNATED_INITIALIZER; | 21 NS_DESIGNATED_INITIALIZER; |
22 | 22 |
23 // Clears all added sessions. | |
24 - (void)clearSessions; | |
25 | |
26 // The serialized session objects. | 23 // The serialized session objects. |
27 @property(nonatomic, readonly) NSArray<CRWSessionStorage*>* sessions; | 24 @property(nonatomic, readonly) NSArray<CRWSessionStorage*>* sessions; |
28 | 25 |
29 // The currently selected session. NSNotFound if the sessionWindow contains | 26 // The currently selected session. NSNotFound if the sessionWindow contains |
30 // no sessions; otherwise a valid index in |sessions|. | 27 // no sessions; otherwise a valid index in |sessions|. |
31 @property(nonatomic, readonly) NSUInteger selectedIndex; | 28 @property(nonatomic, readonly) NSUInteger selectedIndex; |
32 | 29 |
33 @end | 30 @end |
34 | 31 |
35 #endif // IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ | 32 #endif // IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ |
OLD | NEW |