Index: chrome/common/extensions/extension_file_util.cc |
=================================================================== |
--- chrome/common/extensions/extension_file_util.cc (revision 72219) |
+++ chrome/common/extensions/extension_file_util.cc (working copy) |
@@ -21,6 +21,7 @@ |
#include "chrome/common/extensions/extension_l10n_util.h" |
#include "chrome/common/extensions/extension_constants.h" |
#include "chrome/common/extensions/extension_resource.h" |
+#include "chrome/common/extensions/extension_sidebar_defaults.h" |
#include "chrome/common/json_value_serializer.h" |
#include "grit/generated_resources.h" |
#include "net/base/escape.h" |
@@ -269,6 +270,21 @@ |
} |
} |
+ // Validate sidebar default page location. |
+ ExtensionSidebarDefaults* sidebar_defaults = extension->sidebar_defaults(); |
+ if (sidebar_defaults && sidebar_defaults->default_page().is_valid()) { |
+ FilePath page_path = ExtensionURLToRelativeFilePath( |
+ sidebar_defaults->default_page()); |
+ const FilePath path = extension->GetResource(page_path).GetFilePath(); |
+ if (path.empty() || !file_util::PathExists(path)) { |
+ *error = |
+ l10n_util::GetStringFUTF8( |
+ IDS_EXTENSION_LOAD_SIDEBAR_PAGE_FAILED, |
+ WideToUTF16(page_path.ToWStringHack())); |
+ return false; |
+ } |
+ } |
+ |
// Validate locale info. |
if (!ValidateLocaleInfo(*extension, error)) |
return false; |