Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Unified Diff: chrome/browser/chromeos/first_run/first_run_controller.cc

Issue 131023003: Added UMA metrics for ChromeOS first-run UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/first_run/first_run_controller.cc
diff --git a/chrome/browser/chromeos/first_run/first_run_controller.cc b/chrome/browser/chromeos/first_run/first_run_controller.cc
index 65ed426262490cad3ad76a610e7dbaf2ea45b2b7..5d8210af0f9eb110135f43a2392c3da9694e2f67 100644
--- a/chrome/browser/chromeos/first_run/first_run_controller.cc
+++ b/chrome/browser/chromeos/first_run/first_run_controller.cc
@@ -7,7 +7,9 @@
#include "ash/shell.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/histogram.h"
#include "chrome/browser/chromeos/first_run/first_run_view.h"
+#include "chrome/browser/chromeos/first_run/metrics.h"
#include "chrome/browser/chromeos/first_run/steps/app_list_step.h"
#include "chrome/browser/chromeos/first_run/steps/help_step.h"
#include "chrome/browser/chromeos/first_run/steps/tray_step.h"
@@ -23,6 +25,12 @@ size_t NONE_STEP_INDEX = std::numeric_limits<size_t>::max();
// running now.
chromeos::FirstRunController* g_instance;
+void RecordCompletion(chromeos::first_run::TutorialCompletion type) {
+ UMA_HISTOGRAM_ENUMERATION("CrosFirstRun.TutorialCompletion",
+ type,
+ chromeos::first_run::kTutorialCompletionSize);
+}
+
} // namespace
namespace chromeos {
@@ -57,8 +65,8 @@ FirstRunController* FirstRunController::GetInstanceForTest() {
FirstRunController::FirstRunController()
: actor_(NULL),
current_step_index_(NONE_STEP_INDEX),
- user_profile_(NULL) {
-}
+ user_profile_(NULL),
+ start_time_(base::Time::Now()) {}
ygorshenin1 2014/01/15 09:34:25 Please, move initialization of start_time_ to Init
dzhioev (left Google) 2014/01/15 13:50:59 Done.
void FirstRunController::Init() {
UserManager* user_manager = UserManager::Get();
@@ -81,6 +89,13 @@ void FirstRunController::Init() {
}
void FirstRunController::Finalize() {
+ int furthest_step = current_step_index_ == NONE_STEP_INDEX
+ ? steps_.size() - 1
+ : current_step_index_;
+ UMA_HISTOGRAM_ENUMERATION(
+ "CrosFirstRun.FurthestStep", furthest_step, steps_.size());
+ UMA_HISTOGRAM_MEDIUM_TIMES("CrosFirstRun.TimeSpent",
+ base::Time::Now() - start_time_);
if (GetCurrentStep())
GetCurrentStep()->OnBeforeHide();
steps_.clear();
@@ -103,6 +118,7 @@ void FirstRunController::OnNextButtonClicked(const std::string& step_name) {
}
void FirstRunController::OnHelpButtonClicked() {
+ RecordCompletion(first_run::kTutorialCompletedWithKeepExploring);
on_actor_finalized_ = base::Bind(chrome::ShowHelpForProfile,
user_profile_,
chrome::HOST_DESKTOP_TYPE_ASH,
@@ -135,6 +151,7 @@ void FirstRunController::OnActorDestroyed() {
}
void FirstRunController::OnCancelled() {
+ RecordCompletion(first_run::kTutorialNotFinished);
Stop();
}
@@ -149,10 +166,12 @@ void FirstRunController::RegisterSteps() {
void FirstRunController::ShowNextStep() {
AdvanceStep();
- if (GetCurrentStep())
+ if (GetCurrentStep()) {
GetCurrentStep()->Show();
ygorshenin1 2014/01/15 09:34:25 Could you please transform this code in this way:
dzhioev (left Google) 2014/01/15 13:50:59 Done.
- else
+ } else {
actor_->Finalize();
+ RecordCompletion(first_run::kTutorialCompletedWithGotIt);
+ }
}
void FirstRunController::AdvanceStep() {

Powered by Google App Engine
This is Rietveld 408576698