| 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/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 10 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 11 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 11 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
| 12 #include "chrome/common/extensions/api/cloud_print_private.h" | 12 #include "chrome/common/extensions/api/cloud_print_private.h" |
| 13 #include "google_apis/google_api_keys.h" | 13 #include "google_apis/google_api_keys.h" |
| 14 #include "net/base/network_interfaces.h" | 14 #include "net/base/network_interfaces.h" |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 #if defined(ENABLE_PRINT_PREVIEW) |
| 20 const char kErrorIncognito[] = "Cannot access in incognito mode"; | 21 const char kErrorIncognito[] = "Cannot access in incognito mode"; |
| 22 #endif |
| 21 | 23 |
| 22 CloudPrintTestsDelegate* g_instance = nullptr; | 24 CloudPrintTestsDelegate* g_instance = nullptr; |
| 23 | 25 |
| 24 } // namespace | 26 } // namespace |
| 25 | 27 |
| 26 CloudPrintTestsDelegate* CloudPrintTestsDelegate::Get() { | 28 CloudPrintTestsDelegate* CloudPrintTestsDelegate::Get() { |
| 27 return g_instance; | 29 return g_instance; |
| 28 } | 30 } |
| 29 | 31 |
| 30 CloudPrintTestsDelegate::CloudPrintTestsDelegate() { | 32 CloudPrintTestsDelegate::CloudPrintTestsDelegate() { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 bool CloudPrintPrivateGetClientIdFunction::RunAsync() { | 129 bool CloudPrintPrivateGetClientIdFunction::RunAsync() { |
| 128 SetResult(new base::StringValue( | 130 SetResult(new base::StringValue( |
| 129 CloudPrintTestsDelegate::Get() | 131 CloudPrintTestsDelegate::Get() |
| 130 ? CloudPrintTestsDelegate::Get()->GetClientId() | 132 ? CloudPrintTestsDelegate::Get()->GetClientId() |
| 131 : google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT))); | 133 : google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT))); |
| 132 SendResponse(true); | 134 SendResponse(true); |
| 133 return true; | 135 return true; |
| 134 } | 136 } |
| 135 | 137 |
| 136 } // namespace extensions | 138 } // namespace extensions |
| OLD | NEW |