| 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/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 end.x() - origin.x(), | 1484 end.x() - origin.x(), |
| 1485 end.y() - origin.y()); | 1485 end.y() - origin.y()); |
| 1486 } | 1486 } |
| 1487 | 1487 |
| 1488 return rect; | 1488 return rect; |
| 1489 } | 1489 } |
| 1490 | 1490 |
| 1491 gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() const { | 1491 gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() const { |
| 1492 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) | 1492 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) |
| 1493 return gfx::Rect(); | 1493 return gfx::Rect(); |
| 1494 return ConvertRectToScreen(text_input_manager_->GetSelectionBoundsRect()); | 1494 |
| 1495 const TextInputManager::SelectionRegion* region = |
| 1496 text_input_manager_->GetSelectionRegion(); |
| 1497 return ConvertRectToScreen( |
| 1498 gfx::RectBetweenSelectionBounds(region->anchor, region->focus)); |
| 1495 } | 1499 } |
| 1496 | 1500 |
| 1497 bool RenderWidgetHostViewAura::GetCompositionCharacterBounds( | 1501 bool RenderWidgetHostViewAura::GetCompositionCharacterBounds( |
| 1498 uint32_t index, | 1502 uint32_t index, |
| 1499 gfx::Rect* rect) const { | 1503 gfx::Rect* rect) const { |
| 1500 DCHECK(rect); | 1504 DCHECK(rect); |
| 1501 | 1505 |
| 1502 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) | 1506 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) |
| 1503 return false; | 1507 return false; |
| 1504 | 1508 |
| (...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3055 ->GetTextSelection(focused_view) | 3059 ->GetTextSelection(focused_view) |
| 3056 ->GetSelectedText(&selected_text)) { | 3060 ->GetSelectedText(&selected_text)) { |
| 3057 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 3061 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
| 3058 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 3062 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
| 3059 clipboard_writer.WriteText(selected_text); | 3063 clipboard_writer.WriteText(selected_text); |
| 3060 } | 3064 } |
| 3061 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 3065 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 3062 } | 3066 } |
| 3063 | 3067 |
| 3064 } // namespace content | 3068 } // namespace content |
| OLD | NEW |