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

Side by Side Diff: chrome/browser/chromeos/first_run/first_run_controller.cc

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 web_contents_for_tests_ = view->GetWebContents(); 90 web_contents_for_tests_ = view->GetWebContents();
91 91
92 if (actor_->IsInitialized()) 92 if (actor_->IsInitialized())
93 OnActorInitialized(); 93 OnActorInitialized();
94 } 94 }
95 95
96 void FirstRunController::Finalize() { 96 void FirstRunController::Finalize() {
97 int furthest_step = current_step_index_ == NONE_STEP_INDEX 97 int furthest_step = current_step_index_ == NONE_STEP_INDEX
98 ? steps_.size() - 1 98 ? steps_.size() - 1
99 : current_step_index_; 99 : current_step_index_;
100 UMA_HISTOGRAM_ENUMERATION("CrosFirstRun.FurthestStep", 100 UMA_HISTOGRAM_EXACT_LINEAR("CrosFirstRun.FurthestStep", furthest_step,
101 furthest_step, 101 steps_.size());
102 steps_.size());
103 UMA_HISTOGRAM_MEDIUM_TIMES("CrosFirstRun.TimeSpent", 102 UMA_HISTOGRAM_MEDIUM_TIMES("CrosFirstRun.TimeSpent",
104 base::Time::Now() - start_time_); 103 base::Time::Now() - start_time_);
105 if (GetCurrentStep()) 104 if (GetCurrentStep())
106 GetCurrentStep()->OnBeforeHide(); 105 GetCurrentStep()->OnBeforeHide();
107 steps_.clear(); 106 steps_.clear();
108 if (actor_) 107 if (actor_)
109 actor_->set_delegate(NULL); 108 actor_->set_delegate(NULL);
110 actor_ = NULL; 109 actor_ = NULL;
111 shell_helper_->RemoveObserver(this); 110 shell_helper_->RemoveObserver(this);
112 shell_helper_.reset(); 111 shell_helper_.reset();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 current_step_index_ = NONE_STEP_INDEX; 186 current_step_index_ = NONE_STEP_INDEX;
188 } 187 }
189 188
190 first_run::Step* FirstRunController::GetCurrentStep() const { 189 first_run::Step* FirstRunController::GetCurrentStep() const {
191 return current_step_index_ != NONE_STEP_INDEX ? 190 return current_step_index_ != NONE_STEP_INDEX ?
192 steps_[current_step_index_].get() : NULL; 191 steps_[current_step_index_].get() : NULL;
193 } 192 }
194 193
195 } // namespace chromeos 194 } // namespace chromeos
196 195
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698