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

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

Issue 407893003: Implement clearListener() method for PositionObserver to clear all registered listeners when Con (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes incorporated Created 6 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/PositionObserver.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.view.View; 7 import android.view.View;
8 import android.view.ViewTreeObserver; 8 import android.view.ViewTreeObserver;
9 9
10 import java.util.ArrayList; 10 import java.util.ArrayList;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 93
94 private void updatePosition() { 94 private void updatePosition() {
95 int previousPositionX = mPosition[0]; 95 int previousPositionX = mPosition[0];
96 int previousPositionY = mPosition[1]; 96 int previousPositionY = mPosition[1];
97 mView.getLocationInWindow(mPosition); 97 mView.getLocationInWindow(mPosition);
98 if (mPosition[0] != previousPositionX || mPosition[1] != previousPositio nY) { 98 if (mPosition[0] != previousPositionX || mPosition[1] != previousPositio nY) {
99 notifyListeners(); 99 notifyListeners();
100 } 100 }
101 } 101 }
102
103 /**
104 * Clears installed listener(s).
105 */
106 @Override
107 public void clearListener() {
108 mListeners.clear();
109 }
102 } 110 }
103 111
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/PositionObserver.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698