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" |
25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/browser/render_process_host.h" |
26 #include "content/public/browser/render_view_host.h" | 28 #include "content/public/browser/render_view_host.h" |
27 #include "content/public/browser/user_metrics.h" | 29 #include "content/public/browser/user_metrics.h" |
28 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
32 #include "ui/aura/client/aura_constants.h" | 34 #include "ui/aura/client/aura_constants.h" |
33 #include "ui/aura/client/cursor_client.h" | 35 #include "ui/aura/client/cursor_client.h" |
34 #include "ui/aura/client/focus_client.h" | 36 #include "ui/aura/client/focus_client.h" |
35 #include "ui/aura/client/screen_position_client.h" | 37 #include "ui/aura/client/screen_position_client.h" |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 676 |
675 void RenderWidgetHostViewAura::SelectionChanged(const string16& text, | 677 void RenderWidgetHostViewAura::SelectionChanged(const string16& text, |
676 size_t offset, | 678 size_t offset, |
677 const ui::Range& range) { | 679 const ui::Range& range) { |
678 RenderWidgetHostViewBase::SelectionChanged(text, offset, range); | 680 RenderWidgetHostViewBase::SelectionChanged(text, offset, range); |
679 | 681 |
680 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 682 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
681 if (text.empty() || range.is_empty()) | 683 if (text.empty() || range.is_empty()) |
682 return; | 684 return; |
683 | 685 |
| 686 BrowserContext* browser_context = host_->GetProcess()->GetBrowserContext(); |
684 // Set the BUFFER_SELECTION to the ui::Clipboard. | 687 // Set the BUFFER_SELECTION to the ui::Clipboard. |
685 ui::ScopedClipboardWriter clipboard_writer( | 688 ui::ScopedClipboardWriter clipboard_writer( |
686 ui::Clipboard::GetForCurrentThread(), | 689 ui::Clipboard::GetForCurrentThread(), |
687 ui::Clipboard::BUFFER_SELECTION); | 690 ui::Clipboard::BUFFER_SELECTION, |
| 691 BrowserContext::GetMarkerForOffTheRecordContext(browser_context)); |
688 clipboard_writer.WriteText(text); | 692 clipboard_writer.WriteText(text); |
689 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) | 693 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) |
690 } | 694 } |
691 | 695 |
692 void RenderWidgetHostViewAura::SelectionBoundsChanged( | 696 void RenderWidgetHostViewAura::SelectionBoundsChanged( |
693 const ViewHostMsg_SelectionBounds_Params& params) { | 697 const ViewHostMsg_SelectionBounds_Params& params) { |
694 if (selection_anchor_rect_ == params.anchor_rect && | 698 if (selection_anchor_rect_ == params.anchor_rect && |
695 selection_focus_rect_ == params.focus_rect) | 699 selection_focus_rect_ == params.focus_rect) |
696 return; | 700 return; |
697 | 701 |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2059 RenderWidgetHost* widget) { | 2063 RenderWidgetHost* widget) { |
2060 return new RenderWidgetHostViewAura(widget); | 2064 return new RenderWidgetHostViewAura(widget); |
2061 } | 2065 } |
2062 | 2066 |
2063 // static | 2067 // static |
2064 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 2068 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
2065 GetScreenInfoForWindow(results, NULL); | 2069 GetScreenInfoForWindow(results, NULL); |
2066 } | 2070 } |
2067 | 2071 |
2068 } // namespace content | 2072 } // namespace content |
OLD | NEW |