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