| Index: chrome/browser/service_process/service_process_control.h
|
| diff --git a/chrome/browser/service_process/service_process_control.h b/chrome/browser/service_process/service_process_control.h
|
| index eedd4a3fd074b2cb328d144fb396be6c376db85b..9db9324f84376196af2e8d97ffbde3b086307219 100644
|
| --- a/chrome/browser/service_process/service_process_control.h
|
| +++ b/chrome/browser/service_process/service_process_control.h
|
| @@ -60,13 +60,17 @@ class ServiceProcessControl : public IPC::Sender,
|
| SERVICE_EVENT_INFO_REPLY,
|
| SERVICE_EVENT_HISTOGRAMS_REQUEST,
|
| SERVICE_EVENT_HISTOGRAMS_REPLY,
|
| + SERVICE_PRINTERS_REQUEST,
|
| + SERVICE_PRINTERS_REPLY,
|
| SERVICE_EVENT_MAX,
|
| };
|
|
|
| typedef IDMap<ServiceProcessControl>::iterator iterator;
|
| typedef std::queue<IPC::Message> MessageQueue;
|
| typedef base::Callback<void(const cloud_print::CloudPrintProxyInfo&)>
|
| - CloudPrintProxyInfoHandler;
|
| + CloudPrintProxyInfoCallback;
|
| + typedef base::Callback<void(const std::vector<std::string>&)>
|
| + PrintersCallback;
|
|
|
| // Returns the singleton instance of this class.
|
| static ServiceProcessControl* GetInstance();
|
| @@ -118,7 +122,7 @@ class ServiceProcessControl : public IPC::Sender,
|
| // reply from service. The method resets any previous callback.
|
| // This call starts service if needed.
|
| bool GetCloudPrintProxyInfo(
|
| - const CloudPrintProxyInfoHandler& cloud_print_status_callback);
|
| + const CloudPrintProxyInfoCallback& cloud_print_status_callback);
|
|
|
| // Send request for histograms collected in service process.
|
| // Returns true if request was sent, and callback will be called in case of
|
| @@ -128,6 +132,13 @@ class ServiceProcessControl : public IPC::Sender,
|
| bool GetHistograms(const base::Closure& cloud_print_status_callback,
|
| const base::TimeDelta& timeout);
|
|
|
| + // Send request for printers available for cloud print proxy.
|
| + // The callback gets the information when received.
|
| + // Returns true if request was sent. Callback will be called only in case of
|
| + // reply from service. The method resets any previous callback.
|
| + // This call starts service if needed.
|
| + bool GetPrinters(const PrintersCallback& enumerate_printers_callback);
|
| +
|
| private:
|
| // This class is responsible for launching the service process on the
|
| // PROCESS_LAUNCHER thread.
|
| @@ -175,6 +186,7 @@ class ServiceProcessControl : public IPC::Sender,
|
| void OnCloudPrintProxyInfo(
|
| const cloud_print::CloudPrintProxyInfo& proxy_info);
|
| void OnHistograms(const std::vector<std::string>& pickled_histograms);
|
| + void OnPrinters(const std::vector<std::string>& printers);
|
|
|
| // Runs callback provided in |GetHistograms()|.
|
| void RunHistogramsCallback();
|
| @@ -204,9 +216,13 @@ class ServiceProcessControl : public IPC::Sender,
|
| // Callbacks that get invoked when there was a connection failure.
|
| TaskList connect_failure_tasks_;
|
|
|
| + // Callback that gets invoked when a printers is received from
|
| + // the cloud print proxy.
|
| + PrintersCallback printers_callback_;
|
| +
|
| // Callback that gets invoked when a status message is received from
|
| // the cloud print proxy.
|
| - CloudPrintProxyInfoHandler cloud_print_info_callback_;
|
| + CloudPrintProxyInfoCallback cloud_print_info_callback_;
|
|
|
| // Callback that gets invoked when a message with histograms is received from
|
| // the service process.
|
|
|