Commit d020af34 authored by Adithya Srinivasan's avatar Adithya Srinivasan Committed by Commit Bot

Remove redundant main frame check in InstallableManager

Found while doing an audit of WebContents::GetMainFrame().
web_contents->GetMainFrame()->GetParent() will always return null.

Change-Id: Idc5d2ed719a400a300198b9c36ab4e3307934556
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422440
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809320}
parent e9b424e9
......@@ -15,8 +15,6 @@
namespace {
// Error message strings corresponding to the InstallableStatusCode enum.
static const char kNotInMainFrameMessage[] =
"Page is not loaded in the main frame";
static const char kNotFromSecureOriginMessage[] =
"Page is not served from a secure origin";
static const char kNoManifestMessage[] = "Page has no manifest <link> URL";
......@@ -68,7 +66,6 @@ static const char kManifestDisplayOverrideNotSupportedMessage[] =
"Manifest contains 'display_override' field, and the first supported "
"display mode must be one of 'standalone', 'fullscreen', or 'minimal-ui'";
static const char kNotInMainFrameId[] = "not-in-main-frame";
static const char kNotFromSecureOriginId[] = "not-from-secure-origin";
static const char kNoManifestId[] = "no-manifest";
static const char kManifestEmptyId[] = "manifest-empty";
......@@ -132,9 +129,6 @@ std::string GetErrorMessage(InstallableStatusCode code) {
case SHOWING_APP_INSTALLATION_DIALOG:
case MAX_ERROR_CODE:
break;
case NOT_IN_MAIN_FRAME:
message = kNotInMainFrameMessage;
break;
case NOT_FROM_SECURE_ORIGIN:
message = kNotFromSecureOriginMessage;
break;
......@@ -238,9 +232,6 @@ content::InstallabilityError GetInstallabilityError(
case SHOWING_APP_INSTALLATION_DIALOG:
case MAX_ERROR_CODE:
break;
case NOT_IN_MAIN_FRAME:
error_id = kNotInMainFrameId;
break;
case NOT_FROM_SECURE_ORIGIN:
error_id = kNotFromSecureOriginId;
break;
......
......@@ -22,7 +22,7 @@ enum InstallableStatusCode {
RENDERER_EXITING = 1,
RENDERER_CANCELLED = 2,
USER_NAVIGATED = 3,
NOT_IN_MAIN_FRAME = 4,
// NOT_IN_MAIN_FRAME = 4 (DEPRECATED),
NOT_FROM_SECURE_ORIGIN = 5,
NO_MANIFEST = 6,
MANIFEST_EMPTY = 7,
......
......@@ -591,9 +591,6 @@ void InstallableManager::CheckEligiblity() {
->IsOffTheRecord()) {
eligibility_->errors.push_back(IN_INCOGNITO);
}
if (web_contents->GetMainFrame()->GetParent()) {
eligibility_->errors.push_back(NOT_IN_MAIN_FRAME);
}
if (!IsContentSecure(web_contents)) {
eligibility_->errors.push_back(NOT_FROM_SECURE_ORIGIN);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment