| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 NOTIMPLEMENTED(); | 151 NOTIMPLEMENTED(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 gfx::Rect WebContentsViewAndroid::GetViewBounds() const { | 154 gfx::Rect WebContentsViewAndroid::GetViewBounds() const { |
| 155 if (content_view_core_) | 155 if (content_view_core_) |
| 156 return content_view_core_->GetBounds(); | 156 return content_view_core_->GetBounds(); |
| 157 else | 157 else |
| 158 return gfx::Rect(); | 158 return gfx::Rect(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void WebContentsViewAndroid::ShowContextMenu(const ContextMenuParams& params) { | 161 void WebContentsViewAndroid::ShowContextMenu( |
| 162 const ContextMenuParams& params, |
| 163 const content::ContextMenuEventType& type) { |
| 162 if (delegate_.get()) | 164 if (delegate_.get()) |
| 163 delegate_->ShowContextMenu(params); | 165 delegate_->ShowContextMenu(params, type); |
| 164 } | 166 } |
| 165 | 167 |
| 166 void WebContentsViewAndroid::ShowPopupMenu( | 168 void WebContentsViewAndroid::ShowPopupMenu( |
| 167 const gfx::Rect& bounds, | 169 const gfx::Rect& bounds, |
| 168 int item_height, | 170 int item_height, |
| 169 double item_font_size, | 171 double item_font_size, |
| 170 int selected_item, | 172 int selected_item, |
| 171 const std::vector<WebMenuItem>& items, | 173 const std::vector<WebMenuItem>& items, |
| 172 bool right_aligned, | 174 bool right_aligned, |
| 173 bool allow_multiple_selection) { | 175 bool allow_multiple_selection) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 197 // 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 |
| 198 // iterated past the last focusable element on the page). | 200 // iterated past the last focusable element on the page). |
| 199 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 201 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 200 if (web_contents_->GetDelegate() && | 202 if (web_contents_->GetDelegate() && |
| 201 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 203 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 202 return; | 204 return; |
| 203 web_contents_->GetRenderWidgetHostView()->Focus(); | 205 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 204 } | 206 } |
| 205 | 207 |
| 206 } // namespace content | 208 } // namespace content |
| OLD | NEW |