OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ | 5 #ifndef COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ |
6 #define COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ | 6 #define COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 | 12 |
13 namespace fake_server { | 13 namespace fake_server { |
14 | 14 |
15 class SessionsHierarchy; | 15 class SessionsHierarchy; |
16 | 16 |
17 // A representation of the Sync Sessions hierarchy (windows and the URLs of | 17 // A representation of the Sync Sessions hierarchy (windows and the URLs of |
18 // their tabs). | 18 // their tabs). |
19 class SessionsHierarchy { | 19 class SessionsHierarchy { |
20 public: | 20 public: |
21 // Creates an empty (no windows) SessionsHierachy. | 21 // Creates an empty (no windows) SessionsHierachy. |
22 SessionsHierarchy(); | 22 SessionsHierarchy(); |
23 | 23 |
24 // Copy constructor. | |
25 SessionsHierarchy(const SessionsHierarchy& other); | |
26 | |
27 // Creates a SessionsHierarchy with specified set of windows. | |
28 SessionsHierarchy(std::initializer_list<std::multiset<std::string>> windows); | |
29 | |
30 ~SessionsHierarchy(); | 24 ~SessionsHierarchy(); |
31 | 25 |
32 // Add a window to the builder with one tab. | 26 // Add a window to the builder with one tab. |
33 void AddWindow(const std::string& tab); | 27 void AddWindow(const std::string& tab); |
34 | 28 |
35 // Add a window to the builder with multiple tabs. | 29 // Add a window to the builder with multiple tabs. |
36 void AddWindow(const std::multiset<std::string>& tabs); | 30 void AddWindow(const std::multiset<std::string>& tabs); |
37 | 31 |
38 // Creates and returns a human-readable string version of this object's data. | 32 // Creates and returns a human-readable string version of this object's data. |
39 std::string ToString() const; | 33 std::string ToString() const; |
(...skipping 19 matching lines...) Expand all Loading... |
59 // sessions hierarchy). | 53 // sessions hierarchy). |
60 using WindowContainer = std::multiset<Window>; | 54 using WindowContainer = std::multiset<Window>; |
61 | 55 |
62 // The windows of the sessions hierarchy. | 56 // The windows of the sessions hierarchy. |
63 WindowContainer windows_; | 57 WindowContainer windows_; |
64 }; | 58 }; |
65 | 59 |
66 } // namespace fake_server | 60 } // namespace fake_server |
67 | 61 |
68 #endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ | 62 #endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ |
OLD | NEW |