Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / renderer / accessibility / renderer_accessibility.cc
blob1bf402267815b09443aad20f6415c70ce24dc527
1 // Copyright (c) 2012 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.
5 #include "content/renderer/accessibility/renderer_accessibility.h"
7 #include "content/renderer/render_frame_impl.h"
8 #include "content/renderer/render_view_impl.h"
9 #include "third_party/WebKit/public/web/WebDocument.h"
10 #include "third_party/WebKit/public/web/WebFrame.h"
11 #include "third_party/WebKit/public/web/WebView.h"
13 using blink::WebDocument;
14 using blink::WebFrame;
15 using blink::WebView;
17 namespace content {
19 RendererAccessibility::RendererAccessibility(
20 RenderFrameImpl* render_frame)
21 : RenderFrameObserver(render_frame),
22 render_frame_(render_frame) {
25 RendererAccessibility::~RendererAccessibility() {
28 WebDocument RendererAccessibility::GetMainDocument() {
29 WebView* view = render_frame_->render_view()->GetWebView();
30 WebFrame* main_frame = view ? view->mainFrame() : NULL;
32 if (main_frame)
33 return main_frame->document();
35 return WebDocument();
38 } // namespace content