1 // Copyright 2018 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 CHROMEOS_COMPONENTS_TETHER_TETHER_SESSION_COMPLETION_LOGGER_H_ 6 #define CHROMEOS_COMPONENTS_TETHER_TETHER_SESSION_COMPLETION_LOGGER_H_ 7 8 #include "base/macros.h" 9 10 namespace chromeos { 11 12 namespace tether { 13 14 // Wrapper around metrics reporting for how a Tether session ended. 15 class TetherSessionCompletionLogger { 16 public: 17 enum SessionCompletionReason { 18 OTHER = 0, 19 USER_DISCONNECTED = 1, 20 CONNECTION_DROPPED = 2, 21 USER_LOGGED_OUT = 3, 22 USER_CLOSED_LID = 4, 23 PREF_DISABLED = 5, 24 BLUETOOTH_DISABLED = 6, 25 CELLULAR_DISABLED = 7, 26 WIFI_DISABLED = 8, 27 BLUETOOTH_CONTROLLER_DISAPPEARED = 9, 28 MULTIDEVICE_HOST_UNVERIFIED = 10, 29 BETTER_TOGETHER_SUITE_DISABLED = 11, 30 SESSION_COMPLETION_REASON_MAX 31 }; 32 33 TetherSessionCompletionLogger(); 34 virtual ~TetherSessionCompletionLogger(); 35 36 virtual void RecordTetherSessionCompletion( 37 const SessionCompletionReason& reason); 38 39 private: 40 friend class TetherSessionCompletionLoggerTest; 41 42 DISALLOW_COPY_AND_ASSIGN(TetherSessionCompletionLogger); 43 }; 44 45 } // namespace tether 46 47 } // namespace chromeos 48 49 #endif // CHROMEOS_COMPONENTS_TETHER_TETHER_SESSION_COMPLETION_LOGGER_H_ 50