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/service/cloud_print/cloud_print_proxy_backend.h" | 5 #include "chrome/service/cloud_print/cloud_print_proxy_backend.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/cloud_print/cloud_print_constants.h" |
17 #include "chrome/service/cloud_print/cloud_print_auth.h" | 18 #include "chrome/service/cloud_print/cloud_print_auth.h" |
18 #include "chrome/service/cloud_print/cloud_print_connector.h" | 19 #include "chrome/service/cloud_print/cloud_print_connector.h" |
19 #include "chrome/service/cloud_print/cloud_print_consts.h" | |
20 #include "chrome/service/cloud_print/cloud_print_helpers.h" | 20 #include "chrome/service/cloud_print/cloud_print_helpers.h" |
21 #include "chrome/service/cloud_print/cloud_print_token_store.h" | 21 #include "chrome/service/cloud_print/cloud_print_token_store.h" |
22 #include "chrome/service/cloud_print/connector_settings.h" | 22 #include "chrome/service/cloud_print/connector_settings.h" |
23 #include "chrome/service/gaia/service_gaia_authenticator.h" | 23 #include "chrome/service/gaia/service_gaia_authenticator.h" |
24 #include "chrome/service/net/service_url_request_context.h" | 24 #include "chrome/service/net/service_url_request_context.h" |
25 #include "chrome/service/service_process.h" | 25 #include "chrome/service/service_process.h" |
26 #include "google_apis/gaia/gaia_oauth_client.h" | 26 #include "google_apis/gaia/gaia_oauth_client.h" |
27 #include "google_apis/gaia/gaia_urls.h" | 27 #include "google_apis/gaia/gaia_urls.h" |
28 #include "googleurl/src/gurl.h" | 28 #include "googleurl/src/gurl.h" |
29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
30 #include "jingle/notifier/base/notifier_options.h" | 30 #include "jingle/notifier/base/notifier_options.h" |
31 #include "jingle/notifier/listener/push_client.h" | 31 #include "jingle/notifier/listener/push_client.h" |
32 #include "jingle/notifier/listener/push_client_observer.h" | 32 #include "jingle/notifier/listener/push_client_observer.h" |
33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
34 | 34 |
| 35 namespace cloud_print { |
| 36 |
35 // The real guts of CloudPrintProxyBackend, to keep the public client API clean. | 37 // The real guts of CloudPrintProxyBackend, to keep the public client API clean. |
36 class CloudPrintProxyBackend::Core | 38 class CloudPrintProxyBackend::Core |
37 : public base::RefCountedThreadSafe<CloudPrintProxyBackend::Core>, | 39 : public base::RefCountedThreadSafe<CloudPrintProxyBackend::Core>, |
38 public CloudPrintAuth::Client, | 40 public CloudPrintAuth::Client, |
39 public CloudPrintConnector::Client, | 41 public CloudPrintConnector::Client, |
40 public notifier::PushClientObserver { | 42 public notifier::PushClientObserver { |
41 public: | 43 public: |
42 // It is OK for print_server_url to be empty. In this case system should | 44 // It is OK for print_server_url to be empty. In this case system should |
43 // use system default (local) print server. | 45 // use system default (local) print server. |
44 Core(CloudPrintProxyBackend* backend, | 46 Core(CloudPrintProxyBackend* backend, |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 if (0 == base::strcasecmp(kCloudPrintPushNotificationsSource, | 571 if (0 == base::strcasecmp(kCloudPrintPushNotificationsSource, |
570 notification.channel.c_str())) | 572 notification.channel.c_str())) |
571 HandlePrinterNotification(notification.data); | 573 HandlePrinterNotification(notification.data); |
572 } | 574 } |
573 | 575 |
574 void CloudPrintProxyBackend::Core::OnPingResponse() { | 576 void CloudPrintProxyBackend::Core::OnPingResponse() { |
575 pending_xmpp_pings_ = 0; | 577 pending_xmpp_pings_ = 0; |
576 VLOG(1) << "CP_CONNECTOR: Ping response received."; | 578 VLOG(1) << "CP_CONNECTOR: Ping response received."; |
577 } | 579 } |
578 | 580 |
| 581 } // namespace cloud_print |
OLD | NEW |