| 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". |
| 13 // will only be one window at a time. | |
| 14 @interface SessionWindowIOS : NSObject<NSCoding> | 13 @interface SessionWindowIOS : NSObject<NSCoding> |
| 15 | 14 |
| 16 // Initializes SessionsWindowIOS using the parameters are initial values for | 15 // Initializes SessionsWindowIOS using the parameters are initial values for |
| 17 // the |sessions| and |selectedIndex| properties. |selectedIndex| must be a | 16 // the |sessions| and |selectedIndex| properties. |selectedIndex| must be a |
| 18 // valid indice in |sessions| or NSNotFound if |sessions| is empty. | 17 // valid indice in |sessions| or NSNotFound if |sessions| is empty. |
| 19 - (instancetype)initWithSessions:(NSArray<CRWSessionStorage*>*)sessions | 18 - (instancetype)initWithSessions:(NSArray<CRWSessionStorage*>*)sessions |
| 20 selectedIndex:(NSUInteger)selectedIndex | 19 selectedIndex:(NSUInteger)selectedIndex |
| 21 NS_DESIGNATED_INITIALIZER; | 20 NS_DESIGNATED_INITIALIZER; |
| 22 | 21 |
| 23 // The serialized session objects. | 22 // The serialized session objects. |
| 24 @property(nonatomic, readonly) NSArray<CRWSessionStorage*>* sessions; | 23 @property(nonatomic, readonly) NSArray<CRWSessionStorage*>* sessions; |
| 25 | 24 |
| 26 // The currently selected session. NSNotFound if the sessionWindow contains | 25 // The currently selected session. NSNotFound if the sessionWindow contains |
| 27 // no sessions; otherwise a valid index in |sessions|. | 26 // no sessions; otherwise a valid index in |sessions|. |
| 28 @property(nonatomic, readonly) NSUInteger selectedIndex; | 27 @property(nonatomic, readonly) NSUInteger selectedIndex; |
| 29 | 28 |
| 30 @end | 29 @end |
| 31 | 30 |
| 32 #endif // IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ | 31 #endif // IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_IOS_H_ |
| OLD | NEW |