| Index: chrome/browser/extensions/api/tabs/tabs_api.cc
|
| diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| index 9343ee08d02e1da68c2315bc8462fe6f17fd7082..1531a4daf27607721072c90f947a78bbdd2d9a53 100644
|
| --- a/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| @@ -1545,7 +1545,7 @@ WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID(int window_id) {
|
|
|
| WebContents* contents = browser->tab_strip_model()->GetActiveWebContents();
|
| if (!contents) {
|
| - error_ = keys::kInternalVisibleTabCaptureError;
|
| + error_ = "No active web contents to capture";
|
| return NULL;
|
| }
|
|
|
| @@ -1557,7 +1557,20 @@ WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID(int window_id) {
|
| }
|
|
|
| void TabsCaptureVisibleTabFunction::OnCaptureFailure(FailureReason reason) {
|
| - error_ = keys::kInternalVisibleTabCaptureError;
|
| + const char* reason_description = "internal error";
|
| + switch (reason) {
|
| + case FAILURE_REASON_UNKNOWN:
|
| + reason_description = "unknown error";
|
| + break;
|
| + case FAILURE_REASON_ENCODING_FAILED:
|
| + reason_description = "encoding failed";
|
| + break;
|
| + case FAILURE_REASON_VIEW_INVISIBLE:
|
| + reason_description = "view is invisible";
|
| + break;
|
| + }
|
| + error_ = ErrorUtils::FormatErrorMessage("Failed to capture tab: *",
|
| + reason_description);
|
| SendResponse(false);
|
| }
|
|
|
|
|