Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: components/invalidation/notifier_reason_util.cc

Issue 308413002: Revert of Move some sync/notifier to components/invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "components/invalidation/notifier_reason_util.h"
6
7 #include "base/logging.h"
8
9 namespace syncer {
10
11 InvalidatorState FromNotifierReason(
12 notifier::NotificationsDisabledReason reason) {
13 switch (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;
20 default:
21 NOTREACHED();
22 return DEFAULT_INVALIDATION_ERROR;
23 }
24 }
25
26 notifier::NotificationsDisabledReason ToNotifierReasonForTest(
27 InvalidatorState state) {
28 switch (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:
34 // Fall through.
35 default:
36 NOTREACHED();
37 return notifier::TRANSIENT_NOTIFICATION_ERROR;
38 }
39 }
40
41 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/notifier_reason_util.h ('k') | components/invalidation/p2p_invalidation_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698