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

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

Issue 10209022: Refactor media stream infobar delegate code and also fix a typo (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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 | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 infobar_helper->RemoveInfoBar(infobar); 2693 infobar_helper->RemoveInfoBar(infobar);
2694 } else if ("cancel" == action) { 2694 } else if ("cancel" == action) {
2695 if (confirm_infobar->Cancel()) 2695 if (confirm_infobar->Cancel())
2696 infobar_helper->RemoveInfoBar(infobar); 2696 infobar_helper->RemoveInfoBar(infobar);
2697 } 2697 }
2698 reply.SendSuccess(NULL); 2698 reply.SendSuccess(NULL);
2699 return; 2699 return;
2700 } 2700 }
2701 if ("allow" == action || "deny" == action) { 2701 if ("allow" == action || "deny" == action) {
2702 MediaStreamInfoBarDelegate* media_stream_infobar; 2702 MediaStreamInfoBarDelegate* media_stream_infobar;
2703 if (!(media_stream_infobar = infobar->AsMediaStreamInfobarDelegate())) { 2703 if (!(media_stream_infobar = infobar->AsMediaStreamInfoBarDelegate())) {
2704 reply.SendError("Not a media stream infobar."); 2704 reply.SendError("Not a media stream infobar.");
2705 return; 2705 return;
2706 } 2706 }
2707 if ("allow" == action) { 2707 if ("allow" == action) {
2708 content::MediaStreamDevices video_devices = 2708 content::MediaStreamDevices video_devices =
2709 media_stream_infobar->GetVideoDevices(); 2709 media_stream_infobar->GetVideoDevices();
2710 content::MediaStreamDevices audio_devices = 2710 content::MediaStreamDevices audio_devices =
2711 media_stream_infobar->GetAudioDevices(); 2711 media_stream_infobar->GetAudioDevices();
2712 if (video_devices.empty() || audio_devices.empty()) { 2712 if (video_devices.empty() || audio_devices.empty()) {
2713 reply.SendError("No available audio/video devices to autoselect."); 2713 reply.SendError("No available audio/video devices to autoselect.");
(...skipping 4364 matching lines...) Expand 10 before | Expand all | Expand 10 after
7078 *browser_handle = browser_tracker_->Add(browser); 7078 *browser_handle = browser_tracker_->Add(browser);
7079 *success = true; 7079 *success = true;
7080 } 7080 }
7081 } 7081 }
7082 } 7082 }
7083 7083
7084 void TestingAutomationProvider::OnRemoveProvider() { 7084 void TestingAutomationProvider::OnRemoveProvider() {
7085 if (g_browser_process) 7085 if (g_browser_process)
7086 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 7086 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
7087 } 7087 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698