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 "chrome/browser/sync/sessions/sessions_sync_manager.h" | 5 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/sessions/session_tab_helper.h" | 9 #include "chrome/browser/sessions/session_tab_helper.h" |
10 #include "chrome/browser/sync/glue/session_sync_test_helper.h" | 10 #include "chrome/browser/sync/glue/session_sync_test_helper.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 class SyncedTabDelegateFake : public SyncedTabDelegate { | 373 class SyncedTabDelegateFake : public SyncedTabDelegate { |
374 public: | 374 public: |
375 SyncedTabDelegateFake() : current_entry_index_(0), | 375 SyncedTabDelegateFake() : current_entry_index_(0), |
376 pending_entry_index_(-1), | 376 pending_entry_index_(-1), |
377 is_supervised_(false), | 377 is_supervised_(false), |
378 sync_id_(-1), | 378 sync_id_(-1), |
379 blocked_navigations_(NULL) {} | 379 blocked_navigations_(NULL) {} |
380 ~SyncedTabDelegateFake() override {} | 380 ~SyncedTabDelegateFake() override {} |
381 | 381 |
| 382 bool IsInitialBlankNavigation() const override { |
| 383 // This differs from NavigationControllerImpl, which has an initial blank |
| 384 // NavigationEntry. |
| 385 return GetEntryCount() == 0; |
| 386 } |
382 int GetCurrentEntryIndex() const override { return current_entry_index_; } | 387 int GetCurrentEntryIndex() const override { return current_entry_index_; } |
383 void set_current_entry_index(int i) { | 388 void set_current_entry_index(int i) { |
384 current_entry_index_ = i; | 389 current_entry_index_ = i; |
385 } | 390 } |
386 | 391 |
387 content::NavigationEntry* GetEntryAtIndex(int i) const override { | 392 content::NavigationEntry* GetEntryAtIndex(int i) const override { |
388 const int size = entries_.size(); | 393 const int size = entries_.size(); |
389 return (size < i + 1) ? NULL : entries_[i]; | 394 return (size < i + 1) ? NULL : entries_[i]; |
390 } | 395 } |
391 | 396 |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 base::Time last_time; | 2209 base::Time last_time; |
2205 for (size_t i = 0; i < tabs.size(); ++i) { | 2210 for (size_t i = 0; i < tabs.size(); ++i) { |
2206 base::Time this_time = tabs[i]->timestamp; | 2211 base::Time this_time = tabs[i]->timestamp; |
2207 if (i > 0) | 2212 if (i > 0) |
2208 ASSERT_GE(last_time, this_time); | 2213 ASSERT_GE(last_time, this_time); |
2209 last_time = tabs[i]->timestamp; | 2214 last_time = tabs[i]->timestamp; |
2210 } | 2215 } |
2211 } | 2216 } |
2212 | 2217 |
2213 } // namespace browser_sync | 2218 } // namespace browser_sync |
OLD | NEW |