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

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

Issue 2585233003: Upstream Chrome on iOS source code [2/11]. (Closed)
Patch Set: Created 4 years 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
(Empty)
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.
4
5 #ifndef IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_
6 #define IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_
7
8 #import <Foundation/Foundation.h>
9
10 #include <memory>
11
12 #import "ios/web/web_state/web_state_impl.h"
13
14 // Encapsulates everything required to save a session "window". For iOS, there
15 // will only be one window at a time.
16 @interface SessionWindowIOS : NSObject<NSCoding>
17
18 // So that ownership transfer of WebStateImpls is explicit, SessionWindows
19 // are initialized "empty" (without any sessions) and sessions are added
20 // one at a time. For example:
21 // SessionWindowIOS* window = [[SessionWindow alloc] init];
22 // [window addSession:some_scoped_webstate_ptr.Pass()];
23 // ...
24 // [window setSelectedInex:mySelectedIndex];
25 - (void)addSession:(std::unique_ptr<web::WebStateImpl>)session;
26
27 - (void)clearSessions;
28
29 // Takes the first session stored in the reciever, removes it and passes
30 // ownership of it to the caller.
31 - (std::unique_ptr<web::WebStateImpl>)nextSession;
32
33 // The currently selected session. NSNotFound if the sessionWindow contains
34 // no sessions; otherwise 0 <= |selectedIndex| < |unclaimedSessions|.
35 @property(nonatomic) NSUInteger selectedIndex;
36 // A count of the remaining sessions that haven't been claimed.
37 @property(nonatomic, readonly) NSUInteger unclaimedSessions;
38
39 @end
40
41 #endif // IOS_CHROME_BROWSER_SESSIONS_SESSION_WINDOW_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/sessions/session_util.mm ('k') | ios/chrome/browser/sessions/session_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698