| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_COMMUNICATOR_LOGIN_FAILURE_H_ | |
| 6 #define CHROME_BROWSER_SYNC_NOTIFIER_COMMUNICATOR_LOGIN_FAILURE_H_ | |
| 7 | |
| 8 #include "talk/base/common.h" | |
| 9 #include "talk/xmpp/xmppengine.h" | |
| 10 | |
| 11 namespace notifier { | |
| 12 | |
| 13 class LoginFailure { | |
| 14 public: | |
| 15 enum LoginError { | |
| 16 // Check the xmpp_error for more information. | |
| 17 XMPP_ERROR, | |
| 18 | |
| 19 // If the certificate has expired, it usually means that the computer's | |
| 20 // clock isn't set correctly. | |
| 21 CERTIFICATE_EXPIRED_ERROR, | |
| 22 | |
| 23 // Apparently, there is a proxy that needs authentication information. | |
| 24 PROXY_AUTHENTICATION_ERROR, | |
| 25 }; | |
| 26 | |
| 27 explicit LoginFailure(LoginError error); | |
| 28 LoginFailure(LoginError error, | |
| 29 buzz::XmppEngine::Error xmpp_error, | |
| 30 int subcode); | |
| 31 | |
| 32 // Used as the first level of error information. | |
| 33 LoginError error() const { | |
| 34 return error_; | |
| 35 } | |
| 36 | |
| 37 // Returns the XmppEngine only. Valid if and only if error() == XMPP_ERROR. | |
| 38 // | |
| 39 // Handler should mimic logic from PhoneWindow::ShowConnectionError | |
| 40 // (except that the DiagnoseConnectionError has already been done). | |
| 41 buzz::XmppEngine::Error xmpp_error() const; | |
| 42 | |
| 43 private: | |
| 44 LoginError error_; | |
| 45 buzz::XmppEngine::Error xmpp_error_; | |
| 46 int subcode_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(LoginFailure); | |
| 49 }; | |
| 50 | |
| 51 } // namespace notifier | |
| 52 | |
| 53 #endif // CHROME_BROWSER_SYNC_NOTIFIER_COMMUNICATOR_LOGIN_FAILURE_H_ | |
| OLD | NEW |