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 #ifndef CHROME_BROWSER_SERVICE_SERVICE_PROCESS_CONTROL_H_ | 5 #ifndef CHROME_BROWSER_SERVICE_SERVICE_PROCESS_CONTROL_H_ |
6 #define CHROME_BROWSER_SERVICE_SERVICE_PROCESS_CONTROL_H_ | 6 #define CHROME_BROWSER_SERVICE_SERVICE_PROCESS_CONTROL_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 typedef IDMap<ServiceProcessControl>::iterator iterator; | 44 typedef IDMap<ServiceProcessControl>::iterator iterator; |
45 typedef std::queue<IPC::Message> MessageQueue; | 45 typedef std::queue<IPC::Message> MessageQueue; |
46 typedef base::Callback<void(const cloud_print::CloudPrintProxyInfo&)> | 46 typedef base::Callback<void(const cloud_print::CloudPrintProxyInfo&)> |
47 CloudPrintProxyInfoHandler; | 47 CloudPrintProxyInfoHandler; |
48 | 48 |
49 // Returns the singleton instance of this class. | 49 // Returns the singleton instance of this class. |
50 static ServiceProcessControl* GetInstance(); | 50 static ServiceProcessControl* GetInstance(); |
51 | 51 |
52 // Return true if this object is connected to the service. | 52 // Return true if this object is connected to the service. |
53 // Virtual for testing. | 53 // Virtual for testing. |
54 virtual bool is_connected() const; | 54 virtual bool IsConnected() const; |
55 | 55 |
56 // If no service process is currently running, creates a new service process | 56 // If no service process is currently running, creates a new service process |
57 // and connects to it. If a service process is already running this method | 57 // and connects to it. If a service process is already running this method |
58 // will try to connect to it. | 58 // will try to connect to it. |
59 // |success_task| is called when we have successfully launched the process | 59 // |success_task| is called when we have successfully launched the process |
60 // and connected to it. | 60 // and connected to it. |
61 // |failure_task| is called when we failed to connect to the service process. | 61 // |failure_task| is called when we failed to connect to the service process. |
62 // It is OK to pass the same value for |success_task| and |failure_task|. In | 62 // It is OK to pass the same value for |success_task| and |failure_task|. In |
63 // this case, the task is invoked on success or failure. | 63 // this case, the task is invoked on success or failure. |
64 // Note that if we are already connected to service process then | 64 // Note that if we are already connected to service process then |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 TaskList connect_failure_tasks_; | 161 TaskList connect_failure_tasks_; |
162 | 162 |
163 // Callback that gets invoked when a status message is received from | 163 // Callback that gets invoked when a status message is received from |
164 // the cloud print proxy. | 164 // the cloud print proxy. |
165 CloudPrintProxyInfoHandler cloud_print_info_callback_; | 165 CloudPrintProxyInfoHandler cloud_print_info_callback_; |
166 | 166 |
167 content::NotificationRegistrar registrar_; | 167 content::NotificationRegistrar registrar_; |
168 }; | 168 }; |
169 | 169 |
170 #endif // CHROME_BROWSER_SERVICE_SERVICE_PROCESS_CONTROL_H_ | 170 #endif // CHROME_BROWSER_SERVICE_SERVICE_PROCESS_CONTROL_H_ |
OLD | NEW |