| 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> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/ui/global_error/global_error.h" | 12 #include "chrome/browser/ui/global_error/global_error.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
| 14 #include "components/sync/driver/sync_error_controller.h" | 14 #include "components/sync/driver/sync_error_controller.h" |
| 15 | 15 |
| 16 class GlobalErrorService; | |
| 17 class LoginUIService; | 16 class LoginUIService; |
| 18 | 17 |
| 19 namespace browser_sync { | 18 namespace browser_sync { |
| 20 class ProfileSyncService; | 19 class ProfileSyncService; |
| 21 } // namespace browser_sync | 20 } // namespace browser_sync |
| 22 | 21 |
| 23 // Shows sync errors on the wrench menu using a bubble view and a menu item. | 22 // Shows sync errors on the wrench menu using a bubble view and a menu item. |
| 24 class SyncGlobalError : public GlobalErrorWithStandardBubble, | 23 class SyncGlobalError : public GlobalErrorWithStandardBubble, |
| 25 public syncer::SyncErrorController::Observer, | 24 public syncer::SyncErrorController::Observer, |
| 26 public KeyedService { | 25 public KeyedService { |
| 27 public: | 26 public: |
| 28 SyncGlobalError(GlobalErrorService* global_error_service, | 27 SyncGlobalError(LoginUIService* login_ui_service, |
| 29 LoginUIService* login_ui_service, | |
| 30 syncer::SyncErrorController* error_controller, | 28 syncer::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 // syncer::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_; | |
| 60 | |
| 61 const LoginUIService* login_ui_service_; | 57 const LoginUIService* login_ui_service_; |
| 62 | 58 |
| 63 // The error controller to query for error details. Owned by the | 59 // The error controller to query for error details. Owned by the |
| 64 // ProfileSyncService this SyncGlobalError depends on. | 60 // ProfileSyncService this SyncGlobalError depends on. |
| 65 syncer::SyncErrorController* error_controller_; | 61 syncer::SyncErrorController* error_controller_; |
| 66 | 62 |
| 67 const browser_sync::ProfileSyncService* sync_service_; | 63 const browser_sync::ProfileSyncService* sync_service_; |
| 68 | 64 |
| 69 DISALLOW_COPY_AND_ASSIGN(SyncGlobalError); | 65 DISALLOW_COPY_AND_ASSIGN(SyncGlobalError); |
| 70 }; | 66 }; |
| 71 | 67 |
| 72 #endif // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ | 68 #endif // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ |
| OLD | NEW |