| 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 "components/browser_watcher/stability_data_names.h" | 7 #include "components/browser_watcher/stability_data_names.h" |
| 8 #include "components/browser_watcher/stability_debugging.h" | 8 #include "components/browser_watcher/stability_debugging.h" |
| 9 #include "components/metrics/metrics_pref_names.h" | 9 #include "components/metrics/stability_pref_names.h" |
| 10 #include "components/prefs/pref_registry_simple.h" | 10 #include "components/prefs/pref_registry_simple.h" |
| 11 #include "components/prefs/pref_service.h" | 11 #include "components/prefs/pref_service.h" |
| 12 | 12 |
| 13 namespace metrics { | 13 namespace metrics { |
| 14 | 14 |
| 15 ExecutionPhaseManager::ExecutionPhaseManager(PrefService* local_state) | 15 ExecutionPhaseManager::ExecutionPhaseManager(PrefService* local_state) |
| 16 : local_state_(local_state) {} | 16 : local_state_(local_state) {} |
| 17 | 17 |
| 18 ExecutionPhaseManager::~ExecutionPhaseManager() {} | 18 ExecutionPhaseManager::~ExecutionPhaseManager() {} |
| 19 | 19 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ExecutionPhaseManager::OnAppEnterForeground() { | 56 void ExecutionPhaseManager::OnAppEnterForeground() { |
| 57 // Restore prefs value altered by OnEnterBackground. | 57 // Restore prefs value altered by OnEnterBackground. |
| 58 local_state_->SetInteger(prefs::kStabilityExecutionPhase, | 58 local_state_->SetInteger(prefs::kStabilityExecutionPhase, |
| 59 static_cast<int>(execution_phase_)); | 59 static_cast<int>(execution_phase_)); |
| 60 } | 60 } |
| 61 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 61 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
| 62 | 62 |
| 63 } // namespace metrics | 63 } // namespace metrics |
| OLD | NEW |