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

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

Issue 618013003: Support fullscreen for non-video elements in the WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactorFullscreenNonMedia
Patch Set: Fix failing test 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 return JavaObjectWeakGlobalRef( 252 return JavaObjectWeakGlobalRef(
253 env, 253 env,
254 Java_ContentVideoView_createContentVideoView( 254 Java_ContentVideoView_createContentVideoView(
255 env, 255 env,
256 content_view_core->GetContext().obj(), 256 content_view_core->GetJavaObject().obj(),
257 reinterpret_cast<intptr_t>(this), 257 reinterpret_cast<intptr_t>(this)).obj());
258 content_view_core->GetContentVideoViewClient().obj()).obj());
259 } 258 }
260 259
261 void ContentVideoView::CreatePowerSaveBlocker() { 260 void ContentVideoView::CreatePowerSaveBlocker() {
262 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 261 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
263 switches::kEnableContentVideoViewPowerSaveBlocker)) { 262 switches::kEnableContentVideoViewPowerSaveBlocker)) {
264 // In fullscreen Clank reuses the power save blocker attached to the 263 // In fullscreen Clank reuses the power save blocker attached to the
265 // container view that was created for embedded video. The WebView cannot 264 // container view that was created for embedded video. The WebView cannot
266 // reuse that so we create a new blocker instead. 265 // reuse that so we create a new blocker instead.
267 if (power_save_blocker_) return; 266 if (power_save_blocker_) return;
268 power_save_blocker_ = PowerSaveBlocker::Create( 267 power_save_blocker_ = PowerSaveBlocker::Create(
269 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, 268 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
270 "Playing video").Pass(); 269 "Playing video").Pass();
271 static_cast<PowerSaveBlockerImpl*>(power_save_blocker_.get())-> 270 static_cast<PowerSaveBlockerImpl*>(power_save_blocker_.get())->
272 InitDisplaySleepBlocker(GetNativeView()); 271 InitDisplaySleepBlocker(GetNativeView());
273 } 272 }
274 } 273 }
275 274
276 } // namespace content 275 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698