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 |
(...skipping 28 matching lines...) Expand all Loading... |
39 // by querying |service|. | 39 // by querying |service|. |
40 MessageType GetStatusLabels(ProfileSyncService* service, | 40 MessageType GetStatusLabels(ProfileSyncService* service, |
41 string16* status_label, | 41 string16* status_label, |
42 string16* link_label); | 42 string16* link_label); |
43 | 43 |
44 // Same as above but for use specifically on the New Tab Page. | 44 // Same as above but for use specifically on the New Tab Page. |
45 MessageType GetStatusLabelsForNewTabPage(ProfileSyncService* service, | 45 MessageType GetStatusLabelsForNewTabPage(ProfileSyncService* service, |
46 string16* status_label, | 46 string16* status_label, |
47 string16* link_label); | 47 string16* link_label); |
48 | 48 |
| 49 // Gets various labels for the sync global error based on the sync error state. |
| 50 MessageType GetStatusLabelsForSyncGlobalError(ProfileSyncService* service, |
| 51 string16* menu_item_label, |
| 52 string16* bubble_message, |
| 53 string16* bubble_accept_label); |
| 54 |
49 MessageType GetStatus(ProfileSyncService* service); | 55 MessageType GetStatus(ProfileSyncService* service); |
50 | 56 |
51 // Determines whether or not the sync error button should be visible. | 57 // Determines whether or not the sync error button should be visible. |
52 bool ShouldShowSyncErrorButton(ProfileSyncService* service); | 58 bool ShouldShowSyncErrorButton(ProfileSyncService* service); |
53 | 59 |
54 // Returns a string with the synchronization status. | 60 // Returns a string with the synchronization status. |
55 string16 GetSyncMenuLabel(ProfileSyncService* service); | 61 string16 GetSyncMenuLabel(ProfileSyncService* service); |
56 | 62 |
57 // Open the appropriate sync dialog for the given profile (which can be | 63 // Open the appropriate sync dialog for the given profile (which can be |
58 // incognito). |browser| is the browser window that should be used if the UI | 64 // incognito). |browser| is the browser window that should be used if the UI |
59 // is in-window (i.e., WebUI). |code| should be one of the START_FROM_* codes. | 65 // is in-window (i.e., WebUI). |code| should be one of the START_FROM_* codes. |
60 void OpenSyncMyBookmarksDialog(Profile* profile, | 66 void OpenSyncMyBookmarksDialog(Profile* profile, |
61 Browser* browser, | 67 Browser* browser, |
62 ProfileSyncService::SyncEventCodes code); | 68 ProfileSyncService::SyncEventCodes code); |
63 | 69 |
64 void AddBoolSyncDetail(base::ListValue* details, | 70 void AddBoolSyncDetail(base::ListValue* details, |
65 const std::string& stat_name, | 71 const std::string& stat_name, |
66 bool stat_value); | 72 bool stat_value); |
67 | 73 |
68 // |service| can be NULL. | 74 // |service| can be NULL. |
69 void ConstructAboutInformation(ProfileSyncService* service, | 75 void ConstructAboutInformation(ProfileSyncService* service, |
70 DictionaryValue* strings); | 76 DictionaryValue* strings); |
71 | 77 |
72 void AddIntSyncDetail(base::ListValue* details, | 78 void AddIntSyncDetail(base::ListValue* details, |
73 const std::string& stat_name, | 79 const std::string& stat_name, |
74 int64 stat_value); | 80 int64 stat_value); |
75 | 81 |
76 void AddStringSyncDetails(ListValue* details, const std::string& stat_name, | 82 void AddStringSyncDetails(ListValue* details, const std::string& stat_name, |
77 const std::string& stat_value); | 83 const std::string& stat_value); |
| 84 |
78 } // namespace sync_ui_util | 85 } // namespace sync_ui_util |
79 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 86 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
OLD | NEW |