| 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/win/registry.h" | 11 #include "base/win/registry.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "components/prefs/pref_service.h" | 14 #include "components/prefs/pref_service.h" |
| 15 | 15 |
| 16 #if defined(GOOGLE_CHROME_BUILD) | 16 #if defined(GOOGLE_CHROME_BUILD) |
| 17 #define PRODUCT_NAME L"Google\\Chrome" | 17 #define PRODUCT_NAME L"Google\\Chrome" |
| 18 #elif defined(CHROMIUM_BUILD) | 18 #elif defined(CHROMIUM_BUILD) |
| 19 #define PRODUCT_NAME L"Chromium" | 19 #define PRODUCT_NAME L"Chromium" |
| 20 #else | 20 #else |
| 21 #error Unknown branding | 21 #error Unknown branding |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 #if defined(GOOGLE_CHROME_BUILD) |
| 25 #define PRODUCT_NAME L"Google\\Chrome" |
| 26 #elif defined(CHROMIUM_BUILD) |
| 27 #define PRODUCT_NAME L"Chromium" |
| 28 #else |
| 29 #error Unknown branding |
| 30 #endif |
| 31 |
| 24 // The registry path where the TriggeredReset values get set. Note that this | 32 // The registry path where the TriggeredReset values get set. Note that this |
| 25 // uses the same path for both SxS (Canary) and non-SxS Chrome. | 33 // uses the same path for both SxS (Canary) and non-SxS Chrome. |
| 26 const wchar_t kTriggeredResetRegistryPath[] = | 34 const wchar_t kTriggeredResetRegistryPath[] = |
| 27 L"Software\\" PRODUCT_NAME L"\\TriggeredReset"; | 35 L"Software\\" PRODUCT_NAME L"\\TriggeredReset"; |
| 28 | 36 |
| 29 const wchar_t kTriggeredResetToolName[] = L"ToolName"; | 37 const wchar_t kTriggeredResetToolName[] = L"ToolName"; |
| 30 const wchar_t kTriggeredResetTimestamp[] = L"Timestamp"; | 38 const wchar_t kTriggeredResetTimestamp[] = L"Timestamp"; |
| 31 | 39 |
| 32 namespace { | 40 namespace { |
| 33 | 41 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 DVLOG(1) << "Failed to read triggered profile reset tool name."; | 92 DVLOG(1) << "Failed to read triggered profile reset tool name."; |
| 85 } else if (tool_name_.length() > kMaxToolNameLength) { | 93 } else if (tool_name_.length() > kMaxToolNameLength) { |
| 86 tool_name_.resize(kMaxToolNameLength); | 94 tool_name_.resize(kMaxToolNameLength); |
| 87 } | 95 } |
| 88 | 96 |
| 89 pref_service->SetInt64(prefs::kLastProfileResetTimestamp, timestamp); | 97 pref_service->SetInt64(prefs::kLastProfileResetTimestamp, timestamp); |
| 90 } | 98 } |
| 91 | 99 |
| 92 UMA_HISTOGRAM_BOOLEAN("Profile.TriggeredReset", has_reset_trigger_); | 100 UMA_HISTOGRAM_BOOLEAN("Profile.TriggeredReset", has_reset_trigger_); |
| 93 } | 101 } |
| OLD | NEW |