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

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

Issue 1206673003: Merge java_staging/src into java/src. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 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
Index: chrome/android/java_staging/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchObservable.java
diff --git a/chrome/android/java_staging/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchObservable.java b/chrome/android/java_staging/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchObservable.java
deleted file mode 100644
index 4d031d77f05aac70862df22d5a3d7ed499b57777..0000000000000000000000000000000000000000
--- a/chrome/android/java_staging/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchObservable.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.browser.contextualsearch;
-
-import org.chromium.base.ObserverList;
-import org.chromium.chrome.browser.ChromeActivity;
-import org.chromium.chrome.browser.gsa.GSAContextDisplaySelection;
-import org.chromium.content.browser.ContentViewCore;
-
-import java.net.URL;
-
-import javax.annotation.Nullable;
-
-
-/**
- * Provides observers for the Contextual Search Manager.
- */
-public class ContextualSearchObservable {
-
- protected final ContextualSearchPolicy mPolicy;
-
- private final ObserverList<ContextualSearchObserver> mObservers =
- new ObserverList<ContextualSearchObserver>();
-
-
- ContextualSearchObservable(ChromeActivity activity) {
- mPolicy = ContextualSearchPolicy.getInstance(activity);
- }
-
- /**
- * @param observer The observer to notify when the user performs a contextual search.
- */
- public void addObserver(ContextualSearchObserver observer) {
- mObservers.addObserver(observer);
- }
-
- /**
- * @param observer The observer to no longer notify when the user performs a contextual search.
- */
- public void removeObserver(ContextualSearchObserver observer) {
- mObservers.removeObserver(observer);
- }
-
- /**
- * Notifies all Contextual Search observers that a search has occurred.
- * @param selectionContext The selection and context that triggered the search.
- * @param baseContentViewUrl The {@link ContentViewCore} of the base page.
- */
- protected void notifyShowContextualSearch(GSAContextDisplaySelection selectionContext,
- @Nullable URL baseContentViewUrl) {
- if (!mPolicy.canSendSurroundings(baseContentViewUrl)) selectionContext = null;
-
- for (ContextualSearchObserver observer : mObservers) {
- observer.onShowContextualSearch(selectionContext);
- }
- }
-
- /**
- * Notifies all Contextual Search observers that a search ended and is no longer in effect.
- */
- protected void notifyHideContextualSearch() {
- for (ContextualSearchObserver observer : mObservers) {
- observer.onHideContextualSearch();
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698