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_FIRST_RUN_FIRST_RUN_IMPORT_OBSERVER_H_
6#define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_IMPORT_OBSERVER_H_
7#pragma once
8
9#include "base/basictypes.h"
10#include "base/compiler_specific.h"
11#include "chrome/browser/importer/importer_observer.h"
12
13// This class is used by FirstRun::ImportNow to get notified of the outcome of
14// the import operation. It differs from ImportProcessRunner in that this
15// class executes in the context of the importing child process.
16// The values that it handles are meant to be used as the process exit code.
17class FirstRunImportObserver : public ImporterObserver {
18 public:
19  FirstRunImportObserver();
20  virtual ~FirstRunImportObserver();
21
22  void RunLoop();
23
24  int import_result() const { return import_result_; }
25
26 private:
27  void Finish();
28
29  // ImporterObserver:
30  virtual void ImportCompleted() OVERRIDE;
31
32  bool loop_running_;
33  int import_result_;
34
35  DISALLOW_COPY_AND_ASSIGN(FirstRunImportObserver);
36};
37
38#endif  // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_IMPORT_OBSERVER_H_
39