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 CHROME_SERVICE_SERVICE_IPC_SERVER_H_ | 5 #ifndef CHROME_SERVICE_SERVICE_IPC_SERVER_H_ |
6 #define CHROME_SERVICE_SERVICE_IPC_SERVER_H_ | 6 #define CHROME_SERVICE_SERVICE_IPC_SERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 | 10 |
10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
11 #include "ipc/ipc_channel_handle.h" | 12 #include "ipc/ipc_channel_handle.h" |
12 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
13 #include "ipc/ipc_sync_channel.h" | 14 #include "ipc/ipc_sync_channel.h" |
14 #include "ipc/ipc_sync_message_filter.h" | 15 #include "ipc/ipc_sync_message_filter.h" |
15 #include "ipc/ipc_sender.h" | 16 #include "ipc/ipc_sender.h" |
16 | 17 |
17 // This class handles IPC commands for the service process. | 18 // This class handles IPC commands for the service process. |
18 class ServiceIPCServer : public IPC::Listener, public IPC::Sender { | 19 class ServiceIPCServer : public IPC::Listener, public IPC::Sender { |
(...skipping 21 matching lines...) Expand all Loading... |
40 // IPC::Listener implementation. | 41 // IPC::Listener implementation. |
41 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 42 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
42 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 43 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
43 virtual void OnChannelError() OVERRIDE; | 44 virtual void OnChannelError() OVERRIDE; |
44 | 45 |
45 // IPC message handlers. | 46 // IPC message handlers. |
46 void OnEnableCloudPrintProxy(const std::string& lsid); | 47 void OnEnableCloudPrintProxy(const std::string& lsid); |
47 void OnEnableCloudPrintProxyWithRobot( | 48 void OnEnableCloudPrintProxyWithRobot( |
48 const std::string& robot_auth_code, | 49 const std::string& robot_auth_code, |
49 const std::string& robot_email, | 50 const std::string& robot_email, |
50 const std::string& user_email); | 51 const std::string& user_email, |
| 52 bool connect_new_printers, |
| 53 const std::vector<std::string>& printer_blacklist); |
51 void OnGetCloudPrintProxyInfo(); | 54 void OnGetCloudPrintProxyInfo(); |
52 void OnDisableCloudPrintProxy(); | 55 void OnDisableCloudPrintProxy(); |
53 void OnEnableVirtualDriver(); | 56 void OnEnableVirtualDriver(); |
54 void OnDisableVirtualDriver(); | 57 void OnDisableVirtualDriver(); |
55 | 58 |
56 void OnShutdown(); | 59 void OnShutdown(); |
57 void OnUpdateAvailable(); | 60 void OnUpdateAvailable(); |
58 | 61 |
59 // Helper method to create the sync channel. | 62 // Helper method to create the sync channel. |
60 void CreateChannel(); | 63 void CreateChannel(); |
61 | 64 |
62 IPC::ChannelHandle channel_handle_; | 65 IPC::ChannelHandle channel_handle_; |
63 scoped_ptr<IPC::SyncChannel> channel_; | 66 scoped_ptr<IPC::SyncChannel> channel_; |
64 // Indicates whether a client is currently connected to the channel. | 67 // Indicates whether a client is currently connected to the channel. |
65 bool client_connected_; | 68 bool client_connected_; |
66 | 69 |
67 // Allows threads other than the main thread to send sync messages. | 70 // Allows threads other than the main thread to send sync messages. |
68 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 71 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
69 | 72 |
70 | 73 |
71 DISALLOW_COPY_AND_ASSIGN(ServiceIPCServer); | 74 DISALLOW_COPY_AND_ASSIGN(ServiceIPCServer); |
72 }; | 75 }; |
73 | 76 |
74 #endif // CHROME_SERVICE_SERVICE_IPC_SERVER_H_ | 77 #endif // CHROME_SERVICE_SERVICE_IPC_SERVER_H_ |
OLD | NEW |