OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/reading_list/ios/reading_list_store.h" | 5 #include "components/reading_list/ios/reading_list_store.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "components/reading_list/ios/proto/reading_list.pb.h" | 10 #include "components/reading_list/ios/proto/reading_list.pb.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 rhs.update_time_us() < lhs.update_time_us()) { | 435 rhs.update_time_us() < lhs.update_time_us()) { |
436 return false; | 436 return false; |
437 } | 437 } |
438 if (rhs.update_time_us() == lhs.update_time_us()) { | 438 if (rhs.update_time_us() == lhs.update_time_us()) { |
439 if ((rhs.status() == sync_pb::ReadingListSpecifics::UNSEEN && | 439 if ((rhs.status() == sync_pb::ReadingListSpecifics::UNSEEN && |
440 lhs.status() != sync_pb::ReadingListSpecifics::UNSEEN) || | 440 lhs.status() != sync_pb::ReadingListSpecifics::UNSEEN) || |
441 (rhs.status() == sync_pb::ReadingListSpecifics::UNREAD && | 441 (rhs.status() == sync_pb::ReadingListSpecifics::UNREAD && |
442 lhs.status() == sync_pb::ReadingListSpecifics::READ)) | 442 lhs.status() == sync_pb::ReadingListSpecifics::READ)) |
443 return false; | 443 return false; |
444 } | 444 } |
| 445 if (rhs.creation_time_us() == lhs.creation_time_us()) { |
| 446 if (rhs.first_read_time_us() == 0 && lhs.first_read_time_us() != 0) { |
| 447 return false; |
| 448 } |
| 449 if (rhs.first_read_time_us() > lhs.first_read_time_us() && |
| 450 lhs.first_read_time_us() != 0) { |
| 451 return false; |
| 452 } |
| 453 } |
445 return true; | 454 return true; |
446 } | 455 } |
OLD | NEW |