| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE_AP
I_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE_AP
I_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE_AP
I_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE_AP
I_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "chrome/browser/extensions/chrome_extension_function.h" | 11 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 namespace api { | 15 namespace api { |
| 16 namespace cloud_print_private { | 16 namespace cloud_print_private { |
| 17 | 17 |
| 18 struct UserSettings; | 18 struct UserSettings; |
| 19 | 19 |
| 20 } // namespace cloud_print_private | 20 } // namespace cloud_print_private |
| 21 } // namespace api | 21 } // namespace api |
| 22 | 22 |
| 23 | 23 |
| 24 // For use only in tests. | 24 // For use only in tests. |
| 25 class CloudPrintTestsDelegate { | 25 class CloudPrintTestsDelegate { |
| 26 public: | 26 public: |
| 27 static CloudPrintTestsDelegate* Get(); |
| 28 |
| 27 CloudPrintTestsDelegate(); | 29 CloudPrintTestsDelegate(); |
| 28 virtual ~CloudPrintTestsDelegate(); | 30 virtual ~CloudPrintTestsDelegate(); |
| 29 | 31 |
| 30 virtual void SetupConnector( | 32 virtual void SetupConnector( |
| 31 const std::string& user_email, | 33 const std::string& user_email, |
| 32 const std::string& robot_email, | 34 const std::string& robot_email, |
| 33 const std::string& credentials, | 35 const std::string& credentials, |
| 34 const api::cloud_print_private::UserSettings& user_settings) = 0; | 36 const api::cloud_print_private::UserSettings& user_settings) = 0; |
| 35 | 37 |
| 36 virtual std::string GetHostName() = 0; | 38 virtual std::string GetHostName() = 0; |
| 37 | 39 |
| 38 virtual std::string GetClientId() = 0; | 40 virtual std::string GetClientId() = 0; |
| 39 | 41 |
| 40 virtual std::vector<std::string> GetPrinters() = 0; | 42 virtual std::vector<std::string> GetPrinters() = 0; |
| 41 | |
| 42 static CloudPrintTestsDelegate* instance(); | |
| 43 | |
| 44 private: | |
| 45 // Points to single instance of this class during testing. | |
| 46 static CloudPrintTestsDelegate* instance_; | |
| 47 }; | 43 }; |
| 48 | 44 |
| 49 class CloudPrintPrivateSetupConnectorFunction | 45 class CloudPrintPrivateSetupConnectorFunction |
| 50 : public ChromeAsyncExtensionFunction { | 46 : public ChromeAsyncExtensionFunction { |
| 51 public: | 47 public: |
| 52 DECLARE_EXTENSION_FUNCTION("cloudPrintPrivate.setupConnector", | 48 DECLARE_EXTENSION_FUNCTION("cloudPrintPrivate.setupConnector", |
| 53 CLOUDPRINTPRIVATE_SETUPCONNECTOR) | 49 CLOUDPRINTPRIVATE_SETUPCONNECTOR) |
| 54 | 50 |
| 55 CloudPrintPrivateSetupConnectorFunction(); | 51 CloudPrintPrivateSetupConnectorFunction(); |
| 56 | 52 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 protected: | 101 protected: |
| 106 ~CloudPrintPrivateGetClientIdFunction() override; | 102 ~CloudPrintPrivateGetClientIdFunction() override; |
| 107 | 103 |
| 108 // ExtensionFunction: | 104 // ExtensionFunction: |
| 109 bool RunAsync() override; | 105 bool RunAsync() override; |
| 110 }; | 106 }; |
| 111 | 107 |
| 112 } // namespace extensions | 108 } // namespace extensions |
| 113 | 109 |
| 114 #endif // CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE
_API_H_ | 110 #endif // CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE
_API_H_ |
| OLD | NEW |