Home | History | Annotate | Download | only in importer
      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_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_
      6 #define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_
      7 #pragma once
      8 
      9 #include "base/basictypes.h"
     10 #include "base/compiler_specific.h"
     11 #include "chrome/browser/importer/importer_host.h"
     12 
     13 class ExternalProcessImporterClient;
     14 class Profile;
     15 class ProfileWriter;
     16 
     17 namespace importer {
     18 struct SourceProfile;
     19 }
     20 
     21 // This class manages the import process. It creates the in-process half of the
     22 // importer bridge and the external process importer client.
     23 class ExternalProcessImporterHost : public ImporterHost {
     24  public:
     25   ExternalProcessImporterHost();
     26 
     27   // ImporterHost:
     28   virtual void Cancel() OVERRIDE;
     29 
     30  private:
     31   // ImporterHost:
     32   virtual void StartImportSettings(
     33       const importer::SourceProfile& source_profile,
     34       Profile* target_profile,
     35       uint16 items,
     36       ProfileWriter* writer,
     37       bool first_run) OVERRIDE;
     38   virtual void InvokeTaskIfDone() OVERRIDE;
     39   virtual void Loaded(BookmarkModel* model) OVERRIDE;
     40 
     41   // Used to pass notifications from the browser side to the external process.
     42   ExternalProcessImporterClient* client_;
     43 
     44   // Information about a profile needed for importing.
     45   const importer::SourceProfile* source_profile_;
     46 
     47   // Bitmask of items to be imported (see importer::ImportItem enum).
     48   uint16 items_;
     49 
     50   // Whether to import bookmarks to the bookmark bar.
     51   bool import_to_bookmark_bar_;
     52 
     53   // True if the import process has been cancelled.
     54   bool cancelled_;
     55 
     56   // True if the import process has been launched. This prevents race
     57   // conditions on import cancel.
     58   bool import_process_launched_;
     59 
     60   DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterHost);
     61 };
     62 
     63 #endif  // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_
     64