Home | History | Annotate | Download | only in host
      1 // Copyright 2013 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 REMOTING_HOST_CONFIG_WATCHER_H_
      6 #define REMOTING_HOST_CONFIG_WATCHER_H_
      7 
      8 #include <string>
      9 
     10 #include "base/basictypes.h"
     11 #include "base/compiler_specific.h"
     12 #include "base/files/file_path.h"
     13 #include "base/memory/ref_counted.h"
     14 
     15 namespace remoting {
     16 
     17 class ConfigWatcher {
     18  public:
     19   class Delegate {
     20    public:
     21     virtual ~Delegate() {}
     22 
     23     // Called once after starting watching the configuration file and every time
     24     // the file changes.
     25     virtual void OnConfigUpdated(const std::string& serialized_config) = 0;
     26 
     27     // Called when the configuration file watcher encountered an error.
     28     virtual void OnConfigWatcherError() = 0;
     29   };
     30 
     31   virtual void Watch(Delegate* delegate) = 0;
     32 
     33   ConfigWatcher() {}
     34 
     35   virtual ~ConfigWatcher() {}
     36  private:
     37   DISALLOW_COPY_AND_ASSIGN(ConfigWatcher);
     38 };
     39 
     40 }  // namespace remoting
     41 
     42 #endif  // REMOTING_HOST_CONFIG_WATCHER_H_
     43