| 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/frame_host/interstitial_page_impl.h" | 9 #include "content/browser/frame_host/interstitial_page_impl.h" |
| 10 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) { | 156 void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) { |
| 157 } | 157 } |
| 158 | 158 |
| 159 void WebContentsViewAndroid::ShowContextMenu( | 159 void WebContentsViewAndroid::ShowContextMenu( |
| 160 RenderFrameHost* render_frame_host, const ContextMenuParams& params) { | 160 RenderFrameHost* render_frame_host, const ContextMenuParams& params) { |
| 161 if (delegate_) | 161 if (delegate_) |
| 162 delegate_->ShowContextMenu(render_frame_host, params); | 162 delegate_->ShowContextMenu(render_frame_host, params); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void WebContentsViewAndroid::ShowPopupMenu( | 165 void WebContentsViewAndroid::ShowPopupMenu( |
| 166 RenderFrameHost* render_frame_host, |
| 166 const gfx::Rect& bounds, | 167 const gfx::Rect& bounds, |
| 167 int item_height, | 168 int item_height, |
| 168 double item_font_size, | 169 double item_font_size, |
| 169 int selected_item, | 170 int selected_item, |
| 170 const std::vector<MenuItem>& items, | 171 const std::vector<MenuItem>& items, |
| 171 bool right_aligned, | 172 bool right_aligned, |
| 172 bool allow_multiple_selection) { | 173 bool allow_multiple_selection) { |
| 173 if (content_view_core_) { | 174 if (content_view_core_) { |
| 174 content_view_core_->ShowSelectPopupMenu( | 175 content_view_core_->ShowSelectPopupMenu(render_frame_host, |
| 175 bounds, items, selected_item, allow_multiple_selection); | 176 bounds, |
| 177 items, |
| 178 selected_item, |
| 179 allow_multiple_selection); |
| 176 } | 180 } |
| 177 } | 181 } |
| 178 | 182 |
| 179 void WebContentsViewAndroid::HidePopupMenu() { | 183 void WebContentsViewAndroid::HidePopupMenu() { |
| 180 if (content_view_core_) | 184 if (content_view_core_) |
| 181 content_view_core_->HideSelectPopupMenu(); | 185 content_view_core_->HideSelectPopupMenu(); |
| 182 } | 186 } |
| 183 | 187 |
| 184 void WebContentsViewAndroid::StartDragging( | 188 void WebContentsViewAndroid::StartDragging( |
| 185 const DropData& drop_data, | 189 const DropData& drop_data, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 202 // This is called when we the renderer asks us to take focus back (i.e., it has | 206 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 203 // iterated past the last focusable element on the page). | 207 // iterated past the last focusable element on the page). |
| 204 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 208 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 205 if (web_contents_->GetDelegate() && | 209 if (web_contents_->GetDelegate() && |
| 206 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 210 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 207 return; | 211 return; |
| 208 web_contents_->GetRenderWidgetHostView()->Focus(); | 212 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 209 } | 213 } |
| 210 | 214 |
| 211 } // namespace content | 215 } // namespace content |
| OLD | NEW |