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" |
11 #include "chrome/browser/chromeos/first_run/first_run_view.h" | 11 #include "chrome/browser/chromeos/first_run/first_run_view.h" |
12 #include "chrome/browser/chromeos/first_run/metrics.h" | 12 #include "chrome/browser/chromeos/first_run/metrics.h" |
13 #include "chrome/browser/chromeos/first_run/steps/app_list_step.h" | 13 #include "chrome/browser/chromeos/first_run/steps/app_list_step.h" |
14 #include "chrome/browser/chromeos/first_run/steps/help_step.h" | 14 #include "chrome/browser/chromeos/first_run/steps/help_step.h" |
15 #include "chrome/browser/chromeos/first_run/steps/tray_step.h" | 15 #include "chrome/browser/chromeos/first_run/steps/tray_step.h" |
16 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
17 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
18 #include "chrome/browser/ui/chrome_pages.h" | 17 #include "chrome/browser/ui/chrome_pages.h" |
| 18 #include "components/user_manager/user_manager.h" |
19 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 size_t NONE_STEP_INDEX = std::numeric_limits<size_t>::max(); | 23 size_t NONE_STEP_INDEX = std::numeric_limits<size_t>::max(); |
24 | 24 |
25 // Instance of currently running controller, or NULL if controller is not | 25 // Instance of currently running controller, or NULL if controller is not |
26 // running now. | 26 // running now. |
27 chromeos::FirstRunController* g_instance; | 27 chromeos::FirstRunController* g_instance; |
28 | 28 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
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 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
75 user_profile_ = ProfileHelper::Get()->GetProfileByUserUnsafe( | 75 user_profile_ = ProfileHelper::Get()->GetProfileByUserUnsafe( |
76 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(); |
(...skipping 102 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 |