| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync/test/integration/sessions_helper.h" | 5 #include "chrome/browser/sync/test/integration/sessions_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 namespace sessions_helper { | 37 namespace sessions_helper { |
| 38 | 38 |
| 39 ScopedWindowMap::ScopedWindowMap() { | 39 ScopedWindowMap::ScopedWindowMap() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 ScopedWindowMap::ScopedWindowMap(SessionWindowMap* windows) { | 42 ScopedWindowMap::ScopedWindowMap(SessionWindowMap* windows) { |
| 43 Reset(windows); | 43 Reset(windows); |
| 44 } | 44 } |
| 45 | 45 |
| 46 ScopedWindowMap::~ScopedWindowMap() { | 46 ScopedWindowMap::~ScopedWindowMap() { |
| 47 STLDeleteContainerPairSecondPointers(windows_.begin(), windows_.end()); | 47 base::STLDeleteContainerPairSecondPointers(windows_.begin(), windows_.end()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 SessionWindowMap* ScopedWindowMap::GetMutable() { | 50 SessionWindowMap* ScopedWindowMap::GetMutable() { |
| 51 return &windows_; | 51 return &windows_; |
| 52 } | 52 } |
| 53 | 53 |
| 54 const SessionWindowMap* ScopedWindowMap::Get() const { | 54 const SessionWindowMap* ScopedWindowMap::Get() const { |
| 55 return &windows_; | 55 return &windows_; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ScopedWindowMap::Reset(SessionWindowMap* windows) { | 58 void ScopedWindowMap::Reset(SessionWindowMap* windows) { |
| 59 STLDeleteContainerPairSecondPointers(windows_.begin(), windows_.end()); | 59 base::STLDeleteContainerPairSecondPointers(windows_.begin(), windows_.end()); |
| 60 windows_.clear(); | 60 windows_.clear(); |
| 61 std::swap(*windows, windows_); | 61 std::swap(*windows, windows_); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool GetLocalSession(int index, const sync_driver::SyncedSession** session) { | 64 bool GetLocalSession(int index, const sync_driver::SyncedSession** session) { |
| 65 return ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 65 return ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| 66 test()->GetProfile(index))->GetOpenTabsUIDelegate()-> | 66 test()->GetProfile(index))->GetOpenTabsUIDelegate()-> |
| 67 GetLocalSession(session); | 67 GetLocalSession(session); |
| 68 } | 68 } |
| 69 | 69 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 return !checker.TimedOut(); | 433 return !checker.TimedOut(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 void DeleteForeignSession(int index, std::string session_tag) { | 436 void DeleteForeignSession(int index, std::string session_tag) { |
| 437 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 437 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| 438 test()->GetProfile(index))-> | 438 test()->GetProfile(index))-> |
| 439 GetOpenTabsUIDelegate()->DeleteForeignSession(session_tag); | 439 GetOpenTabsUIDelegate()->DeleteForeignSession(session_tag); |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace sessions_helper | 442 } // namespace sessions_helper |
| OLD | NEW |