| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "components/metrics/execution_phase.h" | 5 #include "components/metrics/execution_phase.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "components/browser_watcher/stability_data_names.h" | |
| 9 #include "components/browser_watcher/stability_debugging.h" | |
| 10 #include "components/metrics/metrics_pref_names.h" | 8 #include "components/metrics/metrics_pref_names.h" |
| 11 #include "components/prefs/pref_registry_simple.h" | 9 #include "components/prefs/pref_registry_simple.h" |
| 12 #include "components/prefs/pref_service.h" | 10 #include "components/prefs/pref_service.h" |
| 13 | 11 |
| 12 #if defined(OS_WIN) |
| 13 #include "components/browser_watcher/stability_data_names.h" |
| 14 #include "components/browser_watcher/stability_debugging.h" |
| 15 #endif // defined(OS_WIN) |
| 16 |
| 14 namespace metrics { | 17 namespace metrics { |
| 15 | 18 |
| 16 ExecutionPhaseManager::ExecutionPhaseManager(PrefService* local_state) | 19 ExecutionPhaseManager::ExecutionPhaseManager(PrefService* local_state) |
| 17 : local_state_(local_state) {} | 20 : local_state_(local_state) {} |
| 18 | 21 |
| 19 ExecutionPhaseManager::~ExecutionPhaseManager() {} | 22 ExecutionPhaseManager::~ExecutionPhaseManager() {} |
| 20 | 23 |
| 21 // static | 24 // static |
| 22 void ExecutionPhaseManager::RegisterPrefs(PrefRegistrySimple* registry) { | 25 void ExecutionPhaseManager::RegisterPrefs(PrefRegistrySimple* registry) { |
| 23 registry->RegisterIntegerPref( | 26 registry->RegisterIntegerPref( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 60 } |
| 58 | 61 |
| 59 void ExecutionPhaseManager::OnAppEnterForeground() { | 62 void ExecutionPhaseManager::OnAppEnterForeground() { |
| 60 // Restore prefs value altered by OnEnterBackground. | 63 // Restore prefs value altered by OnEnterBackground. |
| 61 local_state_->SetInteger(prefs::kStabilityExecutionPhase, | 64 local_state_->SetInteger(prefs::kStabilityExecutionPhase, |
| 62 static_cast<int>(execution_phase_)); | 65 static_cast<int>(execution_phase_)); |
| 63 } | 66 } |
| 64 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 67 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
| 65 | 68 |
| 66 } // namespace metrics | 69 } // namespace metrics |
| OLD | NEW |