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.
5 #ifndef CHROME_UTILITY_IMPORTER_IMPORTER_H_
6 #define CHROME_UTILITY_IMPORTER_IMPORTER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
17 // The base class of all importers.
18 class Importer
: public base::RefCountedThreadSafe
<Importer
> {
20 // All importers should implement this method by adding their import logic.
21 // And it will be run in file thread by ImporterHost. Since we do async
22 // import, the importer should invoke ImporterHost::NotifyImportEnded() to
23 // notify its host that import stuff have been finished.
24 virtual void StartImport(const importer::SourceProfile
& source_profile
,
26 ImporterBridge
* bridge
) = 0;
28 // Cancels the import process.
29 virtual void Cancel();
31 bool cancelled() const { return cancelled_
; }
34 friend class base::RefCountedThreadSafe
<Importer
>;
39 scoped_refptr
<ImporterBridge
> bridge_
;
42 // True if the caller cancels the import process.
45 DISALLOW_COPY_AND_ASSIGN(Importer
);
48 #endif // CHROME_UTILITY_IMPORTER_IMPORTER_H_