| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/first_run/first_run_import_observer.h" | 5 #include "chrome/browser/first_run/first_run_import_observer.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "content/common/result_codes.h" | 8 #include "content/public/common/result_codes.h" |
| 9 | 9 |
| 10 FirstRunImportObserver::FirstRunImportObserver() | 10 FirstRunImportObserver::FirstRunImportObserver() |
| 11 : loop_running_(false), import_result_(content::RESULT_CODE_NORMAL_EXIT) { | 11 : loop_running_(false), import_result_(content::RESULT_CODE_NORMAL_EXIT) { |
| 12 } | 12 } |
| 13 | 13 |
| 14 FirstRunImportObserver::~FirstRunImportObserver() { | 14 FirstRunImportObserver::~FirstRunImportObserver() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 void FirstRunImportObserver::RunLoop() { | 17 void FirstRunImportObserver::RunLoop() { |
| 18 loop_running_ = true; | 18 loop_running_ = true; |
| 19 MessageLoop::current()->Run(); | 19 MessageLoop::current()->Run(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void FirstRunImportObserver::Finish() { | 22 void FirstRunImportObserver::Finish() { |
| 23 if (loop_running_) | 23 if (loop_running_) |
| 24 MessageLoop::current()->Quit(); | 24 MessageLoop::current()->Quit(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void FirstRunImportObserver::ImportCompleted() { | 27 void FirstRunImportObserver::ImportCompleted() { |
| 28 import_result_ = content::RESULT_CODE_NORMAL_EXIT; | 28 import_result_ = content::RESULT_CODE_NORMAL_EXIT; |
| 29 Finish(); | 29 Finish(); |
| 30 } | 30 } |
| OLD | NEW |