OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/touch_editable_impl_aura.h" | 5 #include "content/browser/web_contents/touch_editable_impl_aura.h" |
6 | 6 |
7 #include "content/browser/renderer_host/render_widget_host_impl.h" | 7 #include "content/browser/renderer_host/render_widget_host_impl.h" |
8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/public/browser/render_widget_host.h" | 10 #include "content/public/browser/render_widget_host.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 *p1 = selection_anchor_rect_; | 248 *p1 = selection_anchor_rect_; |
249 *p2 = selection_focus_rect_; | 249 *p2 = selection_focus_rect_; |
250 } | 250 } |
251 | 251 |
252 gfx::Rect TouchEditableImplAura::GetBounds() { | 252 gfx::Rect TouchEditableImplAura::GetBounds() { |
253 return rwhva_ ? gfx::Rect(rwhva_->GetNativeView()->bounds().size()) : | 253 return rwhva_ ? gfx::Rect(rwhva_->GetNativeView()->bounds().size()) : |
254 gfx::Rect(); | 254 gfx::Rect(); |
255 } | 255 } |
256 | 256 |
257 gfx::NativeView TouchEditableImplAura::GetNativeView() const { | 257 gfx::NativeView TouchEditableImplAura::GetNativeView() const { |
258 return rwhva_ ? rwhva_->GetNativeView()->GetRootWindow() : NULL; | 258 return rwhva_ ? rwhva_->GetNativeView()->GetToplevelWindow() : NULL; |
259 } | 259 } |
260 | 260 |
261 void TouchEditableImplAura::ConvertPointToScreen(gfx::Point* point) { | 261 void TouchEditableImplAura::ConvertPointToScreen(gfx::Point* point) { |
262 if (!rwhva_) | 262 if (!rwhva_) |
263 return; | 263 return; |
264 aura::Window* window = rwhva_->GetNativeView(); | 264 aura::Window* window = rwhva_->GetNativeView(); |
265 aura::client::ScreenPositionClient* screen_position_client = | 265 aura::client::ScreenPositionClient* screen_position_client = |
266 aura::client::GetScreenPositionClient(window->GetRootWindow()); | 266 aura::client::GetScreenPositionClient(window->GetRootWindow()); |
267 if (screen_position_client) | 267 if (screen_position_client) |
268 screen_position_client->ConvertPointToScreen(window, point); | 268 screen_position_client->ConvertPointToScreen(window, point); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 rwhva_ = NULL; | 376 rwhva_ = NULL; |
377 } | 377 } |
378 text_input_type_ = ui::TEXT_INPUT_TYPE_NONE; | 378 text_input_type_ = ui::TEXT_INPUT_TYPE_NONE; |
379 EndTouchEditing(true); | 379 EndTouchEditing(true); |
380 handles_hidden_due_to_scroll_ = false; | 380 handles_hidden_due_to_scroll_ = false; |
381 scroll_in_progress_ = false; | 381 scroll_in_progress_ = false; |
382 overscroll_in_progress_ = false; | 382 overscroll_in_progress_ = false; |
383 } | 383 } |
384 | 384 |
385 } // namespace content | 385 } // namespace content |
OLD | NEW |