OLD | NEW |
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.chrome.browser; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import org.chromium.content.browser.WebContentsObserverAndroid; | 7 import org.chromium.content.browser.WebContentsObserver; |
8 import org.chromium.content_public.browser.WebContents; | 8 import org.chromium.content_public.browser.WebContents; |
9 | 9 |
10 /** | 10 /** |
11 * Tab helper to toggle media autoplay for voice URL searches. | 11 * Tab helper to toggle media autoplay for voice URL searches. |
12 */ | 12 */ |
13 public class VoiceSearchTabHelper extends WebContentsObserverAndroid { | 13 public class VoiceSearchTabHelper extends WebContentsObserver { |
14 private final WebContents mWebContents; | 14 private final WebContents mWebContents; |
15 | 15 |
16 /** | 16 /** |
17 * Create an instance of VoiceSearchTabHelper. | 17 * Create an instance of VoiceSearchTabHelper. |
18 * | 18 * |
19 * @param webContents WebContents to update media autoplay status. | 19 * @param webContents WebContents to update media autoplay status. |
20 */ | 20 */ |
21 public VoiceSearchTabHelper(WebContents webContents) { | 21 public VoiceSearchTabHelper(WebContents webContents) { |
22 super(webContents); | 22 super(webContents); |
23 mWebContents = webContents; | 23 mWebContents = webContents; |
24 } | 24 } |
25 | 25 |
26 @Override | 26 @Override |
27 public void navigationEntryCommitted() { | 27 public void navigationEntryCommitted() { |
28 nativeUpdateAutoplayStatus(mWebContents); | 28 nativeUpdateAutoplayStatus(mWebContents); |
29 } | 29 } |
30 | 30 |
31 private native void nativeUpdateAutoplayStatus(WebContents webContents); | 31 private native void nativeUpdateAutoplayStatus(WebContents webContents); |
32 } | 32 } |
OLD | NEW |