• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/WebLocalFrame.h"
10 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
11 
12 namespace android_webview {
13 
AwRenderFrameExt(content::RenderFrame * render_frame)14 AwRenderFrameExt::AwRenderFrameExt(content::RenderFrame* render_frame)
15     : content::RenderFrameObserver(render_frame) {
16 }
17 
~AwRenderFrameExt()18 AwRenderFrameExt::~AwRenderFrameExt() {
19 }
20 
DidCommitProvisionalLoad(bool is_new_navigation)21 void AwRenderFrameExt::DidCommitProvisionalLoad(bool is_new_navigation) {
22   blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
23   content::DocumentState* document_state =
24       content::DocumentState::FromDataSource(frame->dataSource());
25   if (document_state->can_load_local_resources()) {
26     blink::WebSecurityOrigin origin = frame->document().securityOrigin();
27     origin.grantLoadLocalResources();
28   }
29 }
30 
31 }
32 
33 
34