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

Side by Side Diff: content/browser/android/content_video_view.cc

Issue 597523003: Remove the legacy fullscreen video path in Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/android/content_video_view.h" 5 #include "content/browser/android/content_video_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 return reinterpret_cast<gfx::NativeView>( 243 return reinterpret_cast<gfx::NativeView>(
244 Java_ContentVideoView_getNativeViewAndroid(env, 244 Java_ContentVideoView_getNativeViewAndroid(env,
245 content_video_view.obj())); 245 content_video_view.obj()));
246 246
247 } 247 }
248 248
249 JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { 249 JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() {
250 ContentViewCoreImpl* content_view_core = manager_->GetContentViewCore(); 250 ContentViewCoreImpl* content_view_core = manager_->GetContentViewCore();
251 JNIEnv* env = AttachCurrentThread(); 251 JNIEnv* env = AttachCurrentThread();
252 bool legacyMode = base::CommandLine::ForCurrentProcess()->HasSwitch(
253 switches::kDisableOverlayFullscreenVideoSubtitle);
254 return JavaObjectWeakGlobalRef( 252 return JavaObjectWeakGlobalRef(
255 env, 253 env,
256 Java_ContentVideoView_createContentVideoView( 254 Java_ContentVideoView_createContentVideoView(
257 env, 255 env,
258 content_view_core->GetContext().obj(), 256 content_view_core->GetContext().obj(),
259 reinterpret_cast<intptr_t>(this), 257 reinterpret_cast<intptr_t>(this),
260 content_view_core->GetContentVideoViewClient().obj(), 258 content_view_core->GetContentVideoViewClient().obj()).obj());
261 legacyMode).obj());
262 } 259 }
263 260
264 void ContentVideoView::CreatePowerSaveBlocker() { 261 void ContentVideoView::CreatePowerSaveBlocker() {
265 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
266 switches::kDisableOverlayFullscreenVideoSubtitle)) {
267 return;
268 }
269
270 if (power_save_blocker_) return;
271
272 power_save_blocker_ = PowerSaveBlocker::Create(
273 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
274 "Playing video").Pass();
mkosiba (inactive) 2014/09/24 15:38:30 intentional? how does the fullscreen html5 video v
Ignacio Solla 2014/09/25 09:36:16 Good catch, there is a bug that we didn't notice,
275 static_cast<PowerSaveBlockerImpl*>(power_save_blocker_.get())->
276 InitDisplaySleepBlocker(GetNativeView());
277 } 262 }
278 263
279 } // namespace content 264 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698