| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 gfx::Rect WebContentsViewAndroid::GetViewBounds() const { | 147 gfx::Rect WebContentsViewAndroid::GetViewBounds() const { |
| 148 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 148 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
| 149 if (rwhv) | 149 if (rwhv) |
| 150 return rwhv->GetViewBounds(); | 150 return rwhv->GetViewBounds(); |
| 151 else | 151 else |
| 152 return gfx::Rect(); | 152 return gfx::Rect(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void WebContentsViewAndroid::ConfirmTouchEvent(bool handled) { | |
| 156 if (content_view_core_) | |
| 157 content_view_core_->ConfirmTouchEvent(handled); | |
| 158 } | |
| 159 | |
| 160 void WebContentsViewAndroid::ShowContextMenu( | 155 void WebContentsViewAndroid::ShowContextMenu( |
| 161 const ContextMenuParams& params, | 156 const ContextMenuParams& params, |
| 162 content::ContextMenuSourceType type) { | 157 content::ContextMenuSourceType type) { |
| 163 if (delegate_.get()) | 158 if (delegate_.get()) |
| 164 delegate_->ShowContextMenu(params, type); | 159 delegate_->ShowContextMenu(params, type); |
| 165 } | 160 } |
| 166 | 161 |
| 167 void WebContentsViewAndroid::ShowPopupMenu( | 162 void WebContentsViewAndroid::ShowPopupMenu( |
| 168 const gfx::Rect& bounds, | 163 const gfx::Rect& bounds, |
| 169 int item_height, | 164 int item_height, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 198 // This is called when we the renderer asks us to take focus back (i.e., it has | 193 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 199 // iterated past the last focusable element on the page). | 194 // iterated past the last focusable element on the page). |
| 200 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 195 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 201 if (web_contents_->GetDelegate() && | 196 if (web_contents_->GetDelegate() && |
| 202 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 197 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 203 return; | 198 return; |
| 204 web_contents_->GetRenderWidgetHostView()->Focus(); | 199 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 205 } | 200 } |
| 206 | 201 |
| 207 } // namespace content | 202 } // namespace content |
| OLD | NEW |