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

Side by Side Diff: chrome/browser/media/webrtc/media_stream_devices_controller.cc

Issue 2909453002: Support persist toggle in PermissionRequestManager path on Android (Closed)
Patch Set: rebase Created 3 years, 6 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 | « no previous file | chrome/browser/permissions/grouped_permission_infobar_delegate_android.cc » ('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 (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 "chrome/browser/media/webrtc/media_stream_devices_controller.h" 5 #include "chrome/browser/media/webrtc/media_stream_devices_controller.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 delete this; 286 delete this;
287 } 287 }
288 288
289 PermissionRequestType 289 PermissionRequestType
290 MediaStreamDevicesController::Request::GetPermissionRequestType() const { 290 MediaStreamDevicesController::Request::GetPermissionRequestType() const {
291 return PermissionRequestType::MEDIA_STREAM; 291 return PermissionRequestType::MEDIA_STREAM;
292 } 292 }
293 293
294 bool MediaStreamDevicesController::Request::ShouldShowPersistenceToggle() 294 bool MediaStreamDevicesController::Request::ShouldShowPersistenceToggle()
295 const { 295 const {
296 return PermissionUtil::ShouldShowPersistenceToggle(); 296 // Camera and Mic are handled the same w.r.t. showing the persistence toggle,
297 // just check camera here for simplicity (this class will be removed once the
298 // Android and media refactorings are finished).
299 return PermissionUtil::ShouldShowPersistenceToggle(
300 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
297 } 301 }
298 302
299 // Implementation of PermissionPromptDelegate which actually shows a permission 303 // Implementation of PermissionPromptDelegate which actually shows a permission
300 // prompt. 304 // prompt.
301 class MediaStreamDevicesController::PermissionPromptDelegateImpl 305 class MediaStreamDevicesController::PermissionPromptDelegateImpl
302 : public MediaStreamDevicesController::PermissionPromptDelegate { 306 : public MediaStreamDevicesController::PermissionPromptDelegate {
303 public: 307 public:
304 void ShowPrompt( 308 void ShowPrompt(
305 bool user_gesture, 309 bool user_gesture,
306 content::WebContents* web_contents, 310 content::WebContents* web_contents,
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 } 776 }
773 } 777 }
774 778
775 // Don't approve device requests if the tab was hidden. 779 // Don't approve device requests if the tab was hidden.
776 // TODO(qinmin): Add a test for this. http://crbug.com/396869. 780 // TODO(qinmin): Add a test for this. http://crbug.com/396869.
777 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? 781 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video?
778 return web_contents_->GetRenderWidgetHostView()->IsShowing(); 782 return web_contents_->GetRenderWidgetHostView()->IsShowing();
779 #endif 783 #endif
780 return true; 784 return true;
781 } 785 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/permissions/grouped_permission_infobar_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698