Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ERROR_SCREENS_HISTOGRAM_HELPER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ERROR_SCREENS_HISTOGRAM_HELPER_H_ | |
| 7 | |
| 8 #include "chrome/browser/chromeos/login/screens/error_screen.h" | |
| 9 | |
| 10 namespace chromeos { | |
| 11 FORWARD_DECLARE_TEST(ErrorScreensHistogramHelperTest, TestShowHideTime); | |
| 12 FORWARD_DECLARE_TEST(ErrorScreensHistogramHelperTest, TestShowHideShowHideTime); | |
| 13 FORWARD_DECLARE_TEST(ErrorScreensHistogramHelperTest, TestShowShowHideTime); | |
| 14 | |
| 15 class ErrorScreensHistogramHelper { | |
| 16 public: | |
| 17 explicit ErrorScreensHistogramHelper(const char* screen_name); | |
|
ygorshenin1
2014/08/26 14:33:14
nit: replace const char* by const std::string&.
Roman Sorokin (ftl)
2014/09/04 13:26:47
Done.
| |
| 18 void OnScreenShow(); | |
| 19 void OnErrorShow(ErrorScreen::ErrorState error); | |
| 20 void OnErrorHide(); | |
| 21 ~ErrorScreensHistogramHelper(); | |
| 22 | |
| 23 private: | |
| 24 FRIEND_TEST_ALL_PREFIXES(ErrorScreensHistogramHelperTest, TestShowHideTime); | |
| 25 FRIEND_TEST_ALL_PREFIXES(ErrorScreensHistogramHelperTest, | |
| 26 TestShowHideShowHideTime); | |
| 27 FRIEND_TEST_ALL_PREFIXES(ErrorScreensHistogramHelperTest, | |
| 28 TestShowShowHideTime); | |
| 29 // functions for testing. | |
| 30 void OnErrorShowTime(ErrorScreen::ErrorState error, base::Time now); | |
| 31 void OnErrorHideTime(base::Time now); | |
|
ygorshenin1
2014/08/26 14:33:14
nit: add a blank line between methods and fields.
Roman Sorokin (ftl)
2014/09/04 13:26:47
Done.
| |
| 32 std::string screen_name_; | |
| 33 bool was_shown_; | |
| 34 ErrorScreen::ErrorState last_error_shown_; | |
| 35 base::Time error_screen_start_time; | |
| 36 base::TimeDelta time_on_error_screens; | |
| 37 }; | |
| 38 | |
| 39 } // namespace chromeos | |
| 40 | |
| 41 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ERROR_SCREENS_HISTOGRAM_HELPER_H_ | |
| OLD | NEW |