OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
6 #define CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 6 #define CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/sync/profile_sync_service.h" | 13 #include "chrome/browser/sync/profile_sync_service.h" |
14 | 14 |
15 class Browser; | 15 class Browser; |
16 class Profile; | 16 class Profile; |
| 17 |
| 18 namespace base { |
17 class ListValue; | 19 class ListValue; |
18 class DictionaryValue; | 20 class DictionaryValue; |
| 21 } |
19 | 22 |
20 // Utility functions to gather current sync status information from the sync | 23 // Utility functions to gather current sync status information from the sync |
21 // service and constructs messages suitable for showing in UI. | 24 // service and constructs messages suitable for showing in UI. |
22 namespace sync_ui_util { | 25 namespace sync_ui_util { |
23 | 26 |
24 enum MessageType { | 27 enum MessageType { |
25 PRE_SYNCED, // User has not set up sync. | 28 PRE_SYNCED, // User has not set up sync. |
26 SYNCED, // We are synced and authenticated to a gmail account. | 29 SYNCED, // We are synced and authenticated to a gmail account. |
27 SYNC_ERROR, // A sync error (such as invalid credentials) has occurred. | 30 SYNC_ERROR, // A sync error (such as invalid credentials) has occurred. |
28 SYNC_PROMO, // A situation has occurred which should be brought to the user's | 31 SYNC_PROMO, // A situation has occurred which should be brought to the user's |
(...skipping 22 matching lines...) Expand all Loading... |
51 // Returns a string with the synchronization status. | 54 // Returns a string with the synchronization status. |
52 string16 GetSyncMenuLabel(ProfileSyncService* service); | 55 string16 GetSyncMenuLabel(ProfileSyncService* service); |
53 | 56 |
54 // Open the appropriate sync dialog for the given profile (which can be | 57 // Open the appropriate sync dialog for the given profile (which can be |
55 // incognito). |browser| is the browser window that should be used if the UI | 58 // incognito). |browser| is the browser window that should be used if the UI |
56 // is in-window (i.e., WebUI). |code| should be one of the START_FROM_* codes. | 59 // is in-window (i.e., WebUI). |code| should be one of the START_FROM_* codes. |
57 void OpenSyncMyBookmarksDialog(Profile* profile, | 60 void OpenSyncMyBookmarksDialog(Profile* profile, |
58 Browser* browser, | 61 Browser* browser, |
59 ProfileSyncService::SyncEventCodes code); | 62 ProfileSyncService::SyncEventCodes code); |
60 | 63 |
61 void AddBoolSyncDetail(ListValue* details, | 64 void AddBoolSyncDetail(base::ListValue* details, |
62 const std::string& stat_name, | 65 const std::string& stat_name, |
63 bool stat_value); | 66 bool stat_value); |
64 | 67 |
65 // |service| can be NULL. | 68 // |service| can be NULL. |
66 void ConstructAboutInformation(ProfileSyncService* service, | 69 void ConstructAboutInformation(ProfileSyncService* service, |
67 DictionaryValue* strings); | 70 DictionaryValue* strings); |
68 | 71 |
69 void AddIntSyncDetail(ListValue* details, | 72 void AddIntSyncDetail(base::ListValue* details, |
70 const std::string& stat_name, | 73 const std::string& stat_name, |
71 int64 stat_value); | 74 int64 stat_value); |
72 } // namespace sync_ui_util | 75 } // namespace sync_ui_util |
73 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 76 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
OLD | NEW |