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 #include "chrome/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // If there are no enabled services or if there is an update available | 263 // If there are no enabled services or if there is an update available |
264 // we want to shutdown right away. Else we want to keep listening for | 264 // we want to shutdown right away. Else we want to keep listening for |
265 // new connections. | 265 // new connections. |
266 if (!enabled_services_ || update_available()) { | 266 if (!enabled_services_ || update_available()) { |
267 Shutdown(); | 267 Shutdown(); |
268 return false; | 268 return false; |
269 } | 269 } |
270 return true; | 270 return true; |
271 } | 271 } |
272 | 272 |
273 CloudPrintProxy* ServiceProcess::GetCloudPrintProxy() { | 273 cloud_print::CloudPrintProxy* ServiceProcess::GetCloudPrintProxy() { |
274 if (!cloud_print_proxy_.get()) { | 274 if (!cloud_print_proxy_.get()) { |
275 cloud_print_proxy_.reset(new CloudPrintProxy()); | 275 cloud_print_proxy_.reset(new cloud_print::CloudPrintProxy()); |
276 cloud_print_proxy_->Initialize(service_prefs_.get(), this); | 276 cloud_print_proxy_->Initialize(service_prefs_.get(), this); |
277 } | 277 } |
278 return cloud_print_proxy_.get(); | 278 return cloud_print_proxy_.get(); |
279 } | 279 } |
280 | 280 |
281 void ServiceProcess::OnCloudPrintProxyEnabled(bool persist_state) { | 281 void ServiceProcess::OnCloudPrintProxyEnabled(bool persist_state) { |
282 if (persist_state) { | 282 if (persist_state) { |
283 // Save the preference that we have enabled the cloud print proxy. | 283 // Save the preference that we have enabled the cloud print proxy. |
284 service_prefs_->SetBoolean(prefs::kCloudPrintProxyEnabled, true); | 284 service_prefs_->SetBoolean(prefs::kCloudPrintProxyEnabled, true); |
285 service_prefs_->WritePrefs(); | 285 service_prefs_->WritePrefs(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (enabled_services_ && !ipc_server_->is_client_connected()) { | 360 if (enabled_services_ && !ipc_server_->is_client_connected()) { |
361 GetCloudPrintProxy()->CheckCloudPrintProxyPolicy(); | 361 GetCloudPrintProxy()->CheckCloudPrintProxyPolicy(); |
362 } | 362 } |
363 ScheduleCloudPrintPolicyCheck(); | 363 ScheduleCloudPrintPolicyCheck(); |
364 } | 364 } |
365 | 365 |
366 ServiceProcess::~ServiceProcess() { | 366 ServiceProcess::~ServiceProcess() { |
367 Teardown(); | 367 Teardown(); |
368 g_service_process = NULL; | 368 g_service_process = NULL; |
369 } | 369 } |
OLD | NEW |