OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CLOUD_PRINT_SERVICE_CHROME_LAUNCHER_H_ | 5 #ifndef CLOUD_PRINT_SERVICE_CHROME_LAUNCHER_H_ |
6 #define CLOUD_PRINT_SERVICE_CHROME_LAUNCHER_H_ | 6 #define CLOUD_PRINT_SERVICE_CHROME_LAUNCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/threading/simple_thread.h" | 14 #include "base/threading/simple_thread.h" |
15 | 15 |
16 class CommandLine; | |
17 | |
18 class ChromeLauncher : public base::DelegateSimpleThread::Delegate { | 16 class ChromeLauncher : public base::DelegateSimpleThread::Delegate { |
19 public: | 17 public: |
20 explicit ChromeLauncher(const base::FilePath& user_data); | 18 explicit ChromeLauncher(const base::FilePath& user_data); |
21 | 19 |
22 virtual ~ChromeLauncher(); | 20 virtual ~ChromeLauncher(); |
23 | 21 |
24 bool Start(); | 22 bool Start(); |
25 void Stop(); | 23 void Stop(); |
26 | 24 |
27 virtual void Run() OVERRIDE; | 25 virtual void Run() OVERRIDE; |
28 | 26 |
29 static std::string CreateServiceStateFile( | 27 static std::string CreateServiceStateFile( |
30 const std::string& proxy_id, | 28 const std::string& proxy_id, |
31 const std::vector<std::string>& printers); | 29 const std::vector<std::string>& printers); |
32 | 30 |
33 private: | 31 private: |
34 base::FilePath user_data_; | 32 base::FilePath user_data_; |
35 base::WaitableEvent stop_event_; | 33 base::WaitableEvent stop_event_; |
36 scoped_ptr<base::DelegateSimpleThread> thread_; | 34 scoped_ptr<base::DelegateSimpleThread> thread_; |
37 | 35 |
38 DISALLOW_COPY_AND_ASSIGN(ChromeLauncher); | 36 DISALLOW_COPY_AND_ASSIGN(ChromeLauncher); |
39 }; | 37 }; |
40 | 38 |
41 #endif // CLOUD_PRINT_SERVICE_CHROME_LAUNCHER_H_ | 39 #endif // CLOUD_PRINT_SERVICE_CHROME_LAUNCHER_H_ |
OLD | NEW |