Home | History | Annotate | Download | only in sync
      1 // Copyright 2014 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_ERROR_NOTIFIER_ASH_H_
      6 #define CHROME_BROWSER_SYNC_SYNC_ERROR_NOTIFIER_ASH_H_
      7 
      8 #include <string>
      9 
     10 #include "base/basictypes.h"
     11 #include "base/compiler_specific.h"
     12 #include "base/strings/string16.h"
     13 #include "chrome/browser/sync/sync_error_controller.h"
     14 #include "components/keyed_service/core/keyed_service.h"
     15 
     16 class Profile;
     17 
     18 // Shows sync-related errors as notifications in Ash.
     19 class SyncErrorNotifier : public SyncErrorController::Observer,
     20                           public KeyedService {
     21  public:
     22   SyncErrorNotifier(SyncErrorController* controller, Profile* profile);
     23   virtual ~SyncErrorNotifier();
     24 
     25   // KeyedService:
     26   virtual void Shutdown() OVERRIDE;
     27 
     28   // SyncErrorController::Observer:
     29   virtual void OnErrorChanged() OVERRIDE;
     30 
     31  private:
     32   // The error controller to query for error details.
     33   SyncErrorController* error_controller_;
     34 
     35   // The Profile this service belongs to.
     36   Profile* profile_;
     37 
     38   // Used to keep track of the message center notification.
     39   std::string notification_id_;
     40 
     41   DISALLOW_COPY_AND_ASSIGN(SyncErrorNotifier);
     42 };
     43 
     44 #endif  // CHROME_BROWSER_SYNC_SYNC_ERROR_NOTIFIER_ASH_H_
     45