| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "content/browser/renderer_host/backing_store_aura.h" | 14 #include "content/browser/renderer_host/backing_store_aura.h" |
| 15 #include "content/browser/renderer_host/dip_util.h" | 15 #include "content/browser/renderer_host/dip_util.h" |
| 16 #include "content/browser/renderer_host/overscroll_controller.h" | 16 #include "content/browser/renderer_host/overscroll_controller.h" |
| 17 #include "content/browser/renderer_host/render_view_host_delegate.h" | 17 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 18 #include "content/browser/renderer_host/render_widget_host_impl.h" | 18 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 19 #include "content/browser/renderer_host/ui_events_helper.h" | 19 #include "content/browser/renderer_host/ui_events_helper.h" |
| 20 #include "content/browser/renderer_host/web_input_event_aura.h" | 20 #include "content/browser/renderer_host/web_input_event_aura.h" |
| 21 #include "content/common/gpu/client/gl_helper.h" | 21 #include "content/common/gpu/client/gl_helper.h" |
| 22 #include "content/common/gpu/gpu_messages.h" | 22 #include "content/common/gpu/gpu_messages.h" |
| 23 #include "content/common/view_messages.h" | 23 #include "content/common/view_messages.h" |
| 24 #include "content/port/browser/render_widget_host_view_port.h" | 24 #include "content/port/browser/render_widget_host_view_port.h" |
| 25 #include "content/public/browser/browser_context.h" | |
| 26 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/browser/render_process_host.h" | |
| 28 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
| 29 #include "content/public/browser/user_metrics.h" | 27 #include "content/public/browser/user_metrics.h" |
| 30 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
| 34 #include "ui/aura/client/activation_client.h" | 32 #include "ui/aura/client/activation_client.h" |
| 35 #include "ui/aura/client/aura_constants.h" | 33 #include "ui/aura/client/aura_constants.h" |
| 36 #include "ui/aura/client/cursor_client.h" | 34 #include "ui/aura/client/cursor_client.h" |
| 37 #include "ui/aura/client/focus_client.h" | 35 #include "ui/aura/client/focus_client.h" |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 | 866 |
| 869 void RenderWidgetHostViewAura::SelectionChanged(const string16& text, | 867 void RenderWidgetHostViewAura::SelectionChanged(const string16& text, |
| 870 size_t offset, | 868 size_t offset, |
| 871 const ui::Range& range) { | 869 const ui::Range& range) { |
| 872 RenderWidgetHostViewBase::SelectionChanged(text, offset, range); | 870 RenderWidgetHostViewBase::SelectionChanged(text, offset, range); |
| 873 | 871 |
| 874 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 872 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 875 if (text.empty() || range.is_empty()) | 873 if (text.empty() || range.is_empty()) |
| 876 return; | 874 return; |
| 877 | 875 |
| 878 BrowserContext* browser_context = host_->GetProcess()->GetBrowserContext(); | |
| 879 // Set the BUFFER_SELECTION to the ui::Clipboard. | 876 // Set the BUFFER_SELECTION to the ui::Clipboard. |
| 880 ui::ScopedClipboardWriter clipboard_writer( | 877 ui::ScopedClipboardWriter clipboard_writer( |
| 881 ui::Clipboard::GetForCurrentThread(), | 878 ui::Clipboard::GetForCurrentThread(), |
| 882 ui::Clipboard::BUFFER_SELECTION, | 879 ui::Clipboard::BUFFER_SELECTION); |
| 883 BrowserContext::GetMarkerForOffTheRecordContext(browser_context)); | |
| 884 clipboard_writer.WriteText(text); | 880 clipboard_writer.WriteText(text); |
| 885 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 881 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
| 886 } | 882 } |
| 887 | 883 |
| 888 void RenderWidgetHostViewAura::SelectionBoundsChanged( | 884 void RenderWidgetHostViewAura::SelectionBoundsChanged( |
| 889 const ViewHostMsg_SelectionBounds_Params& params) { | 885 const ViewHostMsg_SelectionBounds_Params& params) { |
| 890 if (selection_anchor_rect_ == params.anchor_rect && | 886 if (selection_anchor_rect_ == params.anchor_rect && |
| 891 selection_focus_rect_ == params.focus_rect) | 887 selection_focus_rect_ == params.focus_rect) |
| 892 return; | 888 return; |
| 893 | 889 |
| (...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2290 RenderWidgetHost* widget) { | 2286 RenderWidgetHost* widget) { |
| 2291 return new RenderWidgetHostViewAura(widget); | 2287 return new RenderWidgetHostViewAura(widget); |
| 2292 } | 2288 } |
| 2293 | 2289 |
| 2294 // static | 2290 // static |
| 2295 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 2291 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2296 GetScreenInfoForWindow(results, NULL); | 2292 GetScreenInfoForWindow(results, NULL); |
| 2297 } | 2293 } |
| 2298 | 2294 |
| 2299 } // namespace content | 2295 } // namespace content |
| OLD | NEW |