| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.contextualsearch; | 5 package org.chromium.chrome.browser.contextualsearch; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.view.ContextMenu; | 8 import android.view.ContextMenu; |
| 9 | 9 |
| 10 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 /** | 33 /** |
| 34 * The current ContentViewCore for the Tab which this helper is monitoring. | 34 * The current ContentViewCore for the Tab which this helper is monitoring. |
| 35 */ | 35 */ |
| 36 private ContentViewCore mBaseContentViewCore; | 36 private ContentViewCore mBaseContentViewCore; |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * The GestureListener used for handling events from the current ContentView
Core. | 39 * The GestureListener used for handling events from the current ContentView
Core. |
| 40 */ | 40 */ |
| 41 private GestureStateListener mGestureStateListener; | 41 private GestureStateListener mGestureStateListener; |
| 42 | 42 |
| 43 private long mNativeHelper = 0; | 43 private long mNativeHelper; |
| 44 | 44 |
| 45 private final Tab mTab; | 45 private final Tab mTab; |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Creates a contextual search tab helper for the given tab. | 48 * Creates a contextual search tab helper for the given tab. |
| 49 * @param tab The tab whose contextual search actions will be handled by thi
s helper. | 49 * @param tab The tab whose contextual search actions will be handled by thi
s helper. |
| 50 */ | 50 */ |
| 51 public static void createForTab(Tab tab) { | 51 public static void createForTab(Tab tab) { |
| 52 new ContextualSearchTabHelper(tab); | 52 new ContextualSearchTabHelper(tab); |
| 53 } | 53 } |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 if (manager != null) { | 258 if (manager != null) { |
| 259 boolean isEnabled = !PrefServiceBridge.getInstance().isContextualSea
rchDisabled() | 259 boolean isEnabled = !PrefServiceBridge.getInstance().isContextualSea
rchDisabled() |
| 260 && !PrefServiceBridge.getInstance().isContextualSearchUninit
ialized(); | 260 && !PrefServiceBridge.getInstance().isContextualSearchUninit
ialized(); |
| 261 manager.onContextualSearchPrefChanged(isEnabled); | 261 manager.onContextualSearchPrefChanged(isEnabled); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 private native long nativeInit(Profile profile); | 265 private native long nativeInit(Profile profile); |
| 266 private native void nativeDestroy(long nativeContextualSearchTabHelper); | 266 private native void nativeDestroy(long nativeContextualSearchTabHelper); |
| 267 } | 267 } |
| OLD | NEW |