1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/testing/fake_local_frame_host.h"
#include "skia/public/mojom/skcolor.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom-blink.h"
#include "third_party/blink/public/mojom/timing/resource_timing.mojom-blink.h"
namespace blink {
void FakeLocalFrameHost::Init(blink::AssociatedInterfaceProvider* provider) {
provider->OverrideBinderForTesting(
mojom::blink::LocalFrameHost::Name_,
base::BindRepeating(&FakeLocalFrameHost::BindFrameHostReceiver,
base::Unretained(this)));
}
void FakeLocalFrameHost::EnterFullscreen(
mojom::blink::FullscreenOptionsPtr options,
EnterFullscreenCallback callback) {
std::move(callback).Run(true);
}
void FakeLocalFrameHost::ExitFullscreen() {}
void FakeLocalFrameHost::FullscreenStateChanged(bool is_fullscreen) {}
void FakeLocalFrameHost::RegisterProtocolHandler(const WTF::String& scheme,
const ::blink::KURL& url,
bool user_gesture) {}
void FakeLocalFrameHost::UnregisterProtocolHandler(const WTF::String& scheme,
const ::blink::KURL& url,
bool user_gesture) {}
void FakeLocalFrameHost::DidDisplayInsecureContent() {}
void FakeLocalFrameHost::DidAddContentSecurityPolicies(
WTF::Vector<::network::mojom::blink::ContentSecurityPolicyPtr>) {}
void FakeLocalFrameHost::DidContainInsecureFormAction() {}
void FakeLocalFrameHost::DocumentAvailableInMainFrame(
bool uses_temporary_zoom_level) {}
void FakeLocalFrameHost::SetNeedsOcclusionTracking(bool needs_tracking) {}
void FakeLocalFrameHost::SetVirtualKeyboardOverlayPolicy(
bool vk_overlays_content) {}
void FakeLocalFrameHost::VisibilityChanged(
mojom::blink::FrameVisibility visibility) {}
void FakeLocalFrameHost::DidChangeThemeColor(
base::Optional<::SkColor> theme_color) {}
void FakeLocalFrameHost::DidChangeBackgroundColor(SkColor background_color,
bool color_adjust) {}
void FakeLocalFrameHost::DidFailLoadWithError(const ::blink::KURL& url,
int32_t error_code) {}
void FakeLocalFrameHost::DidFocusFrame() {}
void FakeLocalFrameHost::DidCallFocus() {}
void FakeLocalFrameHost::EnforceInsecureRequestPolicy(
mojom::InsecureRequestPolicy policy_bitmap) {}
void FakeLocalFrameHost::EnforceInsecureNavigationsSet(
const WTF::Vector<uint32_t>& set) {}
void FakeLocalFrameHost::DidChangeActiveSchedulerTrackedFeatures(
uint64_t features_mask) {}
void FakeLocalFrameHost::SuddenTerminationDisablerChanged(
bool present,
blink::mojom::SuddenTerminationDisablerType disabler_type) {}
void FakeLocalFrameHost::HadStickyUserActivationBeforeNavigationChanged(
bool value) {}
void FakeLocalFrameHost::ScrollRectToVisibleInParentFrame(
const gfx::Rect& rect_to_scroll,
blink::mojom::blink::ScrollIntoViewParamsPtr params) {}
void FakeLocalFrameHost::BubbleLogicalScrollInParentFrame(
blink::mojom::blink::ScrollDirection direction,
ui::ScrollGranularity granularity) {}
void FakeLocalFrameHost::DidAccessInitialDocument() {}
void FakeLocalFrameHost::DidBlockNavigation(
const KURL& blocked_url,
const KURL& initiator_url,
mojom::NavigationBlockedReason reason) {}
void FakeLocalFrameHost::DidChangeLoadProgress(double load_progress) {}
void FakeLocalFrameHost::DidFinishLoad(const KURL& validated_url) {}
void FakeLocalFrameHost::DispatchLoad() {}
void FakeLocalFrameHost::GoToEntryAtOffset(int32_t offset,
bool has_user_gesture) {}
void FakeLocalFrameHost::RenderFallbackContentInParentProcess() {}
void FakeLocalFrameHost::UpdateTitle(
const WTF::String& title,
base::i18n::TextDirection title_direction) {}
void FakeLocalFrameHost::UpdateUserActivationState(
mojom::blink::UserActivationUpdateType update_type,
mojom::UserActivationNotificationType notification_type) {}
void FakeLocalFrameHost::HandleAccessibilityFindInPageResult(
mojom::blink::FindInPageResultAXParamsPtr params) {}
void FakeLocalFrameHost::HandleAccessibilityFindInPageTermination() {}
void FakeLocalFrameHost::DocumentOnLoadCompleted() {}
void FakeLocalFrameHost::ForwardResourceTimingToParent(
mojom::blink::ResourceTimingInfoPtr timing) {}
void FakeLocalFrameHost::DidFinishDocumentLoad() {}
void FakeLocalFrameHost::RunModalAlertDialog(
const WTF::String& alert_message,
RunModalAlertDialogCallback callback) {
std::move(callback).Run();
}
void FakeLocalFrameHost::RunModalConfirmDialog(
const WTF::String& alert_message,
RunModalConfirmDialogCallback callback) {
std::move(callback).Run(true);
}
void FakeLocalFrameHost::RunModalPromptDialog(
const WTF::String& alert_message,
const WTF::String& default_value,
RunModalPromptDialogCallback callback) {
std::move(callback).Run(true, g_empty_string);
}
void FakeLocalFrameHost::RunBeforeUnloadConfirm(
bool is_reload,
RunBeforeUnloadConfirmCallback callback) {
std::move(callback).Run(true);
}
void FakeLocalFrameHost::UpdateFaviconURL(
WTF::Vector<blink::mojom::blink::FaviconURLPtr> favicon_urls) {}
void FakeLocalFrameHost::DownloadURL(
mojom::blink::DownloadURLParamsPtr params) {}
void FakeLocalFrameHost::FocusedElementChanged(
bool is_editable_element,
const gfx::Rect& bounds_in_frame_widget,
blink::mojom::FocusType focus_type) {}
void FakeLocalFrameHost::TextSelectionChanged(const WTF::String& text,
uint32_t offset,
const gfx::Range& range) {}
void FakeLocalFrameHost::ShowPopupMenu(
mojo::PendingRemote<mojom::blink::PopupMenuClient> popup_client,
const gfx::Rect& bounds,
int32_t item_height,
double font_size,
int32_t selected_item,
Vector<mojom::blink::MenuItemPtr> menu_items,
bool right_aligned,
bool allow_multiple_selection) {}
void FakeLocalFrameHost::DidLoadResourceFromMemoryCache(
const KURL& url,
const WTF::String& http_method,
const WTF::String& mime_type,
network::mojom::blink::RequestDestination request_destination) {}
void FakeLocalFrameHost::DidChangeFrameOwnerProperties(
const base::UnguessableToken& child_frame_token,
mojom::blink::FrameOwnerPropertiesPtr frame_owner_properties) {}
void FakeLocalFrameHost::DidChangeOpener(
const base::Optional<base::UnguessableToken>& opener_frame) {}
void FakeLocalFrameHost::DidChangeCSPAttribute(
const base::UnguessableToken& child_frame_token,
network::mojom::blink::ContentSecurityPolicyPtr) {}
void FakeLocalFrameHost::DidChangeFramePolicy(
const base::UnguessableToken& child_frame_token,
const FramePolicy& frame_policy) {}
void FakeLocalFrameHost::BindPolicyContainer(
mojo::PendingAssociatedReceiver<mojom::blink::PolicyContainerHost>
receiver) {}
void FakeLocalFrameHost::CapturePaintPreviewOfSubframe(
const gfx::Rect& clip_rect,
const base::UnguessableToken& guid) {}
void FakeLocalFrameHost::Detach() {}
void FakeLocalFrameHost::BindFrameHostReceiver(
mojo::ScopedInterfaceEndpointHandle handle) {
receiver_.Bind(mojo::PendingAssociatedReceiver<mojom::blink::LocalFrameHost>(
std::move(handle)));
}
} // namespace blink
|