Home | History | Annotate | Download | only in renderer
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "android_webview/renderer/aw_render_frame_ext.h"
      6 #include "content/public/renderer/document_state.h"
      7 #include "content/public/renderer/render_frame.h"
      8 #include "third_party/WebKit/public/web/WebDocument.h"
      9 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
     10 
     11 namespace android_webview {
     12 
     13 AwRenderFrameExt::AwRenderFrameExt(content::RenderFrame* render_frame)
     14     : content::RenderFrameObserver(render_frame) {
     15 }
     16 
     17 AwRenderFrameExt::~AwRenderFrameExt() {
     18 }
     19 
     20 void AwRenderFrameExt::DidCommitProvisionalLoad(bool is_new_navigation) {
     21   blink::WebFrame* frame = render_frame()->GetWebFrame();
     22   content::DocumentState* document_state =
     23       content::DocumentState::FromDataSource(frame->dataSource());
     24   if (document_state->can_load_local_resources()) {
     25     blink::WebSecurityOrigin origin = frame->document().securityOrigin();
     26     origin.grantLoadLocalResources();
     27   }
     28 }
     29 
     30 }
     31 
     32 
     33