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

Side by Side Diff: chrome/browser/android/tab_web_contents_delegate_android.cc

Issue 1372203002: Throttle media decoding after excessive Android media server crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new infobar text per UI review Created 5 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
« no previous file with comments | « chrome/browser/android/tab_web_contents_delegate_android.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/android/tab_web_contents_delegate_android.h" 5 #include "chrome/browser/android/tab_web_contents_delegate_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/browser/android/feature_utilities.h" 10 #include "chrome/browser/android/feature_utilities.h"
11 #include "chrome/browser/android/hung_renderer_infobar_delegate.h" 11 #include "chrome/browser/android/hung_renderer_infobar_delegate.h"
12 #include "chrome/browser/android/media/media_throttle_infobar_delegate.h"
12 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/file_select_helper.h" 14 #include "chrome/browser/file_select_helper.h"
14 #include "chrome/browser/infobars/infobar_service.h" 15 #include "chrome/browser/infobars/infobar_service.h"
15 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 16 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
16 #include "chrome/browser/media/media_stream_capture_indicator.h" 17 #include "chrome/browser/media/media_stream_capture_indicator.h"
17 #include "chrome/browser/media/protected_media_identifier_permission_context.h" 18 #include "chrome/browser/media/protected_media_identifier_permission_context.h"
18 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" 19 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h"
19 #include "chrome/browser/prerender/prerender_manager.h" 20 #include "chrome/browser/prerender/prerender_manager.h"
20 #include "chrome/browser/prerender/prerender_manager_factory.h" 21 #include "chrome/browser/prerender/prerender_manager_factory.h"
21 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 267 }
267 268
268 bool TabWebContentsDelegateAndroid::CheckMediaAccessPermission( 269 bool TabWebContentsDelegateAndroid::CheckMediaAccessPermission(
269 content::WebContents* web_contents, 270 content::WebContents* web_contents,
270 const GURL& security_origin, 271 const GURL& security_origin,
271 content::MediaStreamType type) { 272 content::MediaStreamType type) {
272 return MediaCaptureDevicesDispatcher::GetInstance() 273 return MediaCaptureDevicesDispatcher::GetInstance()
273 ->CheckMediaAccessPermission(web_contents, security_origin, type); 274 ->CheckMediaAccessPermission(web_contents, security_origin, type);
274 } 275 }
275 276
277 void TabWebContentsDelegateAndroid::RequestMediaDecodePermission(
278 content::WebContents* web_contents,
279 const base::Callback<void(bool)>& callback) {
280 MediaThrottleInfoBarDelegate::Create(web_contents, callback);
281 }
282
276 bool TabWebContentsDelegateAndroid::RequestPpapiBrokerPermission( 283 bool TabWebContentsDelegateAndroid::RequestPpapiBrokerPermission(
277 WebContents* web_contents, 284 WebContents* web_contents,
278 const GURL& url, 285 const GURL& url,
279 const base::FilePath& plugin_path, 286 const base::FilePath& plugin_path,
280 const base::Callback<void(bool)>& callback) { 287 const base::Callback<void(bool)>& callback) {
281 #if defined(ENABLE_PLUGINS) 288 #if defined(ENABLE_PLUGINS)
282 PepperBrokerInfoBarDelegate::Create( 289 PepperBrokerInfoBarDelegate::Create(
283 web_contents, url, plugin_path, callback); 290 web_contents, url, plugin_path, callback);
284 return true; 291 return true;
285 #else 292 #else
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 jboolean IsCapturingVideo(JNIEnv* env, 453 jboolean IsCapturingVideo(JNIEnv* env,
447 const JavaParamRef<jclass>& clazz, 454 const JavaParamRef<jclass>& clazz,
448 const JavaParamRef<jobject>& java_web_contents) { 455 const JavaParamRef<jobject>& java_web_contents) {
449 content::WebContents* web_contents = 456 content::WebContents* web_contents =
450 content::WebContents::FromJavaWebContents(java_web_contents); 457 content::WebContents::FromJavaWebContents(java_web_contents);
451 scoped_refptr<MediaStreamCaptureIndicator> indicator = 458 scoped_refptr<MediaStreamCaptureIndicator> indicator =
452 MediaCaptureDevicesDispatcher::GetInstance()-> 459 MediaCaptureDevicesDispatcher::GetInstance()->
453 GetMediaStreamCaptureIndicator(); 460 GetMediaStreamCaptureIndicator();
454 return indicator->IsCapturingVideo(web_contents); 461 return indicator->IsCapturingVideo(web_contents);
455 } 462 }
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_web_contents_delegate_android.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698