| 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 #include "chrome/common/automation_constants.h" | 5 #include "chrome/common/automation_constants.h" |
| 6 | 6 |
| 7 namespace automation { | 7 namespace automation { |
| 8 | 8 |
| 9 // JSON value labels for proxy settings that are passed in via | 9 // JSON value labels for proxy settings that are passed in via |
| 10 // AutomationMsg_SetProxyConfig. | 10 // AutomationMsg_SetProxyConfig. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Returns the string equivalent of the given |ErrorCode|. | 26 // Returns the string equivalent of the given |ErrorCode|. |
| 27 const char* DefaultMessageForErrorCode(ErrorCode code) { | 27 const char* DefaultMessageForErrorCode(ErrorCode code) { |
| 28 switch (code) { | 28 switch (code) { |
| 29 case kUnknownError: | 29 case kUnknownError: |
| 30 return "Unknown error"; | 30 return "Unknown error"; |
| 31 case kNoJavaScriptModalDialogOpen: | 31 case kNoJavaScriptModalDialogOpen: |
| 32 return "No JavaScript modal dialog is open"; | 32 return "No JavaScript modal dialog is open"; |
| 33 case kBlockedByModalDialog: | 33 case kBlockedByModalDialog: |
| 34 return "Command blocked by an open modal dialog"; | 34 return "Command blocked by an open modal dialog"; |
| 35 case kInvalidId: |
| 36 return "ID is invalid or does not refer to an existing object"; |
| 35 default: | 37 default: |
| 36 return "<unknown>"; | 38 return "<unknown>"; |
| 37 } | 39 } |
| 38 } | 40 } |
| 39 | 41 |
| 40 } // namespace | 42 } // namespace |
| 41 | 43 |
| 42 Error::Error() : code_(kUnknownError) { } | 44 Error::Error() : code_(kUnknownError) { } |
| 43 | 45 |
| 44 Error::Error(ErrorCode code) | 46 Error::Error(ErrorCode code) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 55 | 57 |
| 56 ErrorCode Error::code() const { | 58 ErrorCode Error::code() const { |
| 57 return code_; | 59 return code_; |
| 58 } | 60 } |
| 59 | 61 |
| 60 const std::string& Error::message() const { | 62 const std::string& Error::message() const { |
| 61 return message_; | 63 return message_; |
| 62 } | 64 } |
| 63 | 65 |
| 64 } // namespace automation | 66 } // namespace automation |
| OLD | NEW |