Commit 6ad6fbb3 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Remove unused referrer_ member in AppBannerManager.

The use of this member was removed as a part of addressing
crbug.com/904566. This CL completes the clean up.

TBR=rbyers@chromium.org
BUG=904566

Change-Id: Iba297c9c623ad33005d2f868eddfa4401abc819c
Reviewed-on: https://chromium-review.googlesource.com/c/1442078
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626947}
parent a2ccda16
......@@ -404,7 +404,6 @@ void AppBannerManager::ResetCurrentPageData() {
manifest_ = blink::Manifest();
manifest_url_ = GURL();
validated_url_ = GURL();
referrer_.erase();
installable_ = Installable::UNKNOWN;
}
......@@ -639,8 +638,7 @@ InstallableStatusCode AppBannerManager::ShouldShowBannerCode() {
void AppBannerManager::OnBannerPromptReply(
blink::mojom::AppBannerControllerPtr controller,
blink::mojom::AppBannerPromptReply reply,
const std::string& referrer) {
blink::mojom::AppBannerPromptReply reply) {
// The renderer might have requested the prompt to be canceled. They may
// request that it is redisplayed later, so don't Terminate() here. However,
// log that the cancelation was requested, so Terminate() can be called if a
......@@ -651,7 +649,6 @@ void AppBannerManager::OnBannerPromptReply(
// already been received before cancel was sent (e.g. if redisplay was
// requested in the beforeinstallprompt event handler), we keep going and show
// the banner immediately.
referrer_ = referrer;
if (reply == blink::mojom::AppBannerPromptReply::CANCEL) {
TrackBeforeInstallEvent(BEFORE_INSTALL_EVENT_PREVENT_DEFAULT_CALLED);
if (IsDebugMode()) {
......
......@@ -290,10 +290,6 @@ class AppBannerManager : public content::WebContentsObserver,
// The primary icon object.
SkBitmap primary_icon_;
// The referrer string (if any) specified in the app URL. Used only for native
// app banners.
std::string referrer_;
// The current banner pipeline state for this page load.
State state_;
......@@ -317,8 +313,7 @@ class AppBannerManager : public content::WebContentsObserver,
// opportunity to cancel.
virtual void OnBannerPromptReply(
blink::mojom::AppBannerControllerPtr controller,
blink::mojom::AppBannerPromptReply reply,
const std::string& referrer);
blink::mojom::AppBannerPromptReply reply);
// Does the non-platform specific parts of showing the app banner.
void ShowBanner();
......
......@@ -109,10 +109,8 @@ class AppBannerManagerTest : public AppBannerManager {
}
void OnBannerPromptReply(blink::mojom::AppBannerControllerPtr controller,
blink::mojom::AppBannerPromptReply reply,
const std::string& referrer) override {
AppBannerManager::OnBannerPromptReply(std::move(controller), reply,
referrer);
blink::mojom::AppBannerPromptReply reply) override {
AppBannerManager::OnBannerPromptReply(std::move(controller), reply);
if (on_banner_prompt_reply_) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, std::move(on_banner_prompt_reply_));
......
......@@ -42,8 +42,7 @@ void AppBannerService::DisplayAppBanner() { /* do nothing */
void AppBannerService::OnBannerPromptReply(
base::OnceCallback<void(bool)> callback,
blink::mojom::AppBannerPromptReply reply,
const std::string& referrer) {
blink::mojom::AppBannerPromptReply reply) {
std::move(callback).Run(reply == blink::mojom::AppBannerPromptReply::CANCEL);
}
......
......@@ -34,8 +34,7 @@ class TEST_RUNNER_EXPORT AppBannerService
private:
void OnBannerPromptReply(base::OnceCallback<void(bool)> callback,
blink::mojom::AppBannerPromptReply,
const std::string& referrer);
blink::mojom::AppBannerPromptReply);
mojo::Binding<blink::mojom::AppBannerService> binding_;
blink::mojom::AppBannerEventPtr event_;
......
......@@ -13,7 +13,7 @@ interface AppBannerController {
// The browser asks the renderer if the app banner should be shown.
BannerPromptRequest(AppBannerService service, AppBannerEvent& event,
array<string> platform, bool require_gesture) =>
(AppBannerPromptReply reply, string referrer);
(AppBannerPromptReply reply);
};
interface AppBannerEvent {
......
......@@ -12,10 +12,6 @@
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/modules/app_banner/before_install_prompt_event.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/weborigin/referrer.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
namespace blink {
......@@ -39,7 +35,7 @@ void AppBannerController::BannerPromptRequest(
bool require_gesture,
BannerPromptRequestCallback callback) {
if (!frame_ || !frame_->GetDocument()) {
std::move(callback).Run(mojom::blink::AppBannerPromptReply::NONE, "");
std::move(callback).Run(mojom::blink::AppBannerPromptReply::NONE);
return;
}
......@@ -51,12 +47,7 @@ void AppBannerController::BannerPromptRequest(
? mojom::AppBannerPromptReply::NONE
: mojom::AppBannerPromptReply::CANCEL;
AtomicString referrer = SecurityPolicy::GenerateReferrer(
frame_->GetDocument()->GetReferrerPolicy(),
KURL(), frame_->GetDocument()->OutgoingReferrer())
.referrer;
std::move(callback).Run(reply, referrer.IsNull() ? g_empty_string : referrer);
std::move(callback).Run(reply);
}
} // namespace blink
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