| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 using content::BrowserThread; | 31 using content::BrowserThread; |
| 32 | 32 |
| 33 class CloudPrintProxyService::TokenExpiredNotificationDelegate | 33 class CloudPrintProxyService::TokenExpiredNotificationDelegate |
| 34 : public NotificationDelegate { | 34 : public NotificationDelegate { |
| 35 public: | 35 public: |
| 36 explicit TokenExpiredNotificationDelegate( | 36 explicit TokenExpiredNotificationDelegate( |
| 37 CloudPrintProxyService* cloud_print_service) | 37 CloudPrintProxyService* cloud_print_service) |
| 38 : cloud_print_service_(cloud_print_service) { | 38 : cloud_print_service_(cloud_print_service) { |
| 39 } | 39 } |
| 40 |
| 40 void Display() {} | 41 void Display() {} |
| 42 |
| 41 void Error() { | 43 void Error() { |
| 42 cloud_print_service_->OnTokenExpiredNotificationError(); | 44 cloud_print_service_->OnTokenExpiredNotificationError(); |
| 43 } | 45 } |
| 46 |
| 44 void Close(bool by_user) { | 47 void Close(bool by_user) { |
| 45 cloud_print_service_->OnTokenExpiredNotificationClosed(by_user); | 48 cloud_print_service_->OnTokenExpiredNotificationClosed(by_user); |
| 46 } | 49 } |
| 50 |
| 47 void Click() { | 51 void Click() { |
| 48 cloud_print_service_->OnTokenExpiredNotificationClick(); | 52 cloud_print_service_->OnTokenExpiredNotificationClick(); |
| 49 } | 53 } |
| 54 |
| 50 std::string id() const { return "cloudprint.tokenexpired"; } | 55 std::string id() const { return "cloudprint.tokenexpired"; } |
| 51 | 56 |
| 52 private: | 57 private: |
| 58 virtual ~TokenExpiredNotificationDelegate() {} |
| 59 |
| 53 CloudPrintProxyService* cloud_print_service_; | 60 CloudPrintProxyService* cloud_print_service_; |
| 54 DISALLOW_COPY_AND_ASSIGN(TokenExpiredNotificationDelegate); | 61 DISALLOW_COPY_AND_ASSIGN(TokenExpiredNotificationDelegate); |
| 55 }; | 62 }; |
| 56 | 63 |
| 57 CloudPrintProxyService::CloudPrintProxyService(Profile* profile) | 64 CloudPrintProxyService::CloudPrintProxyService(Profile* profile) |
| 58 : profile_(profile), | 65 : profile_(profile), |
| 59 token_expired_delegate_(NULL), | 66 token_expired_delegate_(NULL), |
| 60 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 67 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
| 61 enforcing_connector_policy_(false) { | 68 enforcing_connector_policy_(false) { |
| 62 } | 69 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 263 } |
| 257 | 264 |
| 258 bool CloudPrintProxyService::InvokeServiceTask(const base::Closure& task) { | 265 bool CloudPrintProxyService::InvokeServiceTask(const base::Closure& task) { |
| 259 GetServiceProcessControl()->Launch(task, base::Closure()); | 266 GetServiceProcessControl()->Launch(task, base::Closure()); |
| 260 return true; | 267 return true; |
| 261 } | 268 } |
| 262 | 269 |
| 263 ServiceProcessControl* CloudPrintProxyService::GetServiceProcessControl() { | 270 ServiceProcessControl* CloudPrintProxyService::GetServiceProcessControl() { |
| 264 return ServiceProcessControl::GetInstance(); | 271 return ServiceProcessControl::GetInstance(); |
| 265 } | 272 } |
| OLD | NEW |