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

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

Issue 2856093003: Update TextSelection for non-user initiated events (Closed)
Patch Set: Update TextSelection for non-user initiated events 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
« no previous file with comments | « content/public/test/text_input_test_utils.cc ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 bound_compositor_->ViewInitiatedPaint(); 1399 bound_compositor_->ViewInitiatedPaint();
1400 } 1400 }
1401 1401
1402 void PepperPluginInstanceImpl::SetSelectedText( 1402 void PepperPluginInstanceImpl::SetSelectedText(
1403 const base::string16& selected_text) { 1403 const base::string16& selected_text) {
1404 if (!render_frame_) 1404 if (!render_frame_)
1405 return; 1405 return;
1406 1406
1407 selected_text_ = selected_text; 1407 selected_text_ = selected_text;
1408 gfx::Range range(0, selected_text.length()); 1408 gfx::Range range(0, selected_text.length());
1409 render_frame_->SetSelectedText(selected_text, 0, range); 1409 render_frame_->SetSelectedText(selected_text, 0, range, true);
1410 } 1410 }
1411 1411
1412 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) { 1412 void PepperPluginInstanceImpl::SetLinkUnderCursor(const std::string& url) {
1413 link_under_cursor_ = base::UTF8ToUTF16(url); 1413 link_under_cursor_ = base::UTF8ToUTF16(url);
1414 } 1414 }
1415 1415
1416 void PepperPluginInstanceImpl::SetTextInputType(ui::TextInputType type) { 1416 void PepperPluginInstanceImpl::SetTextInputType(ui::TextInputType type) {
1417 if (!render_frame_) 1417 if (!render_frame_)
1418 return; 1418 return;
1419 1419
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
3490 const cc::TextureMailbox& mailbox) const { 3490 const cc::TextureMailbox& mailbox) const {
3491 auto it = 3491 auto it =
3492 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3492 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3493 [&mailbox](const TextureMailboxRefCount& ref_count) { 3493 [&mailbox](const TextureMailboxRefCount& ref_count) {
3494 return ref_count.first.mailbox() == mailbox.mailbox(); 3494 return ref_count.first.mailbox() == mailbox.mailbox();
3495 }); 3495 });
3496 return it != texture_ref_counts_.end(); 3496 return it != texture_ref_counts_.end();
3497 } 3497 }
3498 3498
3499 } // namespace content 3499 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/text_input_test_utils.cc ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698