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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 10537099: add "always allow" option to the mediastream infobar and allow user to allow/not allow acces to devi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed sky's comment and replaced "Do not allow any site to" with "Do not allow sites to" Created 8 years, 5 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 | Annotate | Revision Log
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/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 content::MediaStreamDevices video_devices = 2264 content::MediaStreamDevices video_devices =
2265 media_stream_infobar->GetVideoDevices(); 2265 media_stream_infobar->GetVideoDevices();
2266 content::MediaStreamDevices audio_devices = 2266 content::MediaStreamDevices audio_devices =
2267 media_stream_infobar->GetAudioDevices(); 2267 media_stream_infobar->GetAudioDevices();
2268 if (video_devices.empty() || audio_devices.empty()) { 2268 if (video_devices.empty() || audio_devices.empty()) {
2269 reply.SendError("No available audio/video devices to autoselect."); 2269 reply.SendError("No available audio/video devices to autoselect.");
2270 return; 2270 return;
2271 } 2271 }
2272 2272
2273 media_stream_infobar->Accept(audio_devices[0].device_id, 2273 media_stream_infobar->Accept(audio_devices[0].device_id,
2274 video_devices[0].device_id); 2274 video_devices[0].device_id,
2275 false);
2275 infobar_helper->RemoveInfoBar(infobar); 2276 infobar_helper->RemoveInfoBar(infobar);
2276 } else if ("deny" == action) { 2277 } else if ("deny" == action) {
2277 media_stream_infobar->Deny(); 2278 media_stream_infobar->Deny();
2278 infobar_helper->RemoveInfoBar(infobar); 2279 infobar_helper->RemoveInfoBar(infobar);
2279 } 2280 }
2280 reply.SendSuccess(NULL); 2281 reply.SendSuccess(NULL);
2281 return; 2282 return;
2282 } 2283 }
2283 reply.SendError("Invalid action"); 2284 reply.SendError("Invalid action");
2284 } 2285 }
(...skipping 4450 matching lines...) Expand 10 before | Expand all | Expand 10 after
6735 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6736 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6736 } 6737 }
6737 6738
6738 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 6739 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
6739 WebContents* tab) { 6740 WebContents* tab) {
6740 if (browser->GetActiveWebContents() != tab) { 6741 if (browser->GetActiveWebContents() != tab) {
6741 browser->ActivateTabAt(browser->GetIndexOfController( 6742 browser->ActivateTabAt(browser->GetIndexOfController(
6742 &tab->GetController()), true); 6743 &tab->GetController()), true);
6743 } 6744 }
6744 } 6745 }
OLDNEW
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/content_settings/content_settings_default_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698