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
3 // found in the LICENSE file.
5 #include "components/invalidation/notifier_reason_util.h"
7 #include "base/logging.h"
11 InvalidatorState
FromNotifierReason(
12 notifier::NotificationsDisabledReason reason
) {
14 case notifier::NO_NOTIFICATION_ERROR
:
15 return INVALIDATIONS_ENABLED
;
16 case notifier::TRANSIENT_NOTIFICATION_ERROR
:
17 return TRANSIENT_INVALIDATION_ERROR
;
18 case notifier::NOTIFICATION_CREDENTIALS_REJECTED
:
19 return INVALIDATION_CREDENTIALS_REJECTED
;
22 return DEFAULT_INVALIDATION_ERROR
;
26 notifier::NotificationsDisabledReason
ToNotifierReasonForTest(
27 InvalidatorState state
) {
29 case TRANSIENT_INVALIDATION_ERROR
:
30 return notifier::TRANSIENT_NOTIFICATION_ERROR
;
31 case INVALIDATION_CREDENTIALS_REJECTED
:
32 return notifier::NOTIFICATION_CREDENTIALS_REJECTED
;
33 case INVALIDATIONS_ENABLED
:
37 return notifier::TRANSIENT_NOTIFICATION_ERROR
;