| 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/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 FirstRunController::FirstRunController() | 66 FirstRunController::FirstRunController() |
| 67 : actor_(NULL), | 67 : actor_(NULL), |
| 68 current_step_index_(NONE_STEP_INDEX), | 68 current_step_index_(NONE_STEP_INDEX), |
| 69 user_profile_(NULL) { | 69 user_profile_(NULL) { |
| 70 } | 70 } |
| 71 | 71 |
| 72 void FirstRunController::Init() { | 72 void FirstRunController::Init() { |
| 73 start_time_ = base::Time::Now(); | 73 start_time_ = base::Time::Now(); |
| 74 UserManager* user_manager = UserManager::Get(); | 74 UserManager* user_manager = UserManager::Get(); |
| 75 user_profile_ = | 75 user_profile_ = ProfileHelper::Get()->GetProfileByUserUnsafe( |
| 76 ProfileHelper::Get()->GetProfileByUser(user_manager->GetActiveUser()); | 76 user_manager->GetActiveUser()); |
| 77 | 77 |
| 78 shell_helper_.reset(ash::Shell::GetInstance()->CreateFirstRunHelper()); | 78 shell_helper_.reset(ash::Shell::GetInstance()->CreateFirstRunHelper()); |
| 79 shell_helper_->AddObserver(this); | 79 shell_helper_->AddObserver(this); |
| 80 | 80 |
| 81 FirstRunView* view = new FirstRunView(); | 81 FirstRunView* view = new FirstRunView(); |
| 82 view->Init(user_profile_); | 82 view->Init(user_profile_); |
| 83 shell_helper_->GetOverlayWidget()->SetContentsView(view); | 83 shell_helper_->GetOverlayWidget()->SetContentsView(view); |
| 84 actor_ = view->GetActor(); | 84 actor_ = view->GetActor(); |
| 85 actor_->set_delegate(this); | 85 actor_->set_delegate(this); |
| 86 shell_helper_->GetOverlayWidget()->Show(); | 86 shell_helper_->GetOverlayWidget()->Show(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 current_step_index_ = NONE_STEP_INDEX; | 187 current_step_index_ = NONE_STEP_INDEX; |
| 188 } | 188 } |
| 189 | 189 |
| 190 first_run::Step* FirstRunController::GetCurrentStep() const { | 190 first_run::Step* FirstRunController::GetCurrentStep() const { |
| 191 return current_step_index_ != NONE_STEP_INDEX ? | 191 return current_step_index_ != NONE_STEP_INDEX ? |
| 192 steps_[current_step_index_].get() : NULL; | 192 steps_[current_step_index_].get() : NULL; |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace chromeos | 195 } // namespace chromeos |
| 196 | 196 |
| OLD | NEW |