OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/notification_method.h" | 5 #include "chrome/browser/sync/notification_method.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace browser_sync { | 9 namespace browser_sync { |
10 | 10 |
11 // TODO(akalin): Eventually change this to NOTIFICATION_NEW. | |
12 const NotificationMethod kDefaultNotificationMethod = | 11 const NotificationMethod kDefaultNotificationMethod = |
13 NOTIFICATION_TRANSITIONAL; | 12 NOTIFICATION_SERVER; |
14 | 13 |
15 std::string NotificationMethodToString( | 14 std::string NotificationMethodToString( |
16 NotificationMethod notification_method) { | 15 NotificationMethod notification_method) { |
17 switch (notification_method) { | 16 switch (notification_method) { |
18 case NOTIFICATION_LEGACY: | 17 case NOTIFICATION_LEGACY: |
19 return "NOTIFICATION_LEGACY"; | 18 return "NOTIFICATION_LEGACY"; |
20 break; | 19 break; |
21 case NOTIFICATION_TRANSITIONAL: | 20 case NOTIFICATION_TRANSITIONAL: |
22 return "NOTIFICATION_TRANSITIONAL"; | 21 return "NOTIFICATION_TRANSITIONAL"; |
23 break; | 22 break; |
(...skipping 21 matching lines...) Expand all Loading... |
45 } else if (str == "server") { | 44 } else if (str == "server") { |
46 return NOTIFICATION_SERVER; | 45 return NOTIFICATION_SERVER; |
47 } | 46 } |
48 LOG(WARNING) << "Unknown notification method \"" << str | 47 LOG(WARNING) << "Unknown notification method \"" << str |
49 << "\"; using method " | 48 << "\"; using method " |
50 << NotificationMethodToString(kDefaultNotificationMethod); | 49 << NotificationMethodToString(kDefaultNotificationMethod); |
51 return kDefaultNotificationMethod; | 50 return kDefaultNotificationMethod; |
52 } | 51 } |
53 | 52 |
54 } // namespace browser_sync | 53 } // namespace browser_sync |
OLD | NEW |