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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::ShowContextMenu( | 155 void WebContentsViewAndroid::ShowContextMenu( |
156 const ContextMenuParams& params, | 156 const ContextMenuParams& params, |
157 content::ContextMenuSourceType type) { | 157 ContextMenuSourceType type) { |
158 if (delegate_.get()) | 158 if (delegate_.get()) |
159 delegate_->ShowContextMenu(params, type); | 159 delegate_->ShowContextMenu(params, type); |
160 } | 160 } |
161 | 161 |
162 void WebContentsViewAndroid::ShowPopupMenu( | 162 void WebContentsViewAndroid::ShowPopupMenu( |
163 const gfx::Rect& bounds, | 163 const gfx::Rect& bounds, |
164 int item_height, | 164 int item_height, |
165 double item_font_size, | 165 double item_font_size, |
166 int selected_item, | 166 int selected_item, |
167 const std::vector<WebMenuItem>& items, | 167 const std::vector<WebMenuItem>& items, |
(...skipping 25 matching lines...) Expand all Loading... |
193 // 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 |
194 // iterated past the last focusable element on the page). | 194 // iterated past the last focusable element on the page). |
195 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 195 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
196 if (web_contents_->GetDelegate() && | 196 if (web_contents_->GetDelegate() && |
197 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 197 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
198 return; | 198 return; |
199 web_contents_->GetRenderWidgetHostView()->Focus(); | 199 web_contents_->GetRenderWidgetHostView()->Focus(); |
200 } | 200 } |
201 | 201 |
202 } // namespace content | 202 } // namespace content |
OLD | NEW |