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 #import "ios/chrome/browser/sessions/session_window.h" | 5 #import "ios/chrome/browser/sessions/session_window.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #import "base/mac/scoped_nsobject.h" | 13 #import "base/mac/scoped_nsobject.h" |
14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
15 #import "ios/chrome/browser/sessions/NSCoder+Compatibility.h" | 15 #import "ios/chrome/browser/sessions/NSCoder+Compatibility.h" |
16 #import "ios/chrome/browser/sessions/session_service.h" | 16 #import "ios/chrome/browser/sessions/session_service.h" |
17 #import "ios/web/navigation/crw_session_controller.h" | |
18 #import "ios/web/public/web_thread.h" | 17 #import "ios/web/public/web_thread.h" |
19 #import "ios/web/web_state/web_state_impl.h" | |
20 | |
21 using web::WebStateImpl; | |
22 | 18 |
23 // Serialization keys. | 19 // Serialization keys. |
24 NSString* const kSessionsKey = @"sessions"; | 20 NSString* const kSessionsKey = @"sessions"; |
25 NSString* const kSelectedIndexKey = @"selectedIndex"; | 21 NSString* const kSelectedIndexKey = @"selectedIndex"; |
26 | 22 |
27 @interface SessionWindowIOS () { | 23 @interface SessionWindowIOS () { |
28 // Backing objects for properties of the same name. | 24 // Backing objects for properties of the same name. |
29 base::scoped_nsobject<NSMutableArray> _sessions; | 25 base::scoped_nsobject<NSMutableArray> _sessions; |
30 NSUInteger _selectedIndex; | 26 NSUInteger _selectedIndex; |
31 } | 27 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 (!sessionCount && index == NSNotFound); | 106 (!sessionCount && index == NSNotFound); |
111 } | 107 } |
112 | 108 |
113 - (NSString*)description { | 109 - (NSString*)description { |
114 return [NSString stringWithFormat:@"selected index: %" PRIuNS | 110 return [NSString stringWithFormat:@"selected index: %" PRIuNS |
115 "\nsessions:\n%@\n", | 111 "\nsessions:\n%@\n", |
116 _selectedIndex, _sessions.get()]; | 112 _selectedIndex, _sessions.get()]; |
117 } | 113 } |
118 | 114 |
119 @end | 115 @end |
OLD | NEW |