Home | History | Annotate | Download | only in notifier
      1 // Copyright (c) 2011 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_NOTIFIER_SYNC_NOTIFIER_FACTORY_H_
      6 #define CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_FACTORY_H_
      7 
      8 #include <string>
      9 
     10 #include "base/memory/ref_counted.h"
     11 
     12 class CommandLine;
     13 
     14 namespace net {
     15 class URLRequestContextGetter;
     16 }
     17 
     18 namespace sync_notifier {
     19 
     20 class SyncNotifier;
     21 
     22 // Class to instantiate various implementations of the SyncNotifier interface.
     23 class SyncNotifierFactory {
     24  public:
     25   // |client_info| is a string identifying the client, e.g. a user
     26   // agent string.
     27   explicit SyncNotifierFactory(const std::string& client_info);
     28   ~SyncNotifierFactory();
     29 
     30   // Creates the appropriate sync notifier. The caller should take ownership
     31   // of the object returned and delete it when no longer used.
     32   SyncNotifier* CreateSyncNotifier(
     33       const CommandLine& command_line,
     34       const scoped_refptr<net::URLRequestContextGetter>&
     35           request_context_getter);
     36 
     37  private:
     38   const std::string client_info_;
     39 };
     40 
     41 }  // namespace sync_notifier
     42 
     43 #endif  // CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_FACTORY_H_
     44