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

Side by Side Diff: ios/chrome/browser/ui/tab_switcher/session_changes.h

Issue 2588733002: Upstream Chrome on iOS source code [9/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 2016 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_UI_TAB_SWITCHER_SESSION_CHANGES_H_
6 #define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_SESSION_CHANGES_H_
7
8 #include <vector>
9
10 namespace ios_internal {
11
12 // This structure represents the changes a session undergoes.
13 // It is used to update the UICollectionView showing a set of tabs.
14 class SessionChanges {
15 public:
16 SessionChanges(std::vector<size_t> const& tabHashesInInitialState,
17 std::vector<size_t> const& tabHashesInFinalState);
18 ~SessionChanges();
19 SessionChanges(const SessionChanges& sessionChanges) = delete;
20 SessionChanges& operator=(const SessionChanges& sessionChanges) = delete;
21
22 std::vector<size_t> const& deletions() const;
23 std::vector<size_t> const& insertions() const;
24 std::vector<size_t> const& updates() const;
25
26 bool hasChanges() const;
27
28 private:
29 // Those vectors contain indexes of tabs.
30 // The indexes are relative to a tab model snapshot, or a distant session.
31 // To be in accordance with the UICollectionView's |performBatchUpdates|
32 // method:
33 // -the indexes in |updates| are relative to the previous state of the
34 // session.
35 // -the indexes in |deletions| are relative to the previous state of the
36 // session.
37 // -the indexes in |insertions| are relative to the final state of the
38 // session.
39 std::vector<size_t> deletions_;
40 std::vector<size_t> insertions_;
41 std::vector<size_t> updates_;
42 };
43
44 } // namespace ios_internal
45
46 #endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_SESSION_CHANGES_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm ('k') | ios/chrome/browser/ui/tab_switcher/session_changes.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698