#include "net/url_request/url_request_context.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
+#include "tizen/common/env_variables.h"
#include "ui/display/screen.h"
#if defined(USE_EFL)
type_(type),
request_id_(0),
background_throttling_(true),
- enable_devtools_(true) {
+ enable_devtools_(true),
+ notify_ready_state_(false) {
if (type == REMOTE) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
Init(isolate);
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) {
- v8::Locker locker(isolate());
+ if (!::tizen::is_single_process)
+ v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents, BROWSER_WINDOW);
Emit("-web-contents-created", api_web_contents, target_url, frame_name);
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
- v8::Locker locker(isolate());
+ if (!::tizen::is_single_process)
+ v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents);
if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
if (!final_update)
return;
- v8::Locker locker(isolate());
+ if (!::tizen::is_single_process)
+ v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
mate::Dictionary result = mate::Dictionary::CreateEmpty(isolate());
result.Set("requestId", request_id);
render_view_host->GetRoutingID());
if (impl)
impl->disable_hidden_ = !background_throttling_;
+ atom::Browser::Get()->RenderViewCreated(render_view_host);
}
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
Emit("did-fail-load", error_code, error_description, url, is_main_frame);
}
+void WebContents::DidRenderFrame() {
+ if (!notify_ready_state_) {
+ notify_ready_state_ = true;
+ Emit("did-frame-rendered");
+ }
+}
+
void WebContents::DidStartLoading() {
+ notify_ready_state_ = false;
#if defined(OS_TIZEN)
if (owner_window() && !owner_window()->IsVisible()) {
std::string scheme = web_contents()->GetURL().scheme();
}
void WebContents::DevToolsOpened() {
- v8::Locker locker(isolate());
+ if (!::tizen::is_single_process)
+ v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto handle = WebContents::CreateFrom(
isolate(), managed_web_contents()->GetDevToolsWebContents());
}
void WebContents::DevToolsClosed() {
- v8::Locker locker(isolate());
+ if (!::tizen::is_single_process)
+ v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
devtools_web_contents_.Reset();
bool WebContents::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebContents, message)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(WrtViewMsg_GetCSP, OnGetContentSecurityPolicy)
IPC_MESSAGE_HANDLER(AtomViewHostMsg_Message, OnRendererMessage)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AtomViewHostMsg_Message_Sync,
OnRendererMessageSync)
return;
}
+ if (!atom::Browser::Get()->ShouldAllowNavigation(url.spec())) {
+ return;
+ }
+
content::NavigationController::LoadURLParams params(url);
GURL http_referrer;
Send(reply_msg);
}
+void WebContents::OnGetContentSecurityPolicy(IPC::Message* reply_msg) {
+ std::string csp_rule;
+ std::string csp_report_rule;
+ atom::Browser::Get()->GetCSP(csp_rule, csp_report_rule);
+ WrtViewMsg_GetCSP::WriteReplyParams(reply_msg, csp_rule, csp_report_rule);
+ Send(reply_msg);
+}
+
v8::Local<v8::Value> WebContents::GetWebPreferences(v8::Isolate* isolate) {
WebContentsPreferences* web_preferences =
WebContentsPreferences::FromWebContents(web_contents());