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 std::string& screen_name); |
| 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); |
| 32 |
| 33 std::string screen_name_; |
| 34 bool was_shown_; |
| 35 ErrorScreen::ErrorState last_error_shown_; |
| 36 base::Time error_screen_start_time_; |
| 37 base::TimeDelta time_on_error_screens_; |
| 38 }; |
| 39 |
| 40 } // namespace chromeos |
| 41 |
| 42 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ERROR_SCREENS_HISTOGRAM_HELPER_H_ |
OLD | NEW |