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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Add test for JS cursor movement Created 3 years, 5 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/renderer/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 bound_compositor_->ViewInitiatedPaint(); 1391 bound_compositor_->ViewInitiatedPaint();
1392 } 1392 }
1393 1393
1394 void PepperPluginInstanceImpl::SetSelectedText( 1394 void PepperPluginInstanceImpl::SetSelectedText(
1395 const base::string16& selected_text) { 1395 const base::string16& selected_text) {
1396 if (!render_frame_) 1396 if (!render_frame_)
1397 return; 1397 return;
1398 1398
1399 selected_text_ = selected_text; 1399 selected_text_ = selected_text;
1400 gfx::Range range(0, selected_text.length()); 1400 gfx::Range range(0, selected_text.length());
1401 render_frame_->SetSelectedText(selected_text, 0, range); 1401 render_frame_->SetSelectedText(selected_text, 0, range, true);
1402 } 1402 }
1403 1403
1404 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) { 1404 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) {
1405 link_under_cursor_ = base::UTF8ToUTF16(url); 1405 link_under_cursor_ = base::UTF8ToUTF16(url);
1406 } 1406 }
1407 1407
1408 void PepperPluginInstanceImpl::SetTextInputType(ui::TextInputType type) { 1408 void PepperPluginInstanceImpl::SetTextInputType(ui::TextInputType type) {
1409 if (!render_frame_) 1409 if (!render_frame_)
1410 return; 1410 return;
1411 1411
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after
3497 const viz::TextureMailbox& mailbox) const { 3497 const viz::TextureMailbox& mailbox) const {
3498 auto it = 3498 auto it =
3499 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3499 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3500 [&mailbox](const TextureMailboxRefCount& ref_count) { 3500 [&mailbox](const TextureMailboxRefCount& ref_count) {
3501 return ref_count.first.mailbox() == mailbox.mailbox(); 3501 return ref_count.first.mailbox() == mailbox.mailbox();
3502 }); 3502 });
3503 return it != texture_ref_counts_.end(); 3503 return it != texture_ref_counts_.end();
3504 } 3504 }
3505 3505
3506 } // namespace content 3506 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/render_widget_input_handler.cc ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698