OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_CONTROLLER_H_ |
6 #define CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_CONTROLLER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 | 10 |
| 11 namespace base { |
11 class CommandLine; | 12 class CommandLine; |
| 13 } |
12 | 14 |
13 namespace diagnostics { | 15 namespace diagnostics { |
14 | 16 |
15 class DiagnosticsWriter; | 17 class DiagnosticsWriter; |
16 class DiagnosticsModel; | 18 class DiagnosticsModel; |
17 | 19 |
18 class DiagnosticsController { | 20 class DiagnosticsController { |
19 public: | 21 public: |
20 static DiagnosticsController* GetInstance(); | 22 static DiagnosticsController* GetInstance(); |
21 | 23 |
22 // Entry point for the diagnostics mode. Returns zero if able to run | 24 // Entry point for the diagnostics mode. Returns zero if able to run |
23 // diagnostics successfully, regardless of the results of the diagnostics. | 25 // diagnostics successfully, regardless of the results of the diagnostics. |
24 int Run(const CommandLine& command_line, DiagnosticsWriter* writer); | 26 int Run(const base::CommandLine& command_line, DiagnosticsWriter* writer); |
25 | 27 |
26 // Entry point for running recovery based on diagnostics that have already | 28 // Entry point for running recovery based on diagnostics that have already |
27 // been run. In order for this to do anything, Run() must be executed first. | 29 // been run. In order for this to do anything, Run() must be executed first. |
28 int RunRecovery(const CommandLine& command_line, DiagnosticsWriter* writer); | 30 int RunRecovery(const base::CommandLine& command_line, |
| 31 DiagnosticsWriter* writer); |
29 | 32 |
30 // Returns a model with the results that have accumulated. They can then be | 33 // Returns a model with the results that have accumulated. They can then be |
31 // queried for their attributes for human consumption later. | 34 // queried for their attributes for human consumption later. |
32 const DiagnosticsModel& GetResults() const; | 35 const DiagnosticsModel& GetResults() const; |
33 | 36 |
34 // Returns true if there are any results available. | 37 // Returns true if there are any results available. |
35 bool HasResults(); | 38 bool HasResults(); |
36 | 39 |
37 // Clears any results that have accumulated. After calling this, do not call | 40 // Clears any results that have accumulated. After calling this, do not call |
38 // GetResults until after Run is called again. | 41 // GetResults until after Run is called again. |
(...skipping 12 matching lines...) Expand all Loading... |
51 | 54 |
52 scoped_ptr<DiagnosticsModel> model_; | 55 scoped_ptr<DiagnosticsModel> model_; |
53 DiagnosticsWriter* writer_; | 56 DiagnosticsWriter* writer_; |
54 | 57 |
55 DISALLOW_COPY_AND_ASSIGN(DiagnosticsController); | 58 DISALLOW_COPY_AND_ASSIGN(DiagnosticsController); |
56 }; | 59 }; |
57 | 60 |
58 } // namespace diagnostics | 61 } // namespace diagnostics |
59 | 62 |
60 #endif // CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_CONTROLLER_H_ | 63 #endif // CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_CONTROLLER_H_ |
OLD | NEW |