summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_host.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_host.cc')
-rw-r--r--chrome/browser/extensions/extension_host.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 78ec493..b4fbd00 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -26,6 +26,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/render_messages.h"
+#include "chrome/common/url_constants.h"
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
@@ -193,6 +194,10 @@ void ExtensionHost::DidNavigate(RenderViewHost* render_view_host,
}
url_ = params.url;
+ if (!url_.SchemeIs(chrome::kExtensionScheme)) {
+ extension_function_dispatcher_.reset(NULL);
+ return;
+ }
extension_function_dispatcher_.reset(
new ExtensionFunctionDispatcher(render_view_host_, this, url_));
}
@@ -244,8 +249,10 @@ void ExtensionHost::ProcessDOMUIMessage(const std::string& message,
const std::string& content,
int request_id,
bool has_callback) {
- extension_function_dispatcher_->HandleRequest(message, content, request_id,
- has_callback);
+ if (extension_function_dispatcher_.get()) {
+ extension_function_dispatcher_->HandleRequest(message, content, request_id,
+ has_callback);
+ }
}
void ExtensionHost::DidInsertCSS() {