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

Side by Side Diff: chrome/browser/chromeos/login/ui/webui_login_view.cc

Issue 562263002: Check media permissions through RenderFrameHostDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render_frame_get_sources
Patch Set: Updated unit test MediaStreamDispatcherHost. Created 6 years, 3 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 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 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 5 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 446
447 void WebUILoginView::RequestMediaAccessPermission( 447 void WebUILoginView::RequestMediaAccessPermission(
448 WebContents* web_contents, 448 WebContents* web_contents,
449 const content::MediaStreamRequest& request, 449 const content::MediaStreamRequest& request,
450 const content::MediaResponseCallback& callback) { 450 const content::MediaResponseCallback& callback) {
451 if (MediaStreamInfoBarDelegate::Create(web_contents, request, callback)) 451 if (MediaStreamInfoBarDelegate::Create(web_contents, request, callback))
452 NOTREACHED() << "Media stream not allowed for WebUI"; 452 NOTREACHED() << "Media stream not allowed for WebUI";
453 } 453 }
454 454
455 bool WebUILoginView::CheckMediaAccessPermission(
456 content::WebContents* web_contents,
457 const GURL& security_origin,
458 content::MediaStreamType type) {
459 return MediaCaptureDevicesDispatcher::GetInstance()
460 ->CheckMediaAccessPermission(web_contents, security_origin, type, NULL);
461 }
462
455 bool WebUILoginView::PreHandleGestureEvent( 463 bool WebUILoginView::PreHandleGestureEvent(
456 content::WebContents* source, 464 content::WebContents* source,
457 const blink::WebGestureEvent& event) { 465 const blink::WebGestureEvent& event) {
458 // Disable pinch zooming. 466 // Disable pinch zooming.
459 return event.type == blink::WebGestureEvent::GesturePinchBegin || 467 return event.type == blink::WebGestureEvent::GesturePinchBegin ||
460 event.type == blink::WebGestureEvent::GesturePinchUpdate || 468 event.type == blink::WebGestureEvent::GesturePinchUpdate ||
461 event.type == blink::WebGestureEvent::GesturePinchEnd; 469 event.type == blink::WebGestureEvent::GesturePinchEnd;
462 } 470 }
463 471
464 void WebUILoginView::DidFailProvisionalLoad( 472 void WebUILoginView::DidFailProvisionalLoad(
(...skipping 28 matching lines...) Expand all
493 webui_visible_ = true; 501 webui_visible_ = true;
494 } 502 }
495 503
496 void WebUILoginView::ReturnFocus(bool reverse) { 504 void WebUILoginView::ReturnFocus(bool reverse) {
497 // Return the focus to the web contents. 505 // Return the focus to the web contents.
498 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); 506 webui_login_->web_contents()->FocusThroughTabTraversal(reverse);
499 GetWidget()->Activate(); 507 GetWidget()->Activate();
500 } 508 }
501 509
502 } // namespace chromeos 510 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698