Update api::WebContents
This commit is contained in:
parent
231173aa90
commit
1d29b23662
4 changed files with 44 additions and 34 deletions
|
@ -375,7 +375,7 @@ WebContents::~WebContents() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebContents::AddMessageToConsole(content::WebContents* source,
|
bool WebContents::DidAddMessageToConsole(content::WebContents* source,
|
||||||
int32_t level,
|
int32_t level,
|
||||||
const base::string16& message,
|
const base::string16& message,
|
||||||
int32_t line_no,
|
int32_t line_no,
|
||||||
|
@ -401,6 +401,7 @@ void WebContents::OnCreateWindow(
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::WebContentsCreated(content::WebContents* source_contents,
|
void WebContents::WebContentsCreated(content::WebContents* source_contents,
|
||||||
|
int opener_render_process_id,
|
||||||
int opener_render_frame_id,
|
int opener_render_frame_id,
|
||||||
const std::string& frame_name,
|
const std::string& frame_name,
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
|
@ -530,7 +531,9 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) {
|
||||||
Emit("leave-html-full-screen");
|
Emit("leave-html-full-screen");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::RendererUnresponsive(content::WebContents* source) {
|
void WebContents::RendererUnresponsive(
|
||||||
|
content::WebContents* source,
|
||||||
|
const content::WebContentsUnresponsiveState& unresponsive_state) {
|
||||||
Emit("unresponsive");
|
Emit("unresponsive");
|
||||||
if ((type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) && owner_window())
|
if ((type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) && owner_window())
|
||||||
owner_window()->RendererUnresponsive(source);
|
owner_window()->RendererUnresponsive(source);
|
||||||
|
@ -640,11 +643,13 @@ void WebContents::PluginCrashed(const base::FilePath& plugin_path,
|
||||||
Emit("plugin-crashed", info.name, info.version);
|
Emit("plugin-crashed", info.name, info.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::MediaStartedPlaying(const MediaPlayerId& id) {
|
void WebContents::MediaStartedPlaying(const MediaPlayerInfo& video_type,
|
||||||
|
const MediaPlayerId& id) {
|
||||||
Emit("media-started-playing");
|
Emit("media-started-playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::MediaStoppedPlaying(const MediaPlayerId& id) {
|
void WebContents::MediaStoppedPlaying(const MediaPlayerInfo& video_type,
|
||||||
|
const MediaPlayerId& id) {
|
||||||
Emit("media-paused");
|
Emit("media-paused");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,7 +703,6 @@ void WebContents::DidGetResourceResponseStart(
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::DidGetRedirectForResourceRequest(
|
void WebContents::DidGetRedirectForResourceRequest(
|
||||||
content::RenderFrameHost* render_frame_host,
|
|
||||||
const content::ResourceRedirectDetails& details) {
|
const content::ResourceRedirectDetails& details) {
|
||||||
Emit("did-get-redirect-request",
|
Emit("did-get-redirect-request",
|
||||||
details.url,
|
details.url,
|
||||||
|
|
|
@ -213,12 +213,13 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
const mate::Dictionary& options);
|
const mate::Dictionary& options);
|
||||||
|
|
||||||
// content::WebContentsDelegate:
|
// content::WebContentsDelegate:
|
||||||
bool AddMessageToConsole(content::WebContents* source,
|
bool DidAddMessageToConsole(content::WebContents* source,
|
||||||
int32_t level,
|
int32_t level,
|
||||||
const base::string16& message,
|
const base::string16& message,
|
||||||
int32_t line_no,
|
int32_t line_no,
|
||||||
const base::string16& source_id) override;
|
const base::string16& source_id) override;
|
||||||
void WebContentsCreated(content::WebContents* source_contents,
|
void WebContentsCreated(content::WebContents* source_contents,
|
||||||
|
int opener_render_process_id,
|
||||||
int opener_render_frame_id,
|
int opener_render_frame_id,
|
||||||
const std::string& frame_name,
|
const std::string& frame_name,
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
|
@ -250,7 +251,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
void EnterFullscreenModeForTab(content::WebContents* source,
|
void EnterFullscreenModeForTab(content::WebContents* source,
|
||||||
const GURL& origin) override;
|
const GURL& origin) override;
|
||||||
void ExitFullscreenModeForTab(content::WebContents* source) override;
|
void ExitFullscreenModeForTab(content::WebContents* source) override;
|
||||||
void RendererUnresponsive(content::WebContents* source) override;
|
void RendererUnresponsive(
|
||||||
|
content::WebContents* source,
|
||||||
|
const content::WebContentsUnresponsiveState& unresponsive_state) override;
|
||||||
void RendererResponsive(content::WebContents* source) override;
|
void RendererResponsive(content::WebContents* source) override;
|
||||||
bool HandleContextMenu(const content::ContextMenuParams& params) override;
|
bool HandleContextMenu(const content::ContextMenuParams& params) override;
|
||||||
bool OnGoToEntryOffset(int offset) override;
|
bool OnGoToEntryOffset(int offset) override;
|
||||||
|
@ -295,7 +298,6 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
void DidGetResourceResponseStart(
|
void DidGetResourceResponseStart(
|
||||||
const content::ResourceRequestDetails& details) override;
|
const content::ResourceRequestDetails& details) override;
|
||||||
void DidGetRedirectForResourceRequest(
|
void DidGetRedirectForResourceRequest(
|
||||||
content::RenderFrameHost* render_frame_host,
|
|
||||||
const content::ResourceRedirectDetails& details) override;
|
const content::ResourceRedirectDetails& details) override;
|
||||||
void DidFinishNavigation(
|
void DidFinishNavigation(
|
||||||
content::NavigationHandle* navigation_handle) override;
|
content::NavigationHandle* navigation_handle) override;
|
||||||
|
@ -308,8 +310,10 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
const std::vector<content::FaviconURL>& urls) override;
|
const std::vector<content::FaviconURL>& urls) override;
|
||||||
void PluginCrashed(const base::FilePath& plugin_path,
|
void PluginCrashed(const base::FilePath& plugin_path,
|
||||||
base::ProcessId plugin_pid) override;
|
base::ProcessId plugin_pid) override;
|
||||||
void MediaStartedPlaying(const MediaPlayerId& id) override;
|
void MediaStartedPlaying(const MediaPlayerInfo& video_type,
|
||||||
void MediaStoppedPlaying(const MediaPlayerId& id) override;
|
const MediaPlayerId& id) override;
|
||||||
|
void MediaStoppedPlaying(const MediaPlayerInfo& video_type,
|
||||||
|
const MediaPlayerId& id) override;
|
||||||
void DidChangeThemeColor(SkColor theme_color) override;
|
void DidChangeThemeColor(SkColor theme_color) override;
|
||||||
|
|
||||||
// brightray::InspectableWebContentsDelegate:
|
// brightray::InspectableWebContentsDelegate:
|
||||||
|
|
|
@ -144,22 +144,24 @@ bool IsDevToolsFileSystemAdded(
|
||||||
return file_system_paths.find(file_system_path) != file_system_paths.end();
|
return file_system_paths.find(file_system_path) != file_system_paths.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
content::SecurityStyle SecurityLevelToSecurityStyle(
|
blink::WebSecurityStyle SecurityLevelToSecurityStyle(
|
||||||
SecurityStateModel::SecurityLevel security_level) {
|
security_state::SecurityLevel security_level) {
|
||||||
switch (security_level) {
|
switch (security_level) {
|
||||||
case SecurityStateModel::NONE:
|
case security_state::NONE:
|
||||||
return content::SECURITY_STYLE_UNAUTHENTICATED;
|
case security_state::HTTP_SHOW_WARNING:
|
||||||
case SecurityStateModel::SECURITY_WARNING:
|
return blink::WebSecurityStyleUnauthenticated;
|
||||||
case SecurityStateModel::SECURITY_POLICY_WARNING:
|
case security_state::SECURITY_WARNING:
|
||||||
return content::SECURITY_STYLE_WARNING;
|
case security_state::SECURE_WITH_POLICY_INSTALLED_CERT:
|
||||||
case SecurityStateModel::EV_SECURE:
|
return blink::WebSecurityStyleWarning;
|
||||||
case SecurityStateModel::SECURE:
|
case security_state::EV_SECURE:
|
||||||
return content::SECURITY_STYLE_AUTHENTICATED;
|
case security_state::SECURE:
|
||||||
case SecurityStateModel::SECURITY_ERROR:
|
return blink::WebSecurityStyleAuthenticated;
|
||||||
return content::SECURITY_STYLE_AUTHENTICATION_BROKEN;
|
case security_state::DANGEROUS:
|
||||||
|
return blink::WebSecurityStyleAuthenticationBroken;
|
||||||
}
|
}
|
||||||
|
|
||||||
return content::SECURITY_STYLE_UNKNOWN;
|
NOTREACHED();
|
||||||
|
return blink::WebSecurityStyleUnknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -290,7 +292,7 @@ bool CommonWebContentsDelegate::IsFullscreenForTabOrPending(
|
||||||
return html_fullscreen_;
|
return html_fullscreen_;
|
||||||
}
|
}
|
||||||
|
|
||||||
content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
|
blink::WebSecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
content::SecurityStyleExplanations* explanations) {
|
content::SecurityStyleExplanations* explanations) {
|
||||||
auto model_client =
|
auto model_client =
|
||||||
|
@ -299,7 +301,7 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
|
||||||
const SecurityStateModel::SecurityInfo& security_info =
|
const SecurityStateModel::SecurityInfo& security_info =
|
||||||
model_client->GetSecurityInfo();
|
model_client->GetSecurityInfo();
|
||||||
|
|
||||||
const content::SecurityStyle security_style =
|
const blink::WebSecurityStyle security_style =
|
||||||
SecurityLevelToSecurityStyle(security_info.security_level);
|
SecurityLevelToSecurityStyle(security_info.security_level);
|
||||||
|
|
||||||
explanations->ran_insecure_content_style =
|
explanations->ran_insecure_content_style =
|
||||||
|
|
|
@ -81,7 +81,7 @@ class CommonWebContentsDelegate
|
||||||
void ExitFullscreenModeForTab(content::WebContents* source) override;
|
void ExitFullscreenModeForTab(content::WebContents* source) override;
|
||||||
bool IsFullscreenForTabOrPending(
|
bool IsFullscreenForTabOrPending(
|
||||||
const content::WebContents* source) const override;
|
const content::WebContents* source) const override;
|
||||||
content::SecurityStyle GetSecurityStyle(
|
blink::WebSecurityStyle GetSecurityStyle(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
content::SecurityStyleExplanations* explanations) override;
|
content::SecurityStyleExplanations* explanations) override;
|
||||||
void HandleKeyboardEvent(
|
void HandleKeyboardEvent(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue