| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/invalidation/invalidation_service_android.h" | 5 #include "chrome/browser/invalidation/invalidation_service_android.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/invalidation/invalidation_controller_android.h" | 8 #include "chrome/browser/invalidation/invalidation_controller_android.h" |
| 9 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 syncer::InvalidatorState | 54 syncer::InvalidatorState |
| 55 InvalidationServiceAndroid::GetInvalidatorState() const { | 55 InvalidationServiceAndroid::GetInvalidatorState() const { |
| 56 DCHECK(CalledOnValidThread()); | 56 DCHECK(CalledOnValidThread()); |
| 57 return invalidator_state_; | 57 return invalidator_state_; |
| 58 } | 58 } |
| 59 | 59 |
| 60 std::string InvalidationServiceAndroid::GetInvalidatorClientId() const { | 60 std::string InvalidationServiceAndroid::GetInvalidatorClientId() const { |
| 61 DCHECK(CalledOnValidThread()); | 61 DCHECK(CalledOnValidThread()); |
| 62 // TODO: Return a valid ID here. See crbug.com/172391. | 62 return invalidation_controller_->GetInvalidatorClientId(); |
| 63 return "Bogus"; | |
| 64 } | 63 } |
| 65 | 64 |
| 66 void InvalidationServiceAndroid::Observe( | 65 void InvalidationServiceAndroid::Observe( |
| 67 int type, | 66 int type, |
| 68 const content::NotificationSource& source, | 67 const content::NotificationSource& source, |
| 69 const content::NotificationDetails& details) { | 68 const content::NotificationDetails& details) { |
| 70 DCHECK(CalledOnValidThread()); | 69 DCHECK(CalledOnValidThread()); |
| 71 DCHECK_EQ(type, chrome::NOTIFICATION_SYNC_REFRESH_REMOTE); | 70 DCHECK_EQ(type, chrome::NOTIFICATION_SYNC_REFRESH_REMOTE); |
| 72 | 71 |
| 73 content::Details<const syncer::ObjectIdInvalidationMap> | 72 content::Details<const syncer::ObjectIdInvalidationMap> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 87 } | 86 } |
| 88 | 87 |
| 89 void InvalidationServiceAndroid::TriggerStateChangeForTest( | 88 void InvalidationServiceAndroid::TriggerStateChangeForTest( |
| 90 syncer::InvalidatorState state) { | 89 syncer::InvalidatorState state) { |
| 91 DCHECK(CalledOnValidThread()); | 90 DCHECK(CalledOnValidThread()); |
| 92 invalidator_state_ = state; | 91 invalidator_state_ = state; |
| 93 invalidator_registrar_.UpdateInvalidatorState(invalidator_state_); | 92 invalidator_registrar_.UpdateInvalidatorState(invalidator_state_); |
| 94 } | 93 } |
| 95 | 94 |
| 96 } // namespace invalidation | 95 } // namespace invalidation |
| OLD | NEW |