| 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/extensions/api/cloud_print_private/cloud_print_private_
api.h" | 5 #include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_
api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" |
| 9 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 11 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 11 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 12 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
| 12 #include "chrome/common/extensions/api/cloud_print_private.h" | 13 #include "chrome/common/extensions/api/cloud_print_private.h" |
| 13 #include "google_apis/google_api_keys.h" | 14 #include "google_apis/google_api_keys.h" |
| 14 #include "net/base/network_interfaces.h" | 15 #include "net/base/network_interfaces.h" |
| 15 | 16 |
| 16 namespace extensions { | 17 namespace extensions { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #endif | 73 #endif |
| 73 } | 74 } |
| 74 | 75 |
| 75 CloudPrintPrivateGetHostNameFunction::CloudPrintPrivateGetHostNameFunction() { | 76 CloudPrintPrivateGetHostNameFunction::CloudPrintPrivateGetHostNameFunction() { |
| 76 } | 77 } |
| 77 | 78 |
| 78 CloudPrintPrivateGetHostNameFunction::~CloudPrintPrivateGetHostNameFunction() { | 79 CloudPrintPrivateGetHostNameFunction::~CloudPrintPrivateGetHostNameFunction() { |
| 79 } | 80 } |
| 80 | 81 |
| 81 bool CloudPrintPrivateGetHostNameFunction::RunAsync() { | 82 bool CloudPrintPrivateGetHostNameFunction::RunAsync() { |
| 82 SetResult( | 83 SetResult(base::MakeUnique<base::StringValue>( |
| 83 new base::StringValue(CloudPrintTestsDelegate::Get() | 84 CloudPrintTestsDelegate::Get() |
| 84 ? CloudPrintTestsDelegate::Get()->GetHostName() | 85 ? CloudPrintTestsDelegate::Get()->GetHostName() |
| 85 : net::GetHostName())); | 86 : net::GetHostName())); |
| 86 SendResponse(true); | 87 SendResponse(true); |
| 87 return true; | 88 return true; |
| 88 } | 89 } |
| 89 | 90 |
| 90 CloudPrintPrivateGetPrintersFunction::CloudPrintPrivateGetPrintersFunction() { | 91 CloudPrintPrivateGetPrintersFunction::CloudPrintPrivateGetPrintersFunction() { |
| 91 } | 92 } |
| 92 | 93 |
| 93 CloudPrintPrivateGetPrintersFunction::~CloudPrintPrivateGetPrintersFunction() { | 94 CloudPrintPrivateGetPrintersFunction::~CloudPrintPrivateGetPrintersFunction() { |
| 94 } | 95 } |
| 95 | 96 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 120 } | 121 } |
| 121 | 122 |
| 122 | 123 |
| 123 CloudPrintPrivateGetClientIdFunction::CloudPrintPrivateGetClientIdFunction() { | 124 CloudPrintPrivateGetClientIdFunction::CloudPrintPrivateGetClientIdFunction() { |
| 124 } | 125 } |
| 125 | 126 |
| 126 CloudPrintPrivateGetClientIdFunction::~CloudPrintPrivateGetClientIdFunction() { | 127 CloudPrintPrivateGetClientIdFunction::~CloudPrintPrivateGetClientIdFunction() { |
| 127 } | 128 } |
| 128 | 129 |
| 129 bool CloudPrintPrivateGetClientIdFunction::RunAsync() { | 130 bool CloudPrintPrivateGetClientIdFunction::RunAsync() { |
| 130 SetResult(new base::StringValue( | 131 SetResult(base::MakeUnique<base::StringValue>( |
| 131 CloudPrintTestsDelegate::Get() | 132 CloudPrintTestsDelegate::Get() |
| 132 ? CloudPrintTestsDelegate::Get()->GetClientId() | 133 ? CloudPrintTestsDelegate::Get()->GetClientId() |
| 133 : google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT))); | 134 : google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT))); |
| 134 SendResponse(true); | 135 SendResponse(true); |
| 135 return true; | 136 return true; |
| 136 } | 137 } |
| 137 | 138 |
| 138 } // namespace extensions | 139 } // namespace extensions |
| OLD | NEW |