#include "browser/sound_effect.h"
#include "common/web_contents_utils.h"
#include "common/render_messages_ewk.h"
-#include "common/error_params.h"
#include "common/hit_test_params.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
web_view_->UpdateHitTestData(params);
}
- void OnReceivedDidFailLoadWithError(ErrorParams error) {
- if (web_view_)
- web_view_->InvokeLoadError(error);
- }
-
void OnReceivedHitTestAsyncData(int render_view,
const Hit_Test_Params& params,
int64_t request_id) {
void WebViewBrowserMessageFilter::OverrideThreadForMessage(
const IPC::Message& message, BrowserThread::ID* thread) {
switch (message.type()) {
- case EwkViewMsg_DidFailLoadWithError::ID:
case EwkViewHostMsg_HitTestAsyncReply::ID:
case EwkHostMsg_PlainTextGetContents::ID:
case EwkHostMsg_HandleTapGestureWithContext::ID:
WebViewBrowserMessageFilterPrivate::OnReceivedHitTestData)
IPC_MESSAGE_FORWARD(EwkViewHostMsg_HitTestAsyncReply, private_,
WebViewBrowserMessageFilterPrivate::OnReceivedHitTestAsyncData)
- IPC_MESSAGE_FORWARD(EwkViewMsg_DidFailLoadWithError, private_,
- WebViewBrowserMessageFilterPrivate::OnReceivedDidFailLoadWithError)
IPC_MESSAGE_FORWARD(EwkHostMsg_PlainTextGetContents, private_,
WebViewBrowserMessageFilterPrivate::OnPlainTextGetContents)
IPC_MESSAGE_FORWARD(EwkHostMsg_HandleTapGestureWithContext, private_,
+++ /dev/null
-// Copyright (c) 2014 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.
-
-#ifndef ERROR_PARAMS_H_
-#define ERROR_PARAMS_H_
-
-#include <string>
-#include "url/gurl.h"
-
-struct ErrorParams {
- GURL url;
- bool is_main_frame;
- int code;
- std::string description;
- std::string domain;
-};
-
-#endif // ERROR_PARAMS_H_
#include "base/values.h"
#include "common/print_pages_params.h"
#include "common/hit_test_params.h"
-#include "common/error_params.h"
#include "common/cache_params_efl.h"
#include "common/navigation_policy_params.h"
#include "common/web_preferences_efl.h"
IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically_ewk)
IPC_STRUCT_TRAITS_END()
-IPC_STRUCT_TRAITS_BEGIN(ErrorParams)
- IPC_STRUCT_TRAITS_MEMBER(url)
- IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
- IPC_STRUCT_TRAITS_MEMBER(code)
- IPC_STRUCT_TRAITS_MEMBER(description)
- IPC_STRUCT_TRAITS_MEMBER(domain)
-IPC_STRUCT_TRAITS_END()
-
IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data)
IPC_STRUCT_TRAITS_MEMBER(tagName)
IPC_STRUCT_TRAITS_MEMBER(nodeValue)
Hit_Test_Params,
int64_t /* request id */)
-IPC_MESSAGE_ROUTED1(EwkViewMsg_DidFailLoadWithError,
- ErrorParams /* error */)
-
IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
std::string, /* policy */
Ewk_CSP_Header_Type /* header type */)
'common/content_switches_efl.cc',
'common/content_switches_efl.h',
'common/editing_messages.h',
- 'common/error_params.h',
'common/hit_test_params.h',
'common/message_generator_ewk.h',
'common/message_generator_ewk.cc',
web_contents_->GetController().LoadURLWithParams(data_params);
}
-void EWebView::InvokeLoadError(const ErrorParams &error) {
- if (error.is_main_frame) {
- scoped_ptr<_Ewk_Error> err(new _Ewk_Error(error.code,
- error.url.possibly_invalid_spec().c_str(), error.description.c_str()));
+void EWebView::InvokeLoadError(const GURL& url, int error_code,
+ const std::string& error_description, bool is_main_frame) {
+ if (!is_main_frame)
+ return;
- SmartCallback<EWebViewCallbacks::LoadError>().call(err.get());
- }
+ scoped_ptr<_Ewk_Error> err(new _Ewk_Error(error_code,
+ url.possibly_invalid_spec().c_str(), error_description.c_str()));
+
+ SmartCallback<EWebViewCallbacks::LoadError>().call(err.get());
}
void EWebView::ShowPopupMenu(const std::vector<content::MenuItem>& items,
void LoadHTMLString(const char* html, const char* base_uri, const char* unreachable_uri);
void LoadPlainTextString(const char* plain_text);
void LoadData(const char* data, size_t size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri = NULL);
- void InvokeLoadError(const ErrorParams &error);
+
+ void InvokeLoadError(const GURL& url, int error_code,
+ const std::string& error_description, bool is_main_frame);
void InvokeAuthCallback(LoginDelegateEfl* login_delegate, const GURL& url, const std::string& realm);
void Find(const char* text, Ewk_Find_Options);
void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
Send(new EwkHostMsg_DidChangePageScaleFactor(render_view()->GetRoutingID(), view->pageScaleFactor()));
}
-void RenderViewObserverEfl::DidFailLoad(blink::WebLocalFrame* frame,
- const blink::WebURLError& error) {
- if (error.isCancellation)
- return;
-
- base::string16 error_description;
-
-#if !defined(EWK_BRINGUP)
-// [M48_2564] Temporary disabling the codes for switching to new chromium
-// FIXME: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=15386
- WebDataSource* ds = frame->dataSource();
- DCHECK(ds);
-
- const WebURLRequest& failed_request = ds->request();
-
- renderer_client_->GetNavigationErrorStrings(
- render_view(),
- frame,
- failed_request,
- error,
- NULL,
- &error_description);
-#endif
-
- ErrorParams err;
- err.url = error.unreachableURL;
- err.is_main_frame = !frame->parent();
- err.code = error.reason;
- err.description = base::UTF16ToUTF8(error_description);
- err.domain = error.domain.utf8();
-
- Send(new EwkViewMsg_DidFailLoadWithError(routing_id(), err));
-}
-
void RenderViewObserverEfl::DidUpdateLayout()
{
// Check if the timer is already running
bool OnMessageReceived(const IPC::Message& message) override;
virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) override;
virtual void DidChangePageScaleFactor() override;
- void DidFailLoad(blink::WebLocalFrame* frame,
- const blink::WebURLError& error) override;
- void DidFailProvisionalLoad(blink::WebLocalFrame* frame,
- const blink::WebURLError& error) override { DidFailLoad(frame, error); }
//Changes in PageScaleFactorLimits are applied when layoutUpdated is called
//So using this notification to update minimum and maximum page scale factor values
return handled;
}
+void WebContentsDelegateEfl::DidFailProvisionalLoad(
+ RenderFrameHost* render_frame_host, const GURL& validated_url,
+ int error_code, const base::string16& error_description,
+ bool was_ignored_by_handler) {
+ DidFailLoad(render_frame_host, validated_url, error_code,
+ error_description, was_ignored_by_handler);
+}
+
+void WebContentsDelegateEfl::DidFailLoad(RenderFrameHost* render_frame_host,
+ const GURL& validated_url, int error_code,
+ const base::string16& error_description, bool was_ignored_by_handler) {
+ bool is_main_frame = !render_frame_host->GetParent();
+ std::string description = base::UTF16ToUTF8(error_description);
+ web_view_->InvokeLoadError(validated_url, error_code, description, is_main_frame);
+}
+
void WebContentsDelegateEfl::OnWrtPluginMessage(const Ewk_Wrt_Message_Data& data) {
scoped_ptr<Ewk_Wrt_Message_Data> p(new Ewk_Wrt_Message_Data);
p->type = data.type;
void TitleWasSet(content::NavigationEntry* entry,
bool explicit_set) override;
+
+ // WebContentsObserver---------------------------------------------------
+
+ void DidFailProvisionalLoad(
+ RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code,
+ const base::string16& error_description,
+ bool was_ignored_by_handler) override;
+
+ void DidFailLoad(RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code,
+ const base::string16& error_description,
+ bool was_ignored_by_handler) override;
+
private:
void OnGetContentSecurityPolicy(IPC::Message* reply_msg);
void OnWrtPluginMessage(const Ewk_Wrt_Message_Data& data);