OLD | NEW |
1 // Copyright (c) 2009 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 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). |browser| is the browser window that should be used if the UI |
57 void OpenSyncMyBookmarksDialog( | 58 // is in-window (i.e., DOMUI). |code| should be one of the START_FROM_* codes. |
58 Profile* profile, ProfileSyncService::SyncEventCodes code); | 59 void OpenSyncMyBookmarksDialog(Profile* profile, |
| 60 Browser* browser, |
| 61 ProfileSyncService::SyncEventCodes code); |
59 | 62 |
60 void AddBoolSyncDetail(ListValue* details, | 63 void AddBoolSyncDetail(ListValue* details, |
61 const std::string& stat_name, | 64 const std::string& stat_name, |
62 bool stat_value); | 65 bool stat_value); |
63 | 66 |
64 // |service| can be NULL. | 67 // |service| can be NULL. |
65 void ConstructAboutInformation(ProfileSyncService* service, | 68 void ConstructAboutInformation(ProfileSyncService* service, |
66 DictionaryValue* strings); | 69 DictionaryValue* strings); |
67 | 70 |
68 void AddIntSyncDetail(ListValue* details, | 71 void AddIntSyncDetail(ListValue* details, |
69 const std::string& stat_name, | 72 const std::string& stat_name, |
70 int64 stat_value); | 73 int64 stat_value); |
71 } // namespace sync_ui_util | 74 } // namespace sync_ui_util |
72 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ | 75 #endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ |
OLD | NEW |