| 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/browser/service_process/service_process_control.h" | 5 #include "chrome/browser/service_process/service_process_control.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 if (!channel_.get()) | 197 if (!channel_.get()) |
| 198 return false; | 198 return false; |
| 199 return channel_->Send(message); | 199 return channel_->Send(message); |
| 200 } | 200 } |
| 201 | 201 |
| 202 // content::NotificationObserver implementation. | 202 // content::NotificationObserver implementation. |
| 203 void ServiceProcessControl::Observe( | 203 void ServiceProcessControl::Observe( |
| 204 int type, | 204 int type, |
| 205 const content::NotificationSource& source, | 205 const content::NotificationSource& source, |
| 206 const content::NotificationDetails& details) { | 206 const content::NotificationDetails& details) { |
| 207 if (type == chrome::NOTIFICATION_UPGRADE_RECOMMENDED) { | 207 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type); |
| 208 Send(new ServiceMsg_UpdateAvailable); | 208 Send(new ServiceMsg_UpdateAvailable); |
| 209 } | |
| 210 } | 209 } |
| 211 | 210 |
| 212 void ServiceProcessControl::OnCloudPrintProxyInfo( | 211 void ServiceProcessControl::OnCloudPrintProxyInfo( |
| 213 const cloud_print::CloudPrintProxyInfo& proxy_info) { | 212 const cloud_print::CloudPrintProxyInfo& proxy_info) { |
| 214 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 213 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 215 UMA_HISTOGRAM_ENUMERATION("CloudPrint.ServiceEvents", | 214 UMA_HISTOGRAM_ENUMERATION("CloudPrint.ServiceEvents", |
| 216 SERVICE_EVENT_INFO_REPLY, SERVICE_EVENT_MAX); | 215 SERVICE_EVENT_INFO_REPLY, SERVICE_EVENT_MAX); |
| 217 if (!cloud_print_info_callback_.is_null()) { | 216 if (!cloud_print_info_callback_.is_null()) { |
| 218 cloud_print_info_callback_.Run(proxy_info); | 217 cloud_print_info_callback_.Run(proxy_info); |
| 219 cloud_print_info_callback_.Reset(); | 218 cloud_print_info_callback_.Reset(); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 if (process_.IsValid()) { | 383 if (process_.IsValid()) { |
| 385 BrowserThread::PostTask( | 384 BrowserThread::PostTask( |
| 386 BrowserThread::IO, FROM_HERE, | 385 BrowserThread::IO, FROM_HERE, |
| 387 base::Bind(&Launcher::DoDetectLaunched, this)); | 386 base::Bind(&Launcher::DoDetectLaunched, this)); |
| 388 } else { | 387 } else { |
| 389 BrowserThread::PostTask( | 388 BrowserThread::PostTask( |
| 390 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); | 389 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); |
| 391 } | 390 } |
| 392 } | 391 } |
| 393 #endif // !OS_MACOSX | 392 #endif // !OS_MACOSX |
| OLD | NEW |