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