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

Side by Side Diff: ios/chrome/browser/sessions/session_window.h

Issue 2687353003: Created SerializableUserDataManager. (Closed)
Patch Set: self review, added unittest Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_H_ 5 #ifndef IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_
6 #define IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_ 6 #define IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #import "ios/web/web_state/web_state_impl.h" 12 #import "ios/web/web_state/web_state_impl.h"
13 13
14 @class CRWNavigationManagerStorage; 14 @class CRWSessionStorage;
15 15
16 // Encapsulates everything required to save a session "window". For iOS, there 16 // Encapsulates everything required to save a session "window". For iOS, there
17 // will only be one window at a time. 17 // will only be one window at a time.
18 @interface SessionWindowIOS : NSObject<NSCoding> 18 @interface SessionWindowIOS : NSObject<NSCoding>
19 19
20 // Adds a serialized session to be written to disk. SessionWindows are 20 // Adds a serialized session to be written to disk. SessionWindows are
21 // initialized "empty" (without any sessions) and sessions are added one at a 21 // initialized "empty" (without any sessions) and sessions are added one at a
22 // time. For example: 22 // time. For example:
23 // SessionWindowIOS* window = [[SessionWindow alloc] init]; 23 // SessionWindowIOS* window = [[SessionWindow alloc] init];
24 // [window addSerializedSession:session_storage]; 24 // [window addSerializedSession:session_storage];
25 // ... 25 // ...
26 // [window setSelectedIndex:mySelectedIndex]; 26 // [window setSelectedIndex:mySelectedIndex];
27 - (void)addSerializedSession:(CRWNavigationManagerStorage*)session; 27 - (void)addSerializedSession:(CRWSessionStorage*)session;
Eugene But (OOO till 7-30) 2017/02/11 02:46:48 Is this final API? If so you you please rename thi
kkhorimoto 2017/02/11 03:19:48 Done.
28 28
29 // Clears all added sessions. 29 // Clears all added sessions.
30 - (void)clearSessions; 30 - (void)clearSessions;
31 31
32 // The serialized session objects. 32 // The serialized session objects.
33 @property(nonatomic, readonly) NSArray* sessions; 33 @property(nonatomic, readonly) NSArray* sessions;
34 34
35 // The currently selected session. NSNotFound if the sessionWindow contains 35 // The currently selected session. NSNotFound if the sessionWindow contains
36 // no sessions; otherwise 0 <= |selectedIndex| < |unclaimedSessions|. 36 // no sessions; otherwise 0 <= |selectedIndex| < |unclaimedSessions|.
37 @property(nonatomic) NSUInteger selectedIndex; 37 @property(nonatomic) NSUInteger selectedIndex;
38 38
39 @end 39 @end
40 40
41 #endif // IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_ 41 #endif // IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698