OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |