| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sync_sessions/sessions_sync_manager.h" | 5 #include "components/sync_sessions/sessions_sync_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 7 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "build/build_config.h" |
| 8 #include "chrome/browser/sessions/session_tab_helper.h" | 13 #include "chrome/browser/sessions/session_tab_helper.h" |
| 9 #include "chrome/browser/sync/chrome_sync_client.h" | 14 #include "chrome/browser/sync/chrome_sync_client.h" |
| 10 #include "chrome/browser/sync/glue/session_sync_test_helper.h" | 15 #include "chrome/browser/sync/glue/session_sync_test_helper.h" |
| 11 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" | 16 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" |
| 12 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" | 17 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
| 13 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 18 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/test/base/browser_with_test_window_test.h" | 20 #include "chrome/test/base/browser_with_test_window_test.h" |
| 16 #include "components/sessions/content/content_serialized_navigation_builder.h" | 21 #include "components/sessions/content/content_serialized_navigation_builder.h" |
| 17 #include "components/sessions/core/serialized_navigation_entry_test_helper.h" | 22 #include "components/sessions/core/serialized_navigation_entry_test_helper.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void SetSyncDataToReturn(const syncer::SyncDataList& data) { | 182 void SetSyncDataToReturn(const syncer::SyncDataList& data) { |
| 178 sync_data_to_return_ = data; | 183 sync_data_to_return_ = data; |
| 179 } | 184 } |
| 180 | 185 |
| 181 private: | 186 private: |
| 182 syncer::SyncError error_; | 187 syncer::SyncError error_; |
| 183 syncer::SyncChangeList* output_; | 188 syncer::SyncChangeList* output_; |
| 184 syncer::SyncDataList sync_data_to_return_; | 189 syncer::SyncDataList sync_data_to_return_; |
| 185 }; | 190 }; |
| 186 | 191 |
| 187 syncer::SyncChange MakeRemoteChange( | 192 syncer::SyncChange MakeRemoteChange(int64_t id, |
| 188 int64 id, | 193 const sync_pb::SessionSpecifics& specifics, |
| 189 const sync_pb::SessionSpecifics& specifics, | 194 SyncChange::SyncChangeType type) { |
| 190 SyncChange::SyncChangeType type) { | |
| 191 sync_pb::EntitySpecifics entity; | 195 sync_pb::EntitySpecifics entity; |
| 192 entity.mutable_session()->CopyFrom(specifics); | 196 entity.mutable_session()->CopyFrom(specifics); |
| 193 return syncer::SyncChange( | 197 return syncer::SyncChange( |
| 194 FROM_HERE, | 198 FROM_HERE, |
| 195 type, | 199 type, |
| 196 syncer::SyncData::CreateRemoteData( | 200 syncer::SyncData::CreateRemoteData( |
| 197 id, | 201 id, |
| 198 entity, | 202 entity, |
| 199 base::Time(), | 203 base::Time(), |
| 200 syncer::AttachmentIdList(), | 204 syncer::AttachmentIdList(), |
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 base::Time last_time; | 2315 base::Time last_time; |
| 2312 for (size_t i = 0; i < tabs.size(); ++i) { | 2316 for (size_t i = 0; i < tabs.size(); ++i) { |
| 2313 base::Time this_time = tabs[i]->timestamp; | 2317 base::Time this_time = tabs[i]->timestamp; |
| 2314 if (i > 0) | 2318 if (i > 0) |
| 2315 ASSERT_GE(last_time, this_time); | 2319 ASSERT_GE(last_time, this_time); |
| 2316 last_time = tabs[i]->timestamp; | 2320 last_time = tabs[i]->timestamp; |
| 2317 } | 2321 } |
| 2318 } | 2322 } |
| 2319 | 2323 |
| 2320 } // namespace browser_sync | 2324 } // namespace browser_sync |
| OLD | NEW |