Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2856093003: Update TextSelection for non-user initiated events (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 RenderWidgetHostViewBase* focused_view = 2350 RenderWidgetHostViewBase* focused_view =
2351 is_guest_view_hack_ ? this : GetFocusedWidget() 2351 is_guest_view_hack_ ? this : GetFocusedWidget()
2352 ? GetFocusedWidget()->GetView() 2352 ? GetFocusedWidget()->GetView()
2353 : nullptr; 2353 : nullptr;
2354 2354
2355 if (!focused_view) 2355 if (!focused_view)
2356 return; 2356 return;
2357 2357
2358 const TextInputManager::TextSelection* selection = 2358 const TextInputManager::TextSelection* selection =
2359 GetTextInputManager()->GetTextSelection(focused_view); 2359 GetTextInputManager()->GetTextSelection(focused_view);
2360 if (selection->selected_text().length()) { 2360 if (selection->selected_text().length() && selection->user_initiated()) {
2361 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. 2361 // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard.
2362 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION); 2362 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION);
2363 clipboard_writer.WriteText(selection->selected_text()); 2363 clipboard_writer.WriteText(selection->selected_text());
2364 } 2364 }
2365 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) 2365 #endif // defined(USE_X11) && !defined(OS_CHROMEOS)
2366 } 2366 }
2367 2367
2368 void RenderWidgetHostViewAura::SetPopupChild( 2368 void RenderWidgetHostViewAura::SetPopupChild(
2369 RenderWidgetHostViewAura* popup_child_host_view) { 2369 RenderWidgetHostViewAura* popup_child_host_view) {
2370 popup_child_host_view_ = popup_child_host_view; 2370 popup_child_host_view_ = popup_child_host_view;
2371 event_handler_->SetPopupChild( 2371 event_handler_->SetPopupChild(
2372 popup_child_host_view, 2372 popup_child_host_view,
2373 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); 2373 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr);
2374 } 2374 }
2375 2375
2376 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() { 2376 void RenderWidgetHostViewAura::UpdateNeedsBeginFramesInternal() {
2377 if (!delegated_frame_host_) 2377 if (!delegated_frame_host_)
2378 return; 2378 return;
2379 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ || 2379 delegated_frame_host_->SetNeedsBeginFrames(needs_begin_frames_ ||
2380 needs_flush_input_); 2380 needs_flush_input_);
2381 } 2381 }
2382 2382
2383 } // namespace content 2383 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698