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

Side by Side Diff: components/sync/test/fake_server/sessions_hierarchy.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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 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 #include "sync/test/fake_server/sessions_hierarchy.h" 5 #include "components/sync/test/fake_server/sessions_hierarchy.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 9
10 namespace fake_server { 10 namespace fake_server {
11 11
12 SessionsHierarchy::SessionsHierarchy() {} 12 SessionsHierarchy::SessionsHierarchy() {}
13 13
14 SessionsHierarchy::~SessionsHierarchy() {} 14 SessionsHierarchy::~SessionsHierarchy() {}
15 15
16 void SessionsHierarchy::AddWindow( 16 void SessionsHierarchy::AddWindow(const std::string& tab) {
17 const std::string& tab) {
18 SessionsHierarchy::Window window; 17 SessionsHierarchy::Window window;
19 window.insert(tab); 18 window.insert(tab);
20 windows_.insert(window); 19 windows_.insert(window);
21 } 20 }
22 21
23 void SessionsHierarchy::AddWindow( 22 void SessionsHierarchy::AddWindow(const std::multiset<std::string>& tabs) {
24 const std::multiset<std::string>& tabs) {
25 windows_.insert(tabs); 23 windows_.insert(tabs);
26 } 24 }
27 25
28 std::string SessionsHierarchy::ToString() const { 26 std::string SessionsHierarchy::ToString() const {
29 std::stringstream output; 27 std::stringstream output;
30 output << "{"; 28 output << "{";
31 for (WindowContainer::const_iterator window_it = windows_.begin(); 29 for (WindowContainer::const_iterator window_it = windows_.begin();
32 window_it != windows_.end(); ++window_it) { 30 window_it != windows_.end(); ++window_it) {
33 if (window_it != windows_.begin()) 31 if (window_it != windows_.begin())
34 output << ","; 32 output << ",";
(...skipping 10 matching lines...) Expand all
45 } 43 }
46 output << "}"; 44 output << "}";
47 return output.str(); 45 return output.str();
48 } 46 }
49 47
50 bool SessionsHierarchy::Equals(const SessionsHierarchy& other) const { 48 bool SessionsHierarchy::Equals(const SessionsHierarchy& other) const {
51 return windows_ == other.windows_; 49 return windows_ == other.windows_;
52 } 50 }
53 51
54 } // namespace fake_server 52 } // namespace fake_server
OLDNEW
« no previous file with comments | « components/sync/test/fake_server/sessions_hierarchy.h ('k') | components/sync/test/fake_server/tombstone_entity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698