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

Unified Diff: chrome/browser/android/voice_search_tab_helper.cc

Issue 2843913003: Rename kDisableGestureRequirementForMediaPlayback and make it a test-only flag. (Closed)
Patch Set: Created 3 years, 8 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/browser/android/voice_search_tab_helper.cc
diff --git a/chrome/browser/android/voice_search_tab_helper.cc b/chrome/browser/android/voice_search_tab_helper.cc
index 2b3104b94d0ef9d13367f591990faa12a3a50166..417741647ac0ad134bfda791e2566f855e29b983 100644
--- a/chrome/browser/android/voice_search_tab_helper.cc
+++ b/chrome/browser/android/voice_search_tab_helper.cc
@@ -8,16 +8,20 @@
#include "components/google/core/browser/google_util.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/content_switches.h"
#include "content/public/common/web_preferences.h"
+#include "media/base/media_switches.h"
DEFINE_WEB_CONTENTS_USER_DATA_KEY(VoiceSearchTabHelper);
+// TODO(715588): this class shouldn't be playing with the user gesture
DaleCurtis 2017/04/26 19:39:20 TODO(user_id): ... http://crbug.com/715588
mlamouri (slow - plz ping) 2017/04/26 22:13:47 I've read in chromium-dev that we no longer have t
DaleCurtis 2017/04/26 22:37:43 Ah, you're right, https://google.github.io/stylegu
+// requirements like this.
VoiceSearchTabHelper::VoiceSearchTabHelper(content::WebContents* contents)
: content::WebContentsObserver(contents) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
gesture_requirement_for_playback_disabled_ =
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableGestureRequirementForMediaPlayback);
+ command_line->HasSwitch(switches::kIgnoreAutoplayRestrictionsForTests) ||
+ command_line->GetSwitchValueASCII(switches::kAutoplayPolicy) !=
+ switches::autoplay::kNoUserGestureRequiredPolicy;
}
VoiceSearchTabHelper::~VoiceSearchTabHelper() {

Powered by Google App Engine
This is Rietveld 408576698