| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/first_run/first_run_controller.h" | 5 #include "chrome/browser/chromeos/first_run/first_run_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/location.h" |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "chrome/browser/chromeos/first_run/first_run_view.h" | 13 #include "chrome/browser/chromeos/first_run/first_run_view.h" |
| 12 #include "chrome/browser/chromeos/first_run/metrics.h" | 14 #include "chrome/browser/chromeos/first_run/metrics.h" |
| 13 #include "chrome/browser/chromeos/first_run/steps/app_list_step.h" | 15 #include "chrome/browser/chromeos/first_run/steps/app_list_step.h" |
| 14 #include "chrome/browser/chromeos/first_run/steps/help_step.h" | 16 #include "chrome/browser/chromeos/first_run/steps/help_step.h" |
| 15 #include "chrome/browser/chromeos/first_run/steps/tray_step.h" | 17 #include "chrome/browser/chromeos/first_run/steps/tray_step.h" |
| 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 17 #include "chrome/browser/ui/chrome_pages.h" | 19 #include "chrome/browser/ui/chrome_pages.h" |
| 18 #include "components/user_manager/user_manager.h" | 20 #include "components/user_manager/user_manager.h" |
| 19 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
| 20 | 22 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 48 g_instance->Init(); | 50 g_instance->Init(); |
| 49 } | 51 } |
| 50 | 52 |
| 51 // static | 53 // static |
| 52 void FirstRunController::Stop() { | 54 void FirstRunController::Stop() { |
| 53 if (!g_instance) { | 55 if (!g_instance) { |
| 54 LOG(WARNING) << "First-run tutorial is not running."; | 56 LOG(WARNING) << "First-run tutorial is not running."; |
| 55 return; | 57 return; |
| 56 } | 58 } |
| 57 g_instance->Finalize(); | 59 g_instance->Finalize(); |
| 58 base::MessageLoop::current()->DeleteSoon(FROM_HERE, g_instance); | 60 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, g_instance); |
| 59 g_instance = NULL; | 61 g_instance = NULL; |
| 60 } | 62 } |
| 61 | 63 |
| 62 FirstRunController* FirstRunController::GetInstanceForTest() { | 64 FirstRunController* FirstRunController::GetInstanceForTest() { |
| 63 return g_instance; | 65 return g_instance; |
| 64 } | 66 } |
| 65 | 67 |
| 66 FirstRunController::FirstRunController() | 68 FirstRunController::FirstRunController() |
| 67 : actor_(NULL), | 69 : actor_(NULL), |
| 68 current_step_index_(NONE_STEP_INDEX), | 70 current_step_index_(NONE_STEP_INDEX), |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 current_step_index_ = NONE_STEP_INDEX; | 187 current_step_index_ = NONE_STEP_INDEX; |
| 186 } | 188 } |
| 187 | 189 |
| 188 first_run::Step* FirstRunController::GetCurrentStep() const { | 190 first_run::Step* FirstRunController::GetCurrentStep() const { |
| 189 return current_step_index_ != NONE_STEP_INDEX ? | 191 return current_step_index_ != NONE_STEP_INDEX ? |
| 190 steps_[current_step_index_].get() : NULL; | 192 steps_[current_step_index_].get() : NULL; |
| 191 } | 193 } |
| 192 | 194 |
| 193 } // namespace chromeos | 195 } // namespace chromeos |
| 194 | 196 |
| OLD | NEW |