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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java

Issue 2779033004: [Android] Focus/Blur contents when window focus changes (Closed)
Patch Set: Address comments Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.ClipData; 7 import android.content.ClipData;
8 import android.content.ClipboardManager; 8 import android.content.ClipboardManager;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 } 699 }
700 } 700 }
701 }); 701 });
702 } 702 }
703 703
704 private void requestFocusOnUiThread(final boolean gainFocus) { 704 private void requestFocusOnUiThread(final boolean gainFocus) {
705 final ContentViewCore contentViewCore = mContentViewCore; 705 final ContentViewCore contentViewCore = mContentViewCore;
706 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 706 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
707 @Override 707 @Override
708 public void run() { 708 public void run() {
709 contentViewCore.onFocusChanged(gainFocus, true); 709 contentViewCore.onFocusChangedInternal(true, gainFocus, true);
aelias_OOO_until_Jul13 2017/03/30 02:06:55 Would it be difficult to call onFocusChanged direc
mthiesse 2017/03/30 14:51:51 Done.
710 } 710 }
711 }); 711 });
712 } 712 }
713 713
714 private void copyStringToClipboard(String string) { 714 private void copyStringToClipboard(String string) {
715 ClipboardManager clipboardManager = 715 ClipboardManager clipboardManager =
716 (ClipboardManager) getActivity().getSystemService( 716 (ClipboardManager) getActivity().getSystemService(
717 Context.CLIPBOARD_SERVICE); 717 Context.CLIPBOARD_SERVICE);
718 ClipData clip = ClipData.newPlainText("test", string); 718 ClipData clip = ClipData.newPlainText("test", string);
719 clipboardManager.setPrimaryClip(clip); 719 clipboardManager.setPrimaryClip(clip);
(...skipping 10 matching lines...) Expand all
730 730
731 private void waitForInsertion(final boolean show) { 731 private void waitForInsertion(final boolean show) {
732 CriteriaHelper.pollUiThread(Criteria.equals(show, new Callable<Boolean>( ) { 732 CriteriaHelper.pollUiThread(Criteria.equals(show, new Callable<Boolean>( ) {
733 @Override 733 @Override
734 public Boolean call() { 734 public Boolean call() {
735 return mSelectionPopupController.isInsertion(); 735 return mSelectionPopupController.isInsertion();
736 } 736 }
737 })); 737 }));
738 } 738 }
739 } 739 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698