summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run/first_run_import_observer.h
blob: a051c9d8199a01218aa1dce1790fad221cb0dd9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_IMPORT_OBSERVER_H_
#define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_IMPORT_OBSERVER_H_
#pragma once

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/importer/importer_observer.h"

// This class is used by first_run::ImportNow to get notified of the outcome of
// the import operation. It differs from ImportProcessRunner in that this
// class executes in the context of the importing child process.
// The values that it handles are meant to be used as the process exit code.
class FirstRunImportObserver : public ImporterObserver {
 public:
  FirstRunImportObserver();
  virtual ~FirstRunImportObserver();

  void RunLoop();

  int import_result() const { return import_result_; }

 private:
  void Finish();

  // ImporterObserver:
  virtual void ImportCompleted() OVERRIDE;

  bool loop_running_;
  int import_result_;

  DISALLOW_COPY_AND_ASSIGN(FirstRunImportObserver);
};

#endif  // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_IMPORT_OBSERVER_H_