Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 Profile; | 16 class Profile; |
| 16 class ListValue; | 17 class ListValue; |
| 17 class DictionaryValue; | 18 class DictionaryValue; |
| 18 | 19 |
| 19 // Utility functions to gather current sync status information from the sync | 20 // Utility functions to gather current sync status information from the sync |
| 20 // service and constructs messages suitable for showing in UI. | 21 // service and constructs messages suitable for showing in UI. |
| 21 namespace sync_ui_util { | 22 namespace sync_ui_util { |
| 22 | 23 |
| 23 enum MessageType { | 24 enum MessageType { |
| 24 PRE_SYNCED, // User has not set up sync. | 25 PRE_SYNCED, // User has not set up sync. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 46 | 47 |
| 47 MessageType GetStatus(ProfileSyncService* service); | 48 MessageType GetStatus(ProfileSyncService* service); |
| 48 | 49 |
| 49 // Determines whether or not the sync error button should be visible. | 50 // Determines whether or not the sync error button should be visible. |
| 50 bool ShouldShowSyncErrorButton(ProfileSyncService* service); | 51 bool ShouldShowSyncErrorButton(ProfileSyncService* service); |
| 51 | 52 |
| 52 // Returns a string with the synchronization status. | 53 // Returns a string with the synchronization status. |
| 53 string16 GetSyncMenuLabel(ProfileSyncService* service); | 54 string16 GetSyncMenuLabel(ProfileSyncService* service); |
| 54 | 55 |
| 55 // Open the appropriate sync dialog for the given profile (which can be | 56 // Open the appropriate sync dialog for the given profile (which can be |
| 56 // incognito). |code| should be one of the START_FROM_* codes. | 57 // incognito). |code| should be one of the START_FROM_* codes. |
|
csilv
2011/01/25 00:33:50
Consider documenting the 'browser' parameter in th
stuartmorgan
2011/01/25 01:08:43
Done.
| |
| 57 void OpenSyncMyBookmarksDialog( | 58 void OpenSyncMyBookmarksDialog(Profile* profile, |
| 58 Profile* profile, ProfileSyncService::SyncEventCodes code); | 59 Browser* browser, |
| 60 ProfileSyncService::SyncEventCodes code); | |
| 59 | 61 |
| 60 void AddBoolSyncDetail(ListValue* details, | 62 void AddBoolSyncDetail(ListValue* details, |
| 61 const std::string& stat_name, | 63 const std::string& stat_name, |
| 62 bool stat_value); | 64 bool stat_value); |
| 63 | 65 |
| 64 // |service| can be NULL. | 66 // |service| can be NULL. |
| 65 void ConstructAboutInformation(ProfileSyncService* service, | 67 void ConstructAboutInformation(ProfileSyncService* service, |
| 66 DictionaryValue* strings); | 68 DictionaryValue* strings); |
| 67 | 69 |
| 68 void AddIntSyncDetail(ListValue* details, | 70 void AddIntSyncDetail(ListValue* details, |
| 69 const std::string& stat_name, | 71 const std::string& stat_name, |
| 70 int64 stat_value); | 72 int64 stat_value); |
| 71 } // namespace sync_ui_util | 73 } // namespace sync_ui_util |
| 72 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 74 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
| OLD | NEW |