| 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 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 content::MediaStreamDevices video_devices = | 2227 content::MediaStreamDevices video_devices = |
| 2228 media_stream_infobar->GetVideoDevices(); | 2228 media_stream_infobar->GetVideoDevices(); |
| 2229 content::MediaStreamDevices audio_devices = | 2229 content::MediaStreamDevices audio_devices = |
| 2230 media_stream_infobar->GetAudioDevices(); | 2230 media_stream_infobar->GetAudioDevices(); |
| 2231 if (video_devices.empty() || audio_devices.empty()) { | 2231 if (video_devices.empty() || audio_devices.empty()) { |
| 2232 reply.SendError("No available audio/video devices to autoselect."); | 2232 reply.SendError("No available audio/video devices to autoselect."); |
| 2233 return; | 2233 return; |
| 2234 } | 2234 } |
| 2235 | 2235 |
| 2236 media_stream_infobar->Accept(audio_devices[0].device_id, | 2236 media_stream_infobar->Accept(audio_devices[0].device_id, |
| 2237 video_devices[0].device_id); | 2237 video_devices[0].device_id, |
| 2238 false); |
| 2238 infobar_helper->RemoveInfoBar(infobar); | 2239 infobar_helper->RemoveInfoBar(infobar); |
| 2239 } else if ("deny" == action) { | 2240 } else if ("deny" == action) { |
| 2240 media_stream_infobar->Deny(); | 2241 media_stream_infobar->Deny(); |
| 2241 infobar_helper->RemoveInfoBar(infobar); | 2242 infobar_helper->RemoveInfoBar(infobar); |
| 2242 } | 2243 } |
| 2243 reply.SendSuccess(NULL); | 2244 reply.SendSuccess(NULL); |
| 2244 return; | 2245 return; |
| 2245 } | 2246 } |
| 2246 reply.SendError("Invalid action"); | 2247 reply.SendError("Invalid action"); |
| 2247 } | 2248 } |
| (...skipping 4419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6667 } | 6668 } |
| 6668 | 6669 |
| 6669 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6670 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6670 WebContents* tab) { | 6671 WebContents* tab) { |
| 6671 if (browser->GetActiveWebContents() != tab || | 6672 if (browser->GetActiveWebContents() != tab || |
| 6672 browser != BrowserList::GetLastActive()) { | 6673 browser != BrowserList::GetLastActive()) { |
| 6673 browser->ActivateTabAt(browser->GetIndexOfController(&tab->GetController()), | 6674 browser->ActivateTabAt(browser->GetIndexOfController(&tab->GetController()), |
| 6674 true /* user_gesture */); | 6675 true /* user_gesture */); |
| 6675 } | 6676 } |
| 6676 } | 6677 } |
| OLD | NEW |