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

Side by Side Diff: ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.mm

Issue 2791393003: [ObjC ARC] Converts ios/chrome/browser/ui/ntp/recent_tabs:recent_tabs to ARC. (Closed)
Patch Set: weak Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" 5 #include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h"
6 6
7 #include <functional> 7 #include <functional>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
13 #include "base/metrics/field_trial.h" 12 #include "base/metrics/field_trial.h"
14 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
15 #include "components/sync/driver/sync_service.h" 14 #include "components/sync/driver/sync_service.h"
16 #include "components/sync_sessions/open_tabs_ui_delegate.h" 15 #include "components/sync_sessions/open_tabs_ui_delegate.h"
17 #include "ios/chrome/browser/sync/sync_setup_service.h" 16 #include "ios/chrome/browser/sync/sync_setup_service.h"
18 17
18 #if !defined(__has_feature) || !__has_feature(objc_arc)
19 #error "This file requires ARC support."
20 #endif
21
19 namespace { 22 namespace {
20 23
21 // Comparator function for sorting the sessions_ vector so that the most 24 // Comparator function for sorting the sessions_ vector so that the most
22 // recently used sessions are at the beginning. 25 // recently used sessions are at the beginning.
23 bool SortSessionsByTime( 26 bool SortSessionsByTime(
24 std::unique_ptr<const synced_sessions::DistantSession>& a, 27 std::unique_ptr<const synced_sessions::DistantSession>& a,
25 std::unique_ptr<const synced_sessions::DistantSession>& b) { 28 std::unique_ptr<const synced_sessions::DistantSession>& b) {
26 return a->modified_time > b->modified_time; 29 return a->modified_time > b->modified_time;
27 } 30 }
28 31
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 DCHECK_LE(index, GetSessionCount()); 170 DCHECK_LE(index, GetSessionCount());
168 sessions_.erase(sessions_.begin() + index); 171 sessions_.erase(sessions_.begin() + index);
169 } 172 }
170 173
171 void SyncedSessions::AddDistantSessionForTest( 174 void SyncedSessions::AddDistantSessionForTest(
172 std::unique_ptr<const DistantSession> distant_session) { 175 std::unique_ptr<const DistantSession> distant_session) {
173 sessions_.push_back(std::move(distant_session)); 176 sessions_.push_back(std::move(distant_session));
174 } 177 }
175 178
176 } // synced_sessions namespace 179 } // synced_sessions namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698