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 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2382 is_guest_view_hack_ ? this : GetFocusedWidget() | 2382 is_guest_view_hack_ ? this : GetFocusedWidget() |
2383 ? GetFocusedWidget()->GetView() | 2383 ? GetFocusedWidget()->GetView() |
2384 : nullptr; | 2384 : nullptr; |
2385 | 2385 |
2386 if (!focused_view) | 2386 if (!focused_view) |
2387 return; | 2387 return; |
2388 | 2388 |
2389 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 2389 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
2390 const TextInputManager::TextSelection* selection = | 2390 const TextInputManager::TextSelection* selection = |
2391 GetTextInputManager()->GetTextSelection(focused_view); | 2391 GetTextInputManager()->GetTextSelection(focused_view); |
2392 if (selection->selected_text().length()) { | 2392 if (selection->selected_text().length() && selection->user_initiated()) { |
Changwan Ryu
2017/07/14 18:44:03
This CL does more than commit description as follo
Peter Varga
2017/07/17 09:36:06
I thought the description is clear enough but I wi
| |
2393 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. | 2393 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. |
2394 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); | 2394 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); |
2395 clipboard_writer.WriteText(selection->selected_text()); | 2395 clipboard_writer.WriteText(selection->selected_text()); |
2396 } | 2396 } |
2397 | 2397 |
2398 #elif defined(OS_WIN) | 2398 #elif defined(OS_WIN) |
2399 // Some assistive software need to track the location of the caret. | 2399 // Some assistive software need to track the location of the caret. |
2400 if (!GetRenderWidgetHost() || !legacy_render_widget_host_HWND_) | 2400 if (!GetRenderWidgetHost() || !legacy_render_widget_host_HWND_) |
2401 return; | 2401 return; |
2402 | 2402 |
(...skipping 18 matching lines...) Expand all Loading... | |
2421 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2421 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
2422 } | 2422 } |
2423 | 2423 |
2424 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { | 2424 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { |
2425 if (!delegated_frame_host_) | 2425 if (!delegated_frame_host_) |
2426 return; | 2426 return; |
2427 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_); | 2427 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_); |
2428 } | 2428 } |
2429 | 2429 |
2430 } // namespace content | 2430 } // namespace content |
OLD | NEW |