| 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 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2218 content::MediaStreamDevices video_devices = | 2218 content::MediaStreamDevices video_devices = |
| 2219 media_stream_infobar->GetVideoDevices(); | 2219 media_stream_infobar->GetVideoDevices(); |
| 2220 content::MediaStreamDevices audio_devices = | 2220 content::MediaStreamDevices audio_devices = |
| 2221 media_stream_infobar->GetAudioDevices(); | 2221 media_stream_infobar->GetAudioDevices(); |
| 2222 if (video_devices.empty() || audio_devices.empty()) { | 2222 if (video_devices.empty() || audio_devices.empty()) { |
| 2223 reply.SendError("No available audio/video devices to autoselect."); | 2223 reply.SendError("No available audio/video devices to autoselect."); |
| 2224 return; | 2224 return; |
| 2225 } | 2225 } |
| 2226 | 2226 |
| 2227 media_stream_infobar->Accept(audio_devices[0].device_id, | 2227 media_stream_infobar->Accept(audio_devices[0].device_id, |
| 2228 video_devices[0].device_id); | 2228 video_devices[0].device_id, |
| 2229 false); |
| 2229 infobar_helper->RemoveInfoBar(infobar); | 2230 infobar_helper->RemoveInfoBar(infobar); |
| 2230 } else if ("deny" == action) { | 2231 } else if ("deny" == action) { |
| 2231 media_stream_infobar->Deny(); | 2232 media_stream_infobar->Deny(); |
| 2232 infobar_helper->RemoveInfoBar(infobar); | 2233 infobar_helper->RemoveInfoBar(infobar); |
| 2233 } | 2234 } |
| 2234 reply.SendSuccess(NULL); | 2235 reply.SendSuccess(NULL); |
| 2235 return; | 2236 return; |
| 2236 } | 2237 } |
| 2237 reply.SendError("Invalid action"); | 2238 reply.SendError("Invalid action"); |
| 2238 } | 2239 } |
| (...skipping 4448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6687 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6688 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6688 } | 6689 } |
| 6689 | 6690 |
| 6690 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6691 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6691 WebContents* tab) { | 6692 WebContents* tab) { |
| 6692 if (browser->GetActiveWebContents() != tab) { | 6693 if (browser->GetActiveWebContents() != tab) { |
| 6693 browser->ActivateTabAt(browser->GetIndexOfController( | 6694 browser->ActivateTabAt(browser->GetIndexOfController( |
| 6694 &tab->GetController()), true); | 6695 &tab->GetController()), true); |
| 6695 } | 6696 } |
| 6696 } | 6697 } |
| OLD | NEW |