OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/profile_resetter/triggered_profile_resetter.h" | 5 #include "chrome/browser/profile_resetter/triggered_profile_resetter.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
11 #include "base/prefs/pref_service.h" | |
12 #include "base/win/registry.h" | 11 #include "base/win/registry.h" |
13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 15 #include "components/prefs/pref_service.h" |
16 | 16 |
17 // The registry path where the TriggeredReset values get set. Note that this | 17 // The registry path where the TriggeredReset values get set. Note that this |
18 // uses the same path for both SxS (Canary) and non-SxS Chrome. | 18 // uses the same path for both SxS (Canary) and non-SxS Chrome. |
19 const wchar_t kTriggeredResetRegistryPath[] = | 19 const wchar_t kTriggeredResetRegistryPath[] = |
20 L"Software\\" PRODUCT_STRING_PATH L"\\TriggeredReset"; | 20 L"Software\\" PRODUCT_STRING_PATH L"\\TriggeredReset"; |
21 | 21 |
22 const wchar_t kTriggeredResetToolName[] = L"ToolName"; | 22 const wchar_t kTriggeredResetToolName[] = L"ToolName"; |
23 const wchar_t kTriggeredResetTimestamp[] = L"Timestamp"; | 23 const wchar_t kTriggeredResetTimestamp[] = L"Timestamp"; |
24 | 24 |
25 namespace { | 25 namespace { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 DVLOG(1) << "Failed to read triggered profile reset tool name."; | 77 DVLOG(1) << "Failed to read triggered profile reset tool name."; |
78 } else if (tool_name_.length() > kMaxToolNameLength) { | 78 } else if (tool_name_.length() > kMaxToolNameLength) { |
79 tool_name_.resize(kMaxToolNameLength); | 79 tool_name_.resize(kMaxToolNameLength); |
80 } | 80 } |
81 | 81 |
82 pref_service->SetInt64(prefs::kLastProfileResetTimestamp, timestamp); | 82 pref_service->SetInt64(prefs::kLastProfileResetTimestamp, timestamp); |
83 } | 83 } |
84 | 84 |
85 UMA_HISTOGRAM_BOOLEAN("Profile.TriggeredReset", has_reset_trigger_); | 85 UMA_HISTOGRAM_BOOLEAN("Profile.TriggeredReset", has_reset_trigger_); |
86 } | 86 } |
OLD | NEW |