[go: nahoru, domu]

blob: afdbbec6a3813a362928a828137f913651daf595 [file] [log] [blame]
xiyuan@chromium.org308ec4f2014-02-06 10:52:121// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_DIAGNOSIS_RUNNER_H_
6#define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_DIAGNOSIS_RUNNER_H_
7
8#include <string>
9
10#include "base/basictypes.h"
11#include "base/memory/weak_ptr.h"
12#include "chrome/browser/extensions/api/feedback_private/feedback_service.h"
blundell@chromium.org12b7af32014-03-13 05:28:2013#include "components/keyed_service/core/keyed_service.h"
xiyuan@chromium.org308ec4f2014-02-06 10:52:1214
15class Profile;
16
17namespace chromeos {
18
19// A class to run diagnose for kiosk app. Currently, it only schedules a
20// feedback to collected.
blundell@chromium.org12b7af32014-03-13 05:28:2021class KioskDiagnosisRunner : public KeyedService {
xiyuan@chromium.org308ec4f2014-02-06 10:52:1222 public:
23 // Run diagnostic jobs for |app_id|.
24 static void Run(Profile* profile, const std::string& app_id);
25
26 private:
27 // A BrowserContextKeyedServiceFactory for this service.
28 class Factory;
29
30 explicit KioskDiagnosisRunner(Profile* profile);
31 virtual ~KioskDiagnosisRunner();
32
33 void Start(const std::string& app_id);
34
35 void StartSystemLogCollection();
36 void SendSysLogFeedback(const extensions::SystemInformationList& sys_info);
37 void OnFeedbackSent(bool sent);
38
39 Profile* profile_;
40 std::string app_id_;
41 base::WeakPtrFactory<KioskDiagnosisRunner> weak_factory_;
42
43 DISALLOW_COPY_AND_ASSIGN(KioskDiagnosisRunner);
44};
45
46} // namespace chromeos
47
48#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_DIAGNOSIS_RUNNER_H_