| 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 |
| 24 ~SessionsHierarchy(); | 30 ~SessionsHierarchy(); |
| 25 | 31 |
| 26 // Add a window to the builder with one tab. | 32 // Add a window to the builder with one tab. |
| 27 void AddWindow(const std::string& tab); | 33 void AddWindow(const std::string& tab); |
| 28 | 34 |
| 29 // Add a window to the builder with multiple tabs. | 35 // Add a window to the builder with multiple tabs. |
| 30 void AddWindow(const std::multiset<std::string>& tabs); | 36 void AddWindow(const std::multiset<std::string>& tabs); |
| 31 | 37 |
| 32 // Creates and returns a human-readable string version of this object's data. | 38 // Creates and returns a human-readable string version of this object's data. |
| 33 std::string ToString() const; | 39 std::string ToString() const; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 53 // sessions hierarchy). | 59 // sessions hierarchy). |
| 54 using WindowContainer = std::multiset<Window>; | 60 using WindowContainer = std::multiset<Window>; |
| 55 | 61 |
| 56 // The windows of the sessions hierarchy. | 62 // The windows of the sessions hierarchy. |
| 57 WindowContainer windows_; | 63 WindowContainer windows_; |
| 58 }; | 64 }; |
| 59 | 65 |
| 60 } // namespace fake_server | 66 } // namespace fake_server |
| 61 | 67 |
| 62 #endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ | 68 #endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_SESSIONS_HIERARCHY_H_ |
| OLD | NEW |