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 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2366 is_guest_view_hack_ ? this : GetFocusedWidget() | 2366 is_guest_view_hack_ ? this : GetFocusedWidget() |
2367 ? GetFocusedWidget()->GetView() | 2367 ? GetFocusedWidget()->GetView() |
2368 : nullptr; | 2368 : nullptr; |
2369 | 2369 |
2370 if (!focused_view) | 2370 if (!focused_view) |
2371 return; | 2371 return; |
2372 | 2372 |
2373 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 2373 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
2374 const TextInputManager::TextSelection* selection = | 2374 const TextInputManager::TextSelection* selection = |
2375 GetTextInputManager()->GetTextSelection(focused_view); | 2375 GetTextInputManager()->GetTextSelection(focused_view); |
2376 if (selection->selected_text().length()) { | 2376 if (selection->selected_text().length() && selection->user_initiated()) { |
2377 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 2377 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
2378 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 2378 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
2379 clipboard_writer.WriteText(selection->selected_text()); | 2379 clipboard_writer.WriteText(selection->selected_text()); |
2380 } | 2380 } |
2381 | 2381 |
2382 #elif defined(OS_WIN) | 2382 #elif defined(OS_WIN) |
2383 // Some assistive software need to track the location of the caret. | 2383 // Some assistive software need to track the location of the caret. |
2384 if (!GetRenderWidgetHost() || !legacy_render_widget_host_HWND_) | 2384 if (!GetRenderWidgetHost() || !legacy_render_widget_host_HWND_) |
2385 return; | 2385 return; |
2386 | 2386 |
(...skipping 19 matching lines...) Expand all Loading... |
2406 } | 2406 } |
2407 | 2407 |
2408 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { | 2408 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { |
2409 if (!delegated_frame_host_) | 2409 if (!delegated_frame_host_) |
2410 return; | 2410 return; |
2411 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || | 2411 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || |
2412 needs_flush_input_); | 2412 needs_flush_input_); |
2413 } | 2413 } |
2414 | 2414 |
2415 } // namespace content | 2415 } // namespace content |
OLD | NEW |