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

Unified Diff: chrome/browser/automation/automation_provider.cc

Issue 9301025: Refactor AutomationProvider::InitialLoadsComplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider.cc
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index be09899a7d1b0e38f2d8e7dc7bfd1ddea0728aa0..352fa924ffe1a2c53300963b5aab553656ea4459 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -271,23 +271,27 @@ void AutomationProvider::SetExpectedTabCount(size_t expected_tabs) {
void AutomationProvider::OnInitialTabLoadsComplete() {
initial_tab_loads_complete_ = true;
VLOG(2) << "OnInitialTabLoadsComplete";
- if (is_connected_ && network_library_initialized_ && login_webui_ready_)
- Send(new AutomationMsg_InitialLoadsComplete());
+ SendInitialLoadMessage();
}
void AutomationProvider::OnNetworkLibraryInit() {
network_library_initialized_ = true;
VLOG(2) << "OnNetworkLibraryInit";
- if (is_connected_ && initial_tab_loads_complete_ && login_webui_ready_)
- Send(new AutomationMsg_InitialLoadsComplete());
+ SendInitialLoadMessage();
}
void AutomationProvider::OnLoginWebuiReady() {
login_webui_ready_ = true;
VLOG(2) << "OnLoginWebuiReady";
+ SendInitialLoadMessage();
+}
+
+void AutomationProvider::SendInitialLoadMessage() {
if (is_connected_ && initial_tab_loads_complete_ &&
- network_library_initialized_)
+ network_library_initialized_ && login_webui_ready_) {
+ LOG(INFO) << "Initial loads complete; sending initial loads message.";
Send(new AutomationMsg_InitialLoadsComplete());
+ }
}
void AutomationProvider::AddLoginHandler(NavigationController* tab,
@@ -376,13 +380,12 @@ const Extension* AutomationProvider::GetDisabledExtension(
void AutomationProvider::OnChannelConnected(int pid) {
is_connected_ = true;
- LOG(INFO) << "Testing channel connected, sending hello message";
// Send a hello message with our current automation protocol version.
+ LOG(INFO) << "Testing channel connected, sending hello message";
channel_->Send(new AutomationMsg_Hello(GetProtocolVersion()));
- if (initial_tab_loads_complete_ && network_library_initialized_ &&
- login_webui_ready_)
- Send(new AutomationMsg_InitialLoadsComplete());
+
+ SendInitialLoadMessage();
}
void AutomationProvider::OnEndTracingComplete() {
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698