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