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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java

Issue 1415963003: [Contextual Search] Fix history removal regression. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2526
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
index 57562801c27d25e320404155a7a3f82212657ae4..12110c9a8a864b5fa7ac458aaed6370862d066bf 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -129,6 +129,7 @@ public class ContextualSearchManager extends ContextualSearchObservable
// text, and make sure that all states are cleared when starting a new contextual search to
// avoid having the values in a funky state.
private ContextualSearchRequest mSearchRequest;
+ private ContextualSearchRequest mLastSearchRequestLoaded;
// The native manager associated with this object.
private long mNativeContextualSearchManagerPtr;
@@ -747,6 +748,7 @@ public class ContextualSearchManager extends ContextualSearchObservable
*/
private void loadSearchUrl() {
mLoadedSearchUrlTimeMs = System.currentTimeMillis();
+ mLastSearchRequestLoaded = mSearchRequest;
mSearchPanelDelegate.loadUrlInPanel(mSearchRequest.getSearchUrl());
mDidStartLoadingResolvedSearchRequest = true;
@@ -925,8 +927,9 @@ public class ContextualSearchManager extends ContextualSearchObservable
* Removes the last resolved search URL from the Chrome history.
*/
private void removeLastSearchVisit() {
- if (mSearchRequest != null) {
- mSearchPanelDelegate.removeLastHistoryEntry(mSearchRequest.getSearchUrl(),
+ if (mLastSearchRequestLoaded != null) {
+ // TODO(pedrosimonetti): Consider having this feature builtin into OverlayPanelContent.
+ mSearchPanelDelegate.removeLastHistoryEntry(mLastSearchRequestLoaded.getSearchUrl(),
mLoadedSearchUrlTimeMs);
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698