Home | History | Annotate | Download | only in sync
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_
      6 #define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/compiler_specific.h"
     10 #include "chrome/browser/sync/profile_sync_service_observer.h"
     11 #include "chrome/browser/ui/global_error/global_error.h"
     12 
     13 class ProfileSyncService;
     14 class SigninManagerBase;
     15 
     16 // Shows sync errors on the wrench menu using a bubble view and a
     17 // menu item.
     18 class SyncGlobalError : public GlobalError,
     19                         public ProfileSyncServiceObserver {
     20  public:
     21   SyncGlobalError(ProfileSyncService* service, SigninManagerBase* signin);
     22   virtual ~SyncGlobalError();
     23 
     24   virtual bool HasMenuItem() OVERRIDE;
     25   virtual int MenuItemCommandID() OVERRIDE;
     26   virtual string16 MenuItemLabel() OVERRIDE;
     27   virtual void ExecuteMenuItem(Browser* browser) OVERRIDE;
     28 
     29   virtual bool HasBubbleView() OVERRIDE;
     30   virtual string16 GetBubbleViewTitle() OVERRIDE;
     31   virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE;
     32   virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE;
     33   virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE;
     34   virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE;
     35   virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE;
     36   virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE;
     37 
     38   // ProfileSyncServiceObserver implementation.
     39   virtual void OnStateChanged() OVERRIDE;
     40 
     41  private:
     42   string16 bubble_accept_label_;
     43   string16 bubble_message_;
     44   string16 menu_label_;
     45   ProfileSyncService* service_;
     46   SigninManagerBase* signin_;
     47 
     48   DISALLOW_COPY_AND_ASSIGN(SyncGlobalError);
     49 };
     50 
     51 #endif  // CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_
     52