OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GLOBAL_ERROR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ |
6 #define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ | 6 #define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "chrome/browser/ui/global_error/global_error.h" | 12 #include "chrome/browser/ui/global_error/global_error.h" |
11 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
12 #include "components/sync/driver/sync_error_controller.h" | 14 #include "components/sync/driver/sync_error_controller.h" |
13 | 15 |
14 class GlobalErrorService; | 16 class GlobalErrorService; |
15 class LoginUIService; | 17 class LoginUIService; |
16 | 18 |
17 namespace browser_sync { | 19 namespace browser_sync { |
18 class ProfileSyncService; | 20 class ProfileSyncService; |
19 } // namespace browser_sync | 21 } // namespace browser_sync |
20 | 22 |
21 // Shows sync errors on the wrench menu using a bubble view and a menu item. | 23 // Shows sync errors on the wrench menu using a bubble view and a menu item. |
22 class SyncGlobalError : public GlobalErrorWithStandardBubble, | 24 class SyncGlobalError : public GlobalErrorWithStandardBubble, |
23 public SyncErrorController::Observer, | 25 public syncer::SyncErrorController::Observer, |
24 public KeyedService { | 26 public KeyedService { |
25 public: | 27 public: |
26 SyncGlobalError(GlobalErrorService* global_error_service, | 28 SyncGlobalError(GlobalErrorService* global_error_service, |
27 LoginUIService* login_ui_service, | 29 LoginUIService* login_ui_service, |
28 SyncErrorController* error_controller, | 30 syncer::SyncErrorController* error_controller, |
29 browser_sync::ProfileSyncService* profile_sync_service); | 31 browser_sync::ProfileSyncService* profile_sync_service); |
30 ~SyncGlobalError() override; | 32 ~SyncGlobalError() override; |
31 | 33 |
32 // KeyedService: | 34 // KeyedService: |
33 void Shutdown() override; | 35 void Shutdown() override; |
34 | 36 |
35 // GlobalErrorWithStandardBubble: | 37 // GlobalErrorWithStandardBubble: |
36 bool HasMenuItem() override; | 38 bool HasMenuItem() override; |
37 int MenuItemCommandID() override; | 39 int MenuItemCommandID() override; |
38 base::string16 MenuItemLabel() override; | 40 base::string16 MenuItemLabel() override; |
39 void ExecuteMenuItem(Browser* browser) override; | 41 void ExecuteMenuItem(Browser* browser) override; |
40 bool HasBubbleView() override; | 42 bool HasBubbleView() override; |
41 base::string16 GetBubbleViewTitle() override; | 43 base::string16 GetBubbleViewTitle() override; |
42 std::vector<base::string16> GetBubbleViewMessages() override; | 44 std::vector<base::string16> GetBubbleViewMessages() override; |
43 base::string16 GetBubbleViewAcceptButtonLabel() override; | 45 base::string16 GetBubbleViewAcceptButtonLabel() override; |
44 base::string16 GetBubbleViewCancelButtonLabel() override; | 46 base::string16 GetBubbleViewCancelButtonLabel() override; |
45 void OnBubbleViewDidClose(Browser* browser) override; | 47 void OnBubbleViewDidClose(Browser* browser) override; |
46 void BubbleViewAcceptButtonPressed(Browser* browser) override; | 48 void BubbleViewAcceptButtonPressed(Browser* browser) override; |
47 void BubbleViewCancelButtonPressed(Browser* browser) override; | 49 void BubbleViewCancelButtonPressed(Browser* browser) override; |
48 | 50 |
49 // SyncErrorController::Observer: | 51 // syncer::SyncErrorController::Observer: |
50 void OnErrorChanged() override; | 52 void OnErrorChanged() override; |
51 | 53 |
52 private: | 54 private: |
53 base::string16 bubble_accept_label_; | 55 base::string16 bubble_accept_label_; |
54 base::string16 bubble_message_; | 56 base::string16 bubble_message_; |
55 base::string16 menu_label_; | 57 base::string16 menu_label_; |
56 | 58 |
57 GlobalErrorService* global_error_service_; | 59 GlobalErrorService* global_error_service_; |
58 | 60 |
59 const LoginUIService* login_ui_service_; | 61 const LoginUIService* login_ui_service_; |
60 | 62 |
61 // The error controller to query for error details. Owned by the | 63 // The error controller to query for error details. Owned by the |
62 // ProfileSyncService this SyncGlobalError depends on. | 64 // ProfileSyncService this SyncGlobalError depends on. |
63 SyncErrorController* error_controller_; | 65 syncer::SyncErrorController* error_controller_; |
64 | 66 |
65 const browser_sync::ProfileSyncService* sync_service_; | 67 const browser_sync::ProfileSyncService* sync_service_; |
66 | 68 |
67 DISALLOW_COPY_AND_ASSIGN(SyncGlobalError); | 69 DISALLOW_COPY_AND_ASSIGN(SyncGlobalError); |
68 }; | 70 }; |
69 | 71 |
70 #endif // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ | 72 #endif // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ |
OLD | NEW |