| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "ui/aura/client/aura_constants.h" | 30 #include "ui/aura/client/aura_constants.h" |
| 31 #include "ui/aura/client/cursor_client.h" | 31 #include "ui/aura/client/cursor_client.h" |
| 32 #include "ui/aura/client/screen_position_client.h" | 32 #include "ui/aura/client/screen_position_client.h" |
| 33 #include "ui/aura/client/stacking_client.h" | 33 #include "ui/aura/client/stacking_client.h" |
| 34 #include "ui/aura/client/tooltip_client.h" | 34 #include "ui/aura/client/tooltip_client.h" |
| 35 #include "ui/aura/client/window_types.h" | 35 #include "ui/aura/client/window_types.h" |
| 36 #include "ui/aura/env.h" | 36 #include "ui/aura/env.h" |
| 37 #include "ui/aura/root_window.h" | 37 #include "ui/aura/root_window.h" |
| 38 #include "ui/aura/window.h" | 38 #include "ui/aura/window.h" |
| 39 #include "ui/aura/window_observer.h" | 39 #include "ui/aura/window_observer.h" |
| 40 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 40 #include "ui/base/events/event.h" | 41 #include "ui/base/events/event.h" |
| 41 #include "ui/base/gestures/gesture_recognizer.h" | 42 #include "ui/base/gestures/gesture_recognizer.h" |
| 42 #include "ui/base/hit_test.h" | 43 #include "ui/base/hit_test.h" |
| 43 #include "ui/base/ime/input_method.h" | 44 #include "ui/base/ime/input_method.h" |
| 44 #include "ui/base/ui_base_types.h" | 45 #include "ui/base/ui_base_types.h" |
| 45 #include "ui/compositor/compositor.h" | 46 #include "ui/compositor/compositor.h" |
| 46 #include "ui/compositor/layer.h" | 47 #include "ui/compositor/layer.h" |
| 47 #include "ui/gfx/canvas.h" | 48 #include "ui/gfx/canvas.h" |
| 48 #include "ui/gfx/display.h" | 49 #include "ui/gfx/display.h" |
| 49 #include "ui/gfx/screen.h" | 50 #include "ui/gfx/screen.h" |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 delete window_; | 519 delete window_; |
| 519 } | 520 } |
| 520 | 521 |
| 521 void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) { | 522 void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) { |
| 522 tooltip_ = tooltip_text; | 523 tooltip_ = tooltip_text; |
| 523 aura::RootWindow* root_window = window_->GetRootWindow(); | 524 aura::RootWindow* root_window = window_->GetRootWindow(); |
| 524 if (aura::client::GetTooltipClient(root_window)) | 525 if (aura::client::GetTooltipClient(root_window)) |
| 525 aura::client::GetTooltipClient(root_window)->UpdateTooltip(window_); | 526 aura::client::GetTooltipClient(root_window)->UpdateTooltip(window_); |
| 526 } | 527 } |
| 527 | 528 |
| 529 void RenderWidgetHostViewAura::SelectionChanged(const string16& text, |
| 530 size_t offset, |
| 531 const ui::Range& range) { |
| 532 RenderWidgetHostViewBase::SelectionChanged(text, offset, range); |
| 533 |
| 534 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 535 if (text.empty() || range.is_empty()) |
| 536 return; |
| 537 |
| 538 // Set the BUFFER_SELECTION to the ui::Clipboard. |
| 539 ui::ScopedClipboardWriter clipboard_writer( |
| 540 ui::Clipboard::GetForCurrentThread(), |
| 541 ui::Clipboard::BUFFER_SELECTION); |
| 542 clipboard_writer.WriteText(text); |
| 543 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 544 } |
| 545 |
| 528 void RenderWidgetHostViewAura::SelectionBoundsChanged( | 546 void RenderWidgetHostViewAura::SelectionBoundsChanged( |
| 529 const gfx::Rect& start_rect, | 547 const gfx::Rect& start_rect, |
| 530 WebKit::WebTextDirection start_direction, | 548 WebKit::WebTextDirection start_direction, |
| 531 const gfx::Rect& end_rect, | 549 const gfx::Rect& end_rect, |
| 532 WebKit::WebTextDirection end_direction) { | 550 WebKit::WebTextDirection end_direction) { |
| 533 if (selection_start_rect_ == start_rect && selection_end_rect_ == end_rect) | 551 if (selection_start_rect_ == start_rect && selection_end_rect_ == end_rect) |
| 534 return; | 552 return; |
| 535 | 553 |
| 536 selection_start_rect_ = start_rect; | 554 selection_start_rect_ = start_rect; |
| 537 selection_end_rect_ = end_rect; | 555 selection_end_rect_ = end_rect; |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 RenderWidgetHost* widget) { | 1774 RenderWidgetHost* widget) { |
| 1757 return new RenderWidgetHostViewAura(widget); | 1775 return new RenderWidgetHostViewAura(widget); |
| 1758 } | 1776 } |
| 1759 | 1777 |
| 1760 // static | 1778 // static |
| 1761 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 1779 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 1762 GetScreenInfoForWindow(results, NULL); | 1780 GetScreenInfoForWindow(results, NULL); |
| 1763 } | 1781 } |
| 1764 | 1782 |
| 1765 } // namespace content | 1783 } // namespace content |
| OLD | NEW |