Index: chrome/browser/extensions/api/runtime/runtime_api.cc |
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc |
index 544e064ac42b18472f5194d805a70753b8a680f2..9e6998ec67cbf8361a5ebe14f9db71aed7d0bfa9 100644 |
--- a/chrome/browser/extensions/api/runtime/runtime_api.cc |
+++ b/chrome/browser/extensions/api/runtime/runtime_api.cc |
@@ -17,6 +17,7 @@ namespace { |
const char kOnInstalledEvent[] = "experimental.runtime.onInstalled"; |
const char kNoBackgroundPageError[] = "You do not have a background page."; |
+const char kPageLoadError[] = "Background page failed to load."; |
} |
@@ -56,8 +57,13 @@ bool RuntimeGetBackgroundPageFunction::RunImpl() { |
return true; |
} |
-void RuntimeGetBackgroundPageFunction::OnPageLoaded(ExtensionHost*) { |
- SendResponse(true); |
+void RuntimeGetBackgroundPageFunction::OnPageLoaded(ExtensionHost* host) { |
+ if (host) { |
+ SendResponse(true); |
+ } else { |
+ error_ = kPageLoadError; |
+ SendResponse(false); |
+ } |
} |
} // namespace extensions |