Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Unified Diff: chrome/browser/service/service_process_control.cc

Issue 3450021: Cloud print proxy management UI. (Closed)
Patch Set: Fix nits. Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/service/service_process_control.cc
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index 05dc446256f4827c94ff5f1811e06d0d6c85d7de..c3c16d85440f2588879ee4c73c70ef06bcdeafd4 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -171,11 +171,11 @@ void ServiceProcessControl::OnProcessLaunched(Task* task) {
}
void ServiceProcessControl::OnMessageReceived(const IPC::Message& message) {
- if (!message_handler_)
- return;
-
- if (message.type() == ServiceHostMsg_GoodDay::ID)
- message_handler_->OnGoodDay();
+ IPC_BEGIN_MESSAGE_MAP(ServiceProcessControl, message)
+ IPC_MESSAGE_HANDLER(ServiceHostMsg_GoodDay, OnGoodDay)
+ IPC_MESSAGE_HANDLER(ServiceHostMsg_CloudPrintProxy_IsEnabled,
+ OnCloudPrintProxyIsEnabled)
+ IPC_END_MESSAGE_MAP()
}
void ServiceProcessControl::OnChannelConnected(int32 peer_pid) {
@@ -202,6 +202,22 @@ bool ServiceProcessControl::Send(IPC::Message* message) {
return channel_->Send(message);
}
+void ServiceProcessControl::OnGoodDay() {
+ if (!message_handler_)
+ return;
+
+ message_handler_->OnGoodDay();
+}
+
+void ServiceProcessControl::OnCloudPrintProxyIsEnabled(bool enabled,
+ std::string email) {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
+ if (cloud_print_status_callback_ != NULL) {
+ cloud_print_status_callback_->Run(enabled, email);
+ cloud_print_status_callback_.reset();
+ }
+}
+
bool ServiceProcessControl::SendHello() {
return Send(new ServiceMsg_Hello());
}
@@ -221,4 +237,11 @@ bool ServiceProcessControl::EnableRemotingWithTokens(
talk_token));
}
+bool ServiceProcessControl::GetCloudPrintProxyStatus(
+ Callback2<bool, std::string>::Type* cloud_print_status_callback) {
+ DCHECK(cloud_print_status_callback);
+ cloud_print_status_callback_.reset(cloud_print_status_callback);
+ return Send(new ServiceMsg_IsCloudPrintProxyEnabled);
+}
+
DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl);
« no previous file with comments | « chrome/browser/service/service_process_control.h ('k') | chrome/browser/views/options/advanced_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698