| 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 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 end.x() - origin.x(), | 1472 end.x() - origin.x(), |
| 1473 end.y() - origin.y()); | 1473 end.y() - origin.y()); |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 return rect; | 1476 return rect; |
| 1477 } | 1477 } |
| 1478 | 1478 |
| 1479 gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() const { | 1479 gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() const { |
| 1480 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) | 1480 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) |
| 1481 return gfx::Rect(); | 1481 return gfx::Rect(); |
| 1482 return ConvertRectToScreen(text_input_manager_->GetSelectionBoundsRect()); | 1482 |
| 1483 const TextInputManager::SelectionRegion* region = |
| 1484 text_input_manager_->GetSelectionRegion(); |
| 1485 return ConvertRectToScreen( |
| 1486 gfx::RectBetweenSelectionBounds(region->anchor, region->focus)); |
| 1483 } | 1487 } |
| 1484 | 1488 |
| 1485 bool RenderWidgetHostViewAura::GetCompositionCharacterBounds( | 1489 bool RenderWidgetHostViewAura::GetCompositionCharacterBounds( |
| 1486 uint32_t index, | 1490 uint32_t index, |
| 1487 gfx::Rect* rect) const { | 1491 gfx::Rect* rect) const { |
| 1488 DCHECK(rect); | 1492 DCHECK(rect); |
| 1489 | 1493 |
| 1490 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) | 1494 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) |
| 1491 return false; | 1495 return false; |
| 1492 | 1496 |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3052 return; | 3056 return; |
| 3053 } | 3057 } |
| 3054 | 3058 |
| 3055 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 3059 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
| 3056 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 3060 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
| 3057 clipboard_writer.WriteText(text_selection->text.substr(pos, n)); | 3061 clipboard_writer.WriteText(text_selection->text.substr(pos, n)); |
| 3058 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 3062 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 3059 } | 3063 } |
| 3060 | 3064 |
| 3061 } // namespace content | 3065 } // namespace content |
| OLD | NEW |