OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/diagnostics/recon_diagnostics.h" | 5 #include "chrome/browser/diagnostics/recon_diagnostics.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 virtual int GetId() { return 0; } | 139 virtual int GetId() { return 0; } |
140 | 140 |
141 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { | 141 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { |
142 #if defined(OS_WIN) | 142 #if defined(OS_WIN) |
143 FilePath chrome_exe; | 143 FilePath chrome_exe; |
144 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { | 144 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
145 RecordFailure(ASCIIToUTF16("Path provider failure")); | 145 RecordFailure(ASCIIToUTF16("Path provider failure")); |
146 return false; | 146 return false; |
147 } | 147 } |
148 user_level_ = InstallUtil::IsPerUserInstall( | 148 user_level_ = InstallUtil::IsPerUserInstall(chrome_exe.value().c_str()); |
149 chrome_exe.ToWStringHack().c_str()); | |
150 const char* type = user_level_ ? "User Level" : "System Level"; | 149 const char* type = user_level_ ? "User Level" : "System Level"; |
151 string16 install_type(ASCIIToUTF16(type)); | 150 string16 install_type(ASCIIToUTF16(type)); |
152 #else | 151 #else |
153 string16 install_type(ASCIIToUTF16("System Level")); | 152 string16 install_type(ASCIIToUTF16("System Level")); |
154 #endif // defined(OS_WIN) | 153 #endif // defined(OS_WIN) |
155 RecordSuccess(install_type); | 154 RecordSuccess(install_type); |
156 g_install_type = this; | 155 g_install_type = this; |
157 return true; | 156 return true; |
158 } | 157 } |
159 | 158 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 path = path.Append(chrome::kBookmarksFileName); | 415 path = path.Append(chrome::kBookmarksFileName); |
417 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); | 416 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); |
418 } | 417 } |
419 | 418 |
420 DiagnosticTest* MakeLocalStateTest() { | 419 DiagnosticTest* MakeLocalStateTest() { |
421 FilePath path; | 420 FilePath path; |
422 PathService::Get(chrome::DIR_USER_DATA, &path); | 421 PathService::Get(chrome::DIR_USER_DATA, &path); |
423 path = path.Append(chrome::kLocalStateFilename); | 422 path = path.Append(chrome::kLocalStateFilename); |
424 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); | 423 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); |
425 } | 424 } |
OLD | NEW |