OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // For when the page is ready to recieve device notifications. | 80 // For when the page is ready to recieve device notifications. |
81 void HandleStart(const base::ListValue* args); | 81 void HandleStart(const base::ListValue* args); |
82 | 82 |
83 // For when a visibility change occurs. | 83 // For when a visibility change occurs. |
84 void HandleIsVisible(const base::ListValue* args); | 84 void HandleIsVisible(const base::ListValue* args); |
85 | 85 |
86 // For when a user choice is made. | 86 // For when a user choice is made. |
87 void HandleChooseUser(const base::ListValue* args); | 87 void HandleChooseUser(const base::ListValue* args); |
88 | 88 |
| 89 // For when a cancelation is made. |
| 90 void HandleCancelRegistration(const base::ListValue* args); |
| 91 |
89 // For when the IP address of the printer has been resolved for registration. | 92 // For when the IP address of the printer has been resolved for registration. |
90 void StartRegisterHTTP( | 93 void StartRegisterHTTP( |
91 const std::string& user, | 94 const std::string& user, |
92 scoped_ptr<PrivetHTTPClient> http_client); | 95 scoped_ptr<PrivetHTTPClient> http_client); |
93 | 96 |
94 // For when the confirm operation on the cloudprint server has finished | 97 // For when the confirm operation on the cloudprint server has finished |
95 // executing. | 98 // executing. |
96 void OnConfirmDone(PrivetConfirmApiCallFlow::Status status); | 99 void OnConfirmDone(PrivetConfirmApiCallFlow::Status status); |
97 | 100 |
98 // For when the cloud print account list is resolved. | 101 // For when the cloud print account list is resolved. |
(...skipping 20 matching lines...) Expand all Loading... |
119 | 122 |
120 // Get the base cloud print URL for a given device. | 123 // Get the base cloud print URL for a given device. |
121 const std::string& GetCloudPrintBaseUrl(const std::string& device_name); | 124 const std::string& GetCloudPrintBaseUrl(const std::string& device_name); |
122 | 125 |
123 // Start the confirm flow for a cookie based authentication. | 126 // Start the confirm flow for a cookie based authentication. |
124 void StartCookieConfirmFlow( | 127 void StartCookieConfirmFlow( |
125 int user_index, | 128 int user_index, |
126 const std::string& xsrf_token, | 129 const std::string& xsrf_token, |
127 const GURL& automatic_claim_url); | 130 const GURL& automatic_claim_url); |
128 | 131 |
| 132 // Reset and cancel the current registration. |
| 133 void ResetCurrentRegistration(); |
| 134 |
129 // The current HTTP client (used for the current operation). | 135 // The current HTTP client (used for the current operation). |
130 scoped_ptr<PrivetHTTPClient> current_http_client_; | 136 scoped_ptr<PrivetHTTPClient> current_http_client_; |
131 | 137 |
132 // Device currently registering. | 138 // Device currently registering. |
133 std::string current_register_device_; | 139 std::string current_register_device_; |
134 | 140 |
135 // The current register operation. Only one allowed at any time. | 141 // The current register operation. Only one allowed at any time. |
136 scoped_ptr<PrivetRegisterOperation> current_register_operation_; | 142 scoped_ptr<PrivetRegisterOperation> current_register_operation_; |
137 | 143 |
138 // The current confirm call used during the registration flow. | 144 // The current confirm call used during the registration flow. |
(...skipping 25 matching lines...) Expand all Loading... |
164 | 170 |
165 // Current user index (for multi-login), or kAccountIndexUseOAuth2 for sync | 171 // Current user index (for multi-login), or kAccountIndexUseOAuth2 for sync |
166 // credentials. | 172 // credentials. |
167 int current_register_user_index_; | 173 int current_register_user_index_; |
168 | 174 |
169 DISALLOW_COPY_AND_ASSIGN(LocalDiscoveryUIHandler); | 175 DISALLOW_COPY_AND_ASSIGN(LocalDiscoveryUIHandler); |
170 }; | 176 }; |
171 | 177 |
172 } // namespace local_discovery | 178 } // namespace local_discovery |
173 #endif // CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_ | 179 #endif // CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_ |
OLD | NEW |