[OnionSoup] Move was_activated_option.mojom into blink
Per OnionSoup project, we are going to move the NavigationBodyLoader into blink. In order to do that we move the was_activated_option.mojom first, because the NavigationBodyLoader depends on it. Bug: 860403 Change-Id: I1275f2425447cead82ac6ad98a406bac15a6d14f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2913463 Commit-Queue: Minggang Wang <minggang.wang@intel.com> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#892847}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
7495c2e847
commit
f59db47bb6
chrome
browser
media
ui
test
content
browser
common
public
renderer
fuchsia/engine/browser
third_party/blink/public/mojom
weblayer/browser
@ -290,7 +290,7 @@ IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest, ForceWasActivated_Yes) {
|
||||
const GURL kTestPageUrl = embedded_test_server()->GetURL(kTestPagePath);
|
||||
|
||||
NavigateParams params(browser(), kTestPageUrl, ui::PAGE_TRANSITION_LINK);
|
||||
params.was_activated = content::mojom::WasActivatedOption::kYes;
|
||||
params.was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
ui_test_utils::NavigateToURL(¶ms);
|
||||
|
||||
EXPECT_TRUE(AttemptPlay(GetWebContents()));
|
||||
@ -303,7 +303,7 @@ IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest,
|
||||
const GURL kTestPageUrl = embedded_test_server()->GetURL(kTestPagePath);
|
||||
|
||||
NavigateParams params(browser(), kRedirectPageUrl, ui::PAGE_TRANSITION_LINK);
|
||||
params.was_activated = content::mojom::WasActivatedOption::kYes;
|
||||
params.was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
ui_test_utils::NavigateToURL(¶ms);
|
||||
|
||||
EXPECT_TRUE(NavigateInRenderer(GetWebContents(), kTestPageUrl));
|
||||
@ -333,7 +333,7 @@ IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest,
|
||||
embedded_test_server()->GetURL("foo.example.com", kTestPagePath);
|
||||
|
||||
NavigateParams params(browser(), kRedirectPageUrl, ui::PAGE_TRANSITION_LINK);
|
||||
params.was_activated = content::mojom::WasActivatedOption::kYes;
|
||||
params.was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
ui_test_utils::NavigateToURL(¶ms);
|
||||
|
||||
EXPECT_TRUE(NavigateInRenderer(GetWebContents(), kTestPageUrl));
|
||||
|
@ -2818,6 +2818,7 @@ static_library("ui") {
|
||||
"//components/services/app_service/public/cpp:instance_update",
|
||||
"//components/session_manager/core",
|
||||
"//components/user_manager",
|
||||
"//content/public/common",
|
||||
"//extensions/browser/api/messaging",
|
||||
"//extensions/browser/api/virtual_keyboard_private",
|
||||
"//extensions/browser/api/vpn_provider",
|
||||
|
@ -75,10 +75,10 @@
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/was_activated_option.mojom.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "third_party/blink/public/mojom/navigation/was_activated_option.mojom.h"
|
||||
#include "ui/aura/window.h"
|
||||
#include "ui/base/page_transition_types.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
@ -693,7 +693,7 @@ content::WebContents* ChromeNewWindowClient::OpenUrlImpl(
|
||||
ui::PAGE_TRANSITION_FROM_API));
|
||||
|
||||
if (from_user_interaction)
|
||||
navigate_params.was_activated = content::mojom::WasActivatedOption::kYes;
|
||||
navigate_params.was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
|
||||
Navigate(&navigate_params);
|
||||
|
||||
|
@ -17,12 +17,12 @@
|
||||
#include "content/public/browser/site_instance.h"
|
||||
#include "content/public/common/child_process_host.h"
|
||||
#include "content/public/common/referrer.h"
|
||||
#include "content/public/common/was_activated_option.mojom.h"
|
||||
#include "services/network/public/cpp/resource_request_body.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/navigation/impression.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
#include "third_party/blink/public/mojom/navigation/was_activated_option.mojom.h"
|
||||
#include "ui/base/page_transition_types.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
@ -293,8 +293,8 @@ struct NavigateParams {
|
||||
// outside of the page and pass it to the page as if it happened on a prior
|
||||
// page. For example, if the assistant opens a page we should treat the
|
||||
// user's interaction with the assistant as a previous user activation.
|
||||
content::mojom::WasActivatedOption was_activated =
|
||||
content::mojom::WasActivatedOption::kUnknown;
|
||||
blink::mojom::WasActivatedOption was_activated =
|
||||
blink::mojom::WasActivatedOption::kUnknown;
|
||||
|
||||
// If this navigation was initiated from a link that specified the
|
||||
// hrefTranslate attribute, this contains the attribute's value (a BCP47
|
||||
|
@ -1161,6 +1161,7 @@ if (!is_android) {
|
||||
"//components/webapps/browser",
|
||||
"//components/webrtc",
|
||||
"//components/webrtc_logging/browser",
|
||||
"//content/public/common",
|
||||
"//content/test:browsertest_support",
|
||||
"//content/test:test_support",
|
||||
"//courgette:bsdiff",
|
||||
|
@ -2514,7 +2514,7 @@ void NavigationControllerImpl::NavigateFromFrameProxy(
|
||||
params.started_from_context_menu = false;
|
||||
/* params.navigation_ui_data: skip */
|
||||
/* params.input_start: skip */
|
||||
params.was_activated = mojom::WasActivatedOption::kUnknown;
|
||||
params.was_activated = blink::mojom::WasActivatedOption::kUnknown;
|
||||
/* params.reload_type: skip */
|
||||
params.impression = impression;
|
||||
|
||||
@ -3504,7 +3504,7 @@ NavigationControllerImpl::CreateNavigationRequestFromLoadParams(
|
||||
false /* was_discarded */, is_view_source_mode,
|
||||
params.should_clear_history_list, mojom::NavigationTiming::New(),
|
||||
absl::nullopt /* appcache_host_id */,
|
||||
mojom::WasActivatedOption::kUnknown,
|
||||
blink::mojom::WasActivatedOption::kUnknown,
|
||||
base::UnguessableToken::Create() /* navigation_token */,
|
||||
std::vector<mojom::PrefetchedSignedExchangeInfoPtr>(),
|
||||
#if defined(OS_ANDROID)
|
||||
|
@ -813,7 +813,7 @@ NavigationEntryImpl::ConstructCommitNavigationParams(
|
||||
pending_offset_to_send, current_offset_to_send,
|
||||
current_length_to_send, false, IsViewSourceMode(),
|
||||
should_clear_history_list(), mojom::NavigationTiming::New(),
|
||||
absl::nullopt, mojom::WasActivatedOption::kUnknown,
|
||||
absl::nullopt, blink::mojom::WasActivatedOption::kUnknown,
|
||||
base::UnguessableToken::Create(),
|
||||
std::vector<mojom::PrefetchedSignedExchangeInfoPtr>(),
|
||||
#if defined(OS_ANDROID)
|
||||
|
@ -951,7 +951,7 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
|
||||
/*should_clear_history_list=*/false,
|
||||
/*navigation_timing=*/mojom::NavigationTiming::New(),
|
||||
/*appcache_host_id=*/absl::nullopt,
|
||||
mojom::WasActivatedOption::kUnknown,
|
||||
blink::mojom::WasActivatedOption::kUnknown,
|
||||
/*navigation_token=*/base::UnguessableToken::Create(),
|
||||
/*prefetched_signed_exchanges=*/
|
||||
std::vector<mojom::PrefetchedSignedExchangeInfoPtr>(),
|
||||
@ -1070,7 +1070,7 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateForCommit(
|
||||
-1 /* current_history_list_length */, false /* was_discard */,
|
||||
false /* is_view_source */, false /* should_clear_history_list */,
|
||||
mojom::NavigationTiming::New(), absl::nullopt /* appcache_host_id */,
|
||||
mojom::WasActivatedOption::kUnknown,
|
||||
blink::mojom::WasActivatedOption::kUnknown,
|
||||
base::UnguessableToken::Create() /* navigation_token */,
|
||||
std::vector<mojom::PrefetchedSignedExchangeInfoPtr>(),
|
||||
#if defined(OS_ANDROID)
|
||||
@ -2693,8 +2693,9 @@ void NavigationRequest::OnResponseStarted(
|
||||
// context menu. This should apply to pages that open in a new tab and we
|
||||
// have to follow the referrer. It means that the activation might not be
|
||||
// transmitted if it should have.
|
||||
if (commit_params_->was_activated == mojom::WasActivatedOption::kUnknown) {
|
||||
commit_params_->was_activated = mojom::WasActivatedOption::kNo;
|
||||
if (commit_params_->was_activated ==
|
||||
blink::mojom::WasActivatedOption::kUnknown) {
|
||||
commit_params_->was_activated = blink::mojom::WasActivatedOption::kNo;
|
||||
|
||||
if (!commit_params_->is_browser_initiated &&
|
||||
(frame_tree_node_->HasStickyUserActivation() ||
|
||||
@ -2702,7 +2703,7 @@ void NavigationRequest::OnResponseStarted(
|
||||
ShouldPropagateUserActivation(
|
||||
frame_tree_node_->current_origin(),
|
||||
url::Origin::Create(common_params_->url))) {
|
||||
commit_params_->was_activated = mojom::WasActivatedOption::kYes;
|
||||
commit_params_->was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
// TODO(805871): the next check is relying on sanitized_referrer_ but
|
||||
// should ideally use a more reliable source for the originating URL when
|
||||
// the navigation is renderer initiated.
|
||||
@ -2712,7 +2713,7 @@ void NavigationRequest::OnResponseStarted(
|
||||
ShouldPropagateUserActivation(
|
||||
url::Origin::Create(sanitized_referrer_->url),
|
||||
url::Origin::Create(common_params_->url))) {
|
||||
commit_params_->was_activated = mojom::WasActivatedOption::kYes;
|
||||
commit_params_->was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
module content.mojom;
|
||||
|
||||
import "content/common/prefetched_signed_exchange_info.mojom";
|
||||
import "content/public/common/was_activated_option.mojom";
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
import "mojo/public/mojom/base/time.mojom";
|
||||
import "mojo/public/mojom/base/unguessable_token.mojom";
|
||||
@ -24,6 +23,7 @@ import "third_party/blink/public/mojom/frame/frame_policy.mojom";
|
||||
import "third_party/blink/public/mojom/loader/mixed_content.mojom";
|
||||
import "third_party/blink/public/mojom/loader/referrer.mojom";
|
||||
import "third_party/blink/public/mojom/navigation/navigation_policy.mojom";
|
||||
import "third_party/blink/public/mojom/navigation/was_activated_option.mojom";
|
||||
import "third_party/blink/public/mojom/page/page.mojom";
|
||||
import "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom";
|
||||
import "third_party/blink/public/mojom/tokens/tokens.mojom";
|
||||
@ -397,7 +397,7 @@ struct CommitNavigationParams {
|
||||
// gesture but whether there was an activation prior to the navigation or to
|
||||
// start it. `was_activated` will answer the former question while
|
||||
// `user_gesture` will answer the latter.
|
||||
WasActivatedOption was_activated = kUnknown;
|
||||
blink.mojom.WasActivatedOption was_activated = kUnknown;
|
||||
|
||||
// A token that should be passed to the browser process in
|
||||
// DidCommitProvisionalLoadParams.
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "content/public/browser/page_navigator.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/common/was_activated_option.mojom.h"
|
||||
#include "third_party/blink/public/mojom/navigation/was_activated_option.mojom.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
|
@ -25,12 +25,12 @@
|
||||
#include "content/public/browser/site_instance.h"
|
||||
#include "content/public/common/child_process_host.h"
|
||||
#include "content/public/common/referrer.h"
|
||||
#include "content/public/common/was_activated_option.mojom.h"
|
||||
#include "services/network/public/cpp/resource_request_body.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/navigation/impression.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
#include "third_party/blink/public/mojom/navigation/was_activated_option.mojom.h"
|
||||
#include "ui/base/page_transition_types.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
@ -258,8 +258,8 @@ class NavigationController {
|
||||
|
||||
// Set to |kYes| if the navigation should propagate user activation. This
|
||||
// is used by embedders where the activation has occurred outside the page.
|
||||
mojom::WasActivatedOption was_activated =
|
||||
mojom::WasActivatedOption::kUnknown;
|
||||
blink::mojom::WasActivatedOption was_activated =
|
||||
blink::mojom::WasActivatedOption::kUnknown;
|
||||
|
||||
// If this navigation was initiated from a link that specified the
|
||||
// hrefTranslate attribute, this contains the attribute's value (a BCP47
|
||||
|
@ -313,7 +313,6 @@ mojom("interfaces") {
|
||||
sources = [
|
||||
"drop_data.mojom",
|
||||
"resource_usage_reporter.mojom",
|
||||
"was_activated_option.mojom",
|
||||
"webplugininfo.mojom",
|
||||
"window_container_type.mojom",
|
||||
]
|
||||
|
@ -966,7 +966,7 @@ void FillMiscNavigationParams(
|
||||
common_params.input_start);
|
||||
|
||||
navigation_params->is_user_activated =
|
||||
commit_params.was_activated == mojom::WasActivatedOption::kYes;
|
||||
commit_params.was_activated == blink::mojom::WasActivatedOption::kYes;
|
||||
|
||||
navigation_params->has_text_fragment_token =
|
||||
common_params.text_fragment_token;
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/browser/renderer_preferences_util.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/was_activated_option.mojom.h"
|
||||
#include "fuchsia/base/mem_buffer_util.h"
|
||||
#include "fuchsia/base/message_port.h"
|
||||
#include "fuchsia/engine/browser/accessibility_bridge.h"
|
||||
@ -57,6 +56,7 @@
|
||||
#include "third_party/blink/public/common/messaging/web_message_port.h"
|
||||
#include "third_party/blink/public/common/page/page_zoom.h"
|
||||
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h"
|
||||
#include "third_party/blink/public/mojom/navigation/was_activated_option.mojom.h"
|
||||
#include "ui/aura/window.h"
|
||||
#include "ui/compositor/compositor.h"
|
||||
#include "ui/gfx/switches.h"
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/was_activated_option.mojom.h"
|
||||
#include "fuchsia/base/string_util.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "net/http/http_util.h"
|
||||
#include "third_party/blink/public/mojom/navigation/was_activated_option.mojom.h"
|
||||
#include "ui/base/page_transition_types.h"
|
||||
|
||||
NavigationControllerImpl::NavigationControllerImpl(
|
||||
@ -169,9 +169,9 @@ void NavigationControllerImpl::LoadUrl(std::string url,
|
||||
params_converted.transition_type = ui::PageTransitionFromInt(
|
||||
ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
|
||||
if (params.has_was_user_activated() && params.was_user_activated()) {
|
||||
params_converted.was_activated = content::mojom::WasActivatedOption::kYes;
|
||||
params_converted.was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
} else {
|
||||
params_converted.was_activated = content::mojom::WasActivatedOption::kNo;
|
||||
params_converted.was_activated = blink::mojom::WasActivatedOption::kNo;
|
||||
}
|
||||
|
||||
web_contents_->GetController().LoadURLWithParams(params_converted);
|
||||
|
1
third_party/blink/public/mojom/BUILD.gn
vendored
1
third_party/blink/public/mojom/BUILD.gn
vendored
@ -123,6 +123,7 @@ mojom("mojom_platform") {
|
||||
"modal_close_watcher/modal_close_listener.mojom",
|
||||
"native_io/native_io.mojom",
|
||||
"navigation/navigation_policy.mojom",
|
||||
"navigation/was_activated_option.mojom",
|
||||
"notifications/notification.mojom",
|
||||
"notifications/notification_service.mojom",
|
||||
"oom_intervention/oom_intervention.mojom",
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
module content.mojom;
|
||||
module blink.mojom;
|
||||
|
||||
// Whether the navigation should propagate user activation. This can be
|
||||
// specified by embedders in NavigationController::LoadURLParams.
|
@ -14,6 +14,7 @@
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
#include "content/public/browser/navigation_throttle.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "third_party/blink/public/mojom/navigation/was_activated_option.mojom-shared.h"
|
||||
#include "ui/base/page_transition_types.h"
|
||||
#include "weblayer/browser/navigation_entry_data.h"
|
||||
#include "weblayer/browser/navigation_ui_data_impl.h"
|
||||
@ -238,7 +239,7 @@ void NavigationControllerImpl::Navigate(
|
||||
params->navigation_ui_data = std::move(data);
|
||||
|
||||
if (enable_auto_play)
|
||||
params->was_activated = content::mojom::WasActivatedOption::kYes;
|
||||
params->was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
|
||||
DoNavigate(std::move(params));
|
||||
}
|
||||
@ -313,7 +314,7 @@ void NavigationControllerImpl::Navigate(
|
||||
load_params->should_replace_current_entry =
|
||||
params.should_replace_current_entry;
|
||||
if (params.enable_auto_play)
|
||||
load_params->was_activated = content::mojom::WasActivatedOption::kYes;
|
||||
load_params->was_activated = blink::mojom::WasActivatedOption::kYes;
|
||||
|
||||
DoNavigate(std::move(load_params));
|
||||
}
|
||||
|
Reference in New Issue
Block a user