OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/web_contents/web_contents_view_android.h" | 5 #include "content/browser/web_contents/web_contents_view_android.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/android/content_view_core_impl.h" | 8 #include "content/browser/android/content_view_core_impl.h" |
9 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 9 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
10 #include "content/browser/renderer_host/render_view_host_factory.h" | 10 #include "content/browser/renderer_host/render_view_host_factory.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { | 72 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { |
73 return content_view_core_; | 73 return content_view_core_; |
74 } | 74 } |
75 | 75 |
76 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { | 76 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { |
77 return content_view_core_; | 77 return content_view_core_; |
78 } | 78 } |
79 | 79 |
80 gfx::NativeWindow WebContentsViewAndroid::GetTopLevelNativeWindow() const { | 80 gfx::NativeWindow WebContentsViewAndroid::GetTopLevelNativeWindow() const { |
81 return content_view_core_; | 81 return content_view_core_->GetWindowAndroid(); |
82 } | 82 } |
83 | 83 |
84 void WebContentsViewAndroid::GetContainerBounds(gfx::Rect* out) const { | 84 void WebContentsViewAndroid::GetContainerBounds(gfx::Rect* out) const { |
85 if (content_view_core_) | 85 if (content_view_core_) |
86 *out = content_view_core_->GetBounds(); | 86 *out = content_view_core_->GetBounds(); |
87 } | 87 } |
88 | 88 |
89 void WebContentsViewAndroid::SetPageTitle(const string16& title) { | 89 void WebContentsViewAndroid::SetPageTitle(const string16& title) { |
90 if (content_view_core_) | 90 if (content_view_core_) |
91 content_view_core_->SetTitle(title); | 91 content_view_core_->SetTitle(title); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // This is called when we the renderer asks us to take focus back (i.e., it has | 199 // This is called when we the renderer asks us to take focus back (i.e., it has |
200 // iterated past the last focusable element on the page). | 200 // iterated past the last focusable element on the page). |
201 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 201 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
202 if (web_contents_->GetDelegate() && | 202 if (web_contents_->GetDelegate() && |
203 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 203 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
204 return; | 204 return; |
205 web_contents_->GetRenderWidgetHostView()->Focus(); | 205 web_contents_->GetRenderWidgetHostView()->Focus(); |
206 } | 206 } |
207 | 207 |
208 } // namespace content | 208 } // namespace content |
OLD | NEW |