| 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/printing/cloud_print/cloud_print_proxy_service.h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 return true; | 202 return true; |
| 203 } | 203 } |
| 204 | 204 |
| 205 void CloudPrintProxyService::OnCloudPrintSetupClosed() { | 205 void CloudPrintProxyService::OnCloudPrintSetupClosed() { |
| 206 MessageLoop::current()->PostTask( | 206 MessageLoop::current()->PostTask( |
| 207 FROM_HERE, base::Bind(&browser::EndKeepAlive)); | 207 FROM_HERE, base::Bind(&browser::EndKeepAlive)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void CloudPrintProxyService::Observe( | 210 void CloudPrintProxyService::OnPreferenceChanged(PrefServiceBase* service, |
| 211 int type, | 211 const std::string& pref_name) { |
| 212 const content::NotificationSource& source, | |
| 213 const content::NotificationDetails& details) { | |
| 214 DCHECK_EQ(chrome::NOTIFICATION_PREF_CHANGED, type); | |
| 215 ApplyCloudPrintConnectorPolicy(); | 212 ApplyCloudPrintConnectorPolicy(); |
| 216 } | 213 } |
| 217 | 214 |
| 218 void CloudPrintProxyService::RefreshCloudPrintProxyStatus() { | 215 void CloudPrintProxyService::RefreshCloudPrintProxyStatus() { |
| 219 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 216 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 220 ServiceProcessControl* process_control = GetServiceProcessControl(); | 217 ServiceProcessControl* process_control = GetServiceProcessControl(); |
| 221 DCHECK(process_control->IsConnected()); | 218 DCHECK(process_control->IsConnected()); |
| 222 ServiceProcessControl::CloudPrintProxyInfoHandler callback = | 219 ServiceProcessControl::CloudPrintProxyInfoHandler callback = |
| 223 base::Bind(&CloudPrintProxyService::ProxyInfoCallback, | 220 base::Bind(&CloudPrintProxyService::ProxyInfoCallback, |
| 224 base::Unretained(this)); | 221 base::Unretained(this)); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 266 } |
| 270 | 267 |
| 271 bool CloudPrintProxyService::InvokeServiceTask(const base::Closure& task) { | 268 bool CloudPrintProxyService::InvokeServiceTask(const base::Closure& task) { |
| 272 GetServiceProcessControl()->Launch(task, base::Closure()); | 269 GetServiceProcessControl()->Launch(task, base::Closure()); |
| 273 return true; | 270 return true; |
| 274 } | 271 } |
| 275 | 272 |
| 276 ServiceProcessControl* CloudPrintProxyService::GetServiceProcessControl() { | 273 ServiceProcessControl* CloudPrintProxyService::GetServiceProcessControl() { |
| 277 return ServiceProcessControl::GetInstance(); | 274 return ServiceProcessControl::GetInstance(); |
| 278 } | 275 } |
| OLD | NEW |