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

Side by Side Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 2706813004: Move logic to show permission prompts into MediaStreamDevicesController (Closed)
Patch Set: Move logic to show permission prompts into MediaStreamDevicesController Created 3 years, 10 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/media/webrtc/permission_bubble_media_access_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/app_list/start_page_service.h" 5 #include "chrome/browser/ui/app_list/start_page_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 class StartPageService::StartPageWebContentsDelegate 156 class StartPageService::StartPageWebContentsDelegate
157 : public content::WebContentsDelegate { 157 : public content::WebContentsDelegate {
158 public: 158 public:
159 explicit StartPageWebContentsDelegate(Profile* profile) : profile_(profile) {} 159 explicit StartPageWebContentsDelegate(Profile* profile) : profile_(profile) {}
160 ~StartPageWebContentsDelegate() override {} 160 ~StartPageWebContentsDelegate() override {}
161 161
162 void RequestMediaAccessPermission( 162 void RequestMediaAccessPermission(
163 content::WebContents* web_contents, 163 content::WebContents* web_contents,
164 const content::MediaStreamRequest& request, 164 const content::MediaStreamRequest& request,
165 const content::MediaResponseCallback& callback) override { 165 const content::MediaResponseCallback& callback) override {
166 MediaStreamDevicesController controller(web_contents, request, callback); 166 MediaStreamDevicesController::RequestPermissions(web_contents, request,
167 if (controller.IsAskingForVideo() || controller.IsAskingForAudio()) 167 callback);
168 NOTREACHED() << "Media stream not allowed for WebUI";
169 } 168 }
170 169
171 bool CheckMediaAccessPermission(content::WebContents* web_contents, 170 bool CheckMediaAccessPermission(content::WebContents* web_contents,
172 const GURL& security_origin, 171 const GURL& security_origin,
173 content::MediaStreamType type) override { 172 content::MediaStreamType type) override {
174 return MediaCaptureDevicesDispatcher::GetInstance() 173 return MediaCaptureDevicesDispatcher::GetInstance()
175 ->CheckMediaAccessPermission(web_contents, security_origin, type); 174 ->CheckMediaAccessPermission(web_contents, security_origin, type);
176 } 175 }
177 176
178 void AddNewContents(content::WebContents* source, 177 void AddNewContents(content::WebContents* source,
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 683
685 // Check for a new doodle. 684 // Check for a new doodle.
686 content::BrowserThread::PostDelayedTask( 685 content::BrowserThread::PostDelayedTask(
687 content::BrowserThread::UI, FROM_HERE, 686 content::BrowserThread::UI, FROM_HERE,
688 base::Bind(&StartPageService::FetchDoodleJson, 687 base::Bind(&StartPageService::FetchDoodleJson,
689 weak_factory_.GetWeakPtr()), 688 weak_factory_.GetWeakPtr()),
690 recheck_delay); 689 recheck_delay);
691 } 690 }
692 691
693 } // namespace app_list 692 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698