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

Unified Diff: chrome/browser/ui/browser_init.cc

Issue 6012006: Revert 68944 - Revert "Add named testing interface." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_init.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_init.cc
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 7747c8adaa357e4e47a8d26963ec8343eec714ae..8835996679d5a38046c0968b460fa92edfb3c7a4 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -1004,10 +1004,11 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line,
expected_tab_count =
std::max(1, static_cast<int>(command_line.args().size()));
}
- CreateAutomationProvider<TestingAutomationProvider>(
+ if (!CreateAutomationProvider<TestingAutomationProvider>(
testing_channel_id,
profile,
- static_cast<size_t>(expected_tab_count));
+ static_cast<size_t>(expected_tab_count)))
+ return false;
}
}
@@ -1024,11 +1025,13 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line,
silent_launch = true;
if (command_line.HasSwitch(switches::kChromeFrame)) {
- CreateAutomationProvider<ChromeFrameAutomationProvider>(
- automation_channel_id, profile, expected_tabs);
+ if (!CreateAutomationProvider<ChromeFrameAutomationProvider>(
+ automation_channel_id, profile, expected_tabs))
+ return false;
} else {
- CreateAutomationProvider<AutomationProvider>(automation_channel_id,
- profile, expected_tabs);
+ if (!CreateAutomationProvider<AutomationProvider>(
+ automation_channel_id, profile, expected_tabs))
+ return false;
}
}
@@ -1087,16 +1090,20 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line,
}
template <class AutomationProviderClass>
-void BrowserInit::CreateAutomationProvider(const std::string& channel_id,
+bool BrowserInit::CreateAutomationProvider(const std::string& channel_id,
Profile* profile,
size_t expected_tabs) {
scoped_refptr<AutomationProviderClass> automation =
new AutomationProviderClass(profile);
- automation->ConnectToChannel(channel_id);
+
+ if (!automation->InitializeChannel(channel_id))
+ return false;
automation->SetExpectedTabCount(expected_tabs);
AutomationProviderList* list =
g_browser_process->InitAutomationProviderList();
DCHECK(list);
list->AddProvider(automation);
+
+ return true;
}
« no previous file with comments | « chrome/browser/ui/browser_init.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698