| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/service/service_process_control.h" | 5 #include "chrome/browser/service/service_process_control.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // TODO(hclam): Handle error connecting to channel. | 122 // TODO(hclam): Handle error connecting to channel. |
| 123 const std::string channel_id = GetServiceProcessChannelName(); | 123 const std::string channel_id = GetServiceProcessChannelName(); |
| 124 channel_.reset( | 124 channel_.reset( |
| 125 new IPC::SyncChannel(channel_id, IPC::Channel::MODE_CLIENT, this, | 125 new IPC::SyncChannel(channel_id, IPC::Channel::MODE_CLIENT, this, |
| 126 io_thread->message_loop(), true, | 126 io_thread->message_loop(), true, |
| 127 g_browser_process->shutdown_event())); | 127 g_browser_process->shutdown_event())); |
| 128 channel_->set_sync_messages_with_no_timeout_allowed(false); | 128 channel_->set_sync_messages_with_no_timeout_allowed(false); |
| 129 | 129 |
| 130 // We just established a channel with the service process. Notify it if an | 130 // We just established a channel with the service process. Notify it if an |
| 131 // upgrade is available. | 131 // upgrade is available. |
| 132 if (Singleton<UpgradeDetector>::get()->notify_upgrade()) { | 132 if (UpgradeDetector::GetInstance()->notify_upgrade()) { |
| 133 Send(new ServiceMsg_UpdateAvailable); | 133 Send(new ServiceMsg_UpdateAvailable); |
| 134 } else { | 134 } else { |
| 135 if (registrar_.IsEmpty()) | 135 if (registrar_.IsEmpty()) |
| 136 registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED, | 136 registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED, |
| 137 NotificationService::AllSources()); | 137 NotificationService::AllSources()); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ServiceProcessControl::RunConnectDoneTasks() { | 141 void ServiceProcessControl::RunConnectDoneTasks() { |
| 142 RunAllTasksHelper(&connect_done_tasks_); | 142 RunAllTasksHelper(&connect_done_tasks_); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 310 } |
| 311 | 311 |
| 312 bool ServiceProcessControl::GetCloudPrintProxyStatus( | 312 bool ServiceProcessControl::GetCloudPrintProxyStatus( |
| 313 Callback2<bool, std::string>::Type* cloud_print_status_callback) { | 313 Callback2<bool, std::string>::Type* cloud_print_status_callback) { |
| 314 DCHECK(cloud_print_status_callback); | 314 DCHECK(cloud_print_status_callback); |
| 315 cloud_print_status_callback_.reset(cloud_print_status_callback); | 315 cloud_print_status_callback_.reset(cloud_print_status_callback); |
| 316 return Send(new ServiceMsg_IsCloudPrintProxyEnabled); | 316 return Send(new ServiceMsg_IsCloudPrintProxyEnabled); |
| 317 } | 317 } |
| 318 | 318 |
| 319 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); | 319 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); |
| OLD | NEW |