| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_BACKEND_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_BACKEND_H_ |
| 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_BACKEND_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_BACKEND_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
| 12 #include "printing/backend/print_backend.h" | 12 #include "printing/backend/print_backend.h" |
| 13 | 13 |
| 14 class CloudPrintProxyService; | 14 class CloudPrintProxyService; |
| 15 class GURL; | 15 class GURL; |
| 16 |
| 17 namespace base { |
| 16 class DictionaryValue; | 18 class DictionaryValue; |
| 19 } |
| 17 | 20 |
| 18 namespace gaia { | 21 namespace gaia { |
| 19 struct OAuthClientInfo; | 22 struct OAuthClientInfo; |
| 20 } | 23 } |
| 21 | 24 |
| 22 // CloudPrintProxyFrontend is the interface used by CloudPrintProxyBackend to | 25 // CloudPrintProxyFrontend is the interface used by CloudPrintProxyBackend to |
| 23 // communicate with the entity that created it and, presumably, is interested in | 26 // communicate with the entity that created it and, presumably, is interested in |
| 24 // cloud print proxy related activity. | 27 // cloud print proxy related activity. |
| 25 // NOTE: All methods will be invoked by a CloudPrintProxyBackend on the same | 28 // NOTE: All methods will be invoked by a CloudPrintProxyBackend on the same |
| 26 // thread used to create that CloudPrintProxyBackend. | 29 // thread used to create that CloudPrintProxyBackend. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxyFrontend); | 52 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxyFrontend); |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 class CloudPrintProxyBackend { | 55 class CloudPrintProxyBackend { |
| 53 public: | 56 public: |
| 54 // It is OK for print_system_settings to be NULL. In this case system should | 57 // It is OK for print_system_settings to be NULL. In this case system should |
| 55 // use system default settings. | 58 // use system default settings. |
| 56 CloudPrintProxyBackend( | 59 CloudPrintProxyBackend( |
| 57 CloudPrintProxyFrontend* frontend, | 60 CloudPrintProxyFrontend* frontend, |
| 58 const GURL& cloud_print_server_url, | 61 const GURL& cloud_print_server_url, |
| 59 const DictionaryValue* print_sys_settings, | 62 const base::DictionaryValue* print_sys_settings, |
| 60 const gaia::OAuthClientInfo& oauth_client_info, | 63 const gaia::OAuthClientInfo& oauth_client_info, |
| 61 bool enable_job_poll); | 64 bool enable_job_poll); |
| 62 ~CloudPrintProxyBackend(); | 65 ~CloudPrintProxyBackend(); |
| 63 | 66 |
| 64 // Called when the user enables Google Cloud Print. | 67 // Called when the user enables Google Cloud Print. |
| 65 // |last_robot_refresh_token|, |last_robot_email| and |last_user_email| are | 68 // |last_robot_refresh_token|, |last_robot_email| and |last_user_email| are |
| 66 // the previously persisted credentials if any. We will use this is the passed | 69 // the previously persisted credentials if any. We will use this is the passed |
| 67 // in LSID belongs to the same user as |last_user_email|. | 70 // in LSID belongs to the same user as |last_user_email|. |
| 68 bool InitializeWithLsid(const std::string& lsid, | 71 bool InitializeWithLsid(const std::string& lsid, |
| 69 const std::string& proxy_id, | 72 const std::string& proxy_id, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 99 MessageLoop* const frontend_loop_; | 102 MessageLoop* const frontend_loop_; |
| 100 // The frontend which is responsible for displaying UI and updating Prefs | 103 // The frontend which is responsible for displaying UI and updating Prefs |
| 101 CloudPrintProxyFrontend* frontend_; | 104 CloudPrintProxyFrontend* frontend_; |
| 102 | 105 |
| 103 friend class base::RefCountedThreadSafe<CloudPrintProxyBackend::Core>; | 106 friend class base::RefCountedThreadSafe<CloudPrintProxyBackend::Core>; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxyBackend); | 108 DISALLOW_COPY_AND_ASSIGN(CloudPrintProxyBackend); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_BACKEND_H_ | 111 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_PROXY_BACKEND_H_ |
| OLD | NEW |