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 #ifndef CHROME_BROWSER_ANDROID_VOICE_SEARCH_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VOICE_SEARCH_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_ANDROID_VOICE_SEARCH_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_VOICE_SEARCH_TAB_HELPER_H_ |
7 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/macros.h" |
| 9 #include "content/public/browser/web_contents_observer.h" |
| 10 #include "content/public/browser/web_contents_user_data.h" |
9 | 11 |
10 bool RegisterVoiceSearchTabHelper(JNIEnv* env); | 12 // Tab helper to toggle media autoplay for voice URL searches. |
| 13 class VoiceSearchTabHelper |
| 14 : public content::WebContentsObserver, |
| 15 public content::WebContentsUserData<VoiceSearchTabHelper> { |
| 16 public: |
| 17 ~VoiceSearchTabHelper() override; |
| 18 |
| 19 // content::WebContentsObserver overrides. |
| 20 void NavigationEntryCommitted( |
| 21 const content::LoadCommittedDetails& load_details) override; |
| 22 |
| 23 private: |
| 24 explicit VoiceSearchTabHelper(content::WebContents* contents); |
| 25 friend class content::WebContentsUserData<VoiceSearchTabHelper>; |
| 26 |
| 27 bool gesture_requirement_for_playback_disabled_; |
| 28 |
| 29 DISALLOW_COPY_AND_ASSIGN(VoiceSearchTabHelper); |
| 30 }; |
11 | 31 |
12 #endif // CHROME_BROWSER_ANDROID_VOICE_SEARCH_TAB_HELPER_H_ | 32 #endif // CHROME_BROWSER_ANDROID_VOICE_SEARCH_TAB_HELPER_H_ |
OLD | NEW |