summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run/first_run_import_observer.cc
blob: 611e9577ae9360438e96c5701c53137899fbf85f (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
// Copyright (c) 2011 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.

#include "chrome/browser/first_run/first_run_import_observer.h"

#include "base/message_loop.h"
#include "content/public/common/result_codes.h"

FirstRunImportObserver::FirstRunImportObserver()
    : loop_running_(false), import_result_(content::RESULT_CODE_NORMAL_EXIT) {
}

FirstRunImportObserver::~FirstRunImportObserver() {
}

void FirstRunImportObserver::RunLoop() {
  loop_running_ = true;
  MessageLoop::current()->Run();
}

void FirstRunImportObserver::Finish() {
  if (loop_running_)
    MessageLoop::current()->Quit();
}

void FirstRunImportObserver::ImportCompleted() {
  import_result_ = content::RESULT_CODE_NORMAL_EXIT;
  Finish();
}