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

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

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 | « no previous file | chrome/browser/automation/automation_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider.h
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 8abc0b2eb3c7ef972ed57f97805c98615629972c..797d8b08abb0179c66e3cbbdb7178b37ed440ffb 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -17,6 +17,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/observer_list.h"
#include "base/scoped_ptr.h"
#include "base/string16.h"
@@ -82,15 +83,23 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
Profile* profile() const { return profile_; }
- // Establishes a connection to an automation client, if present.
- // An AutomationProxy should be established (probably in a different process)
- // before calling this.
- void ConnectToChannel(const std::string& channel_id);
+ // Initializes a channel for a connection to an AutomationProxy.
+ // If channel_id starts with kNamedInterfacePrefix, it will act
+ // as a server, create a named IPC socket with channel_id as its
+ // path, and will listen on the socket for incoming connections.
+ // If channel_id does not, it will act as a client and establish
+ // a connection on its primary IPC channel. See ipc/ipc_channel_posix.cc
+ // for more information about kPrimaryIPCChannel.
+ bool InitializeChannel(const std::string& channel_id) WARN_UNUSED_RESULT;
// Sets the number of tabs that we expect; when this number of tabs has
// loaded, an AutomationMsg_InitialLoadsComplete message is sent.
void SetExpectedTabCount(size_t expected_tabs);
+ // Called when the inital set of tabs has finished loading.
+ // Call SetExpectedTabCount(0) to set this to true immediately.
+ void OnInitialLoadsComplete();
+
// Add a listener for navigation status notification. Currently only
// navigation completion is observed; when the |number_of_navigations|
// complete, the completed_response object is sent; if the server requires
@@ -138,6 +147,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// IPC implementations
virtual bool Send(IPC::Message* msg);
+ virtual void OnChannelConnected(int pid);
virtual void OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
@@ -401,6 +411,12 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
scoped_ptr<AutomationExtensionTracker> extension_tracker_;
PortContainerMap port_containers_;
+ // True iff connected to an AutomationProxy.
+ bool is_connected_;
+
+ // True iff browser finished loading initial set of tabs.
+ bool initial_loads_complete_;
+
DISALLOW_COPY_AND_ASSIGN(AutomationProvider);
};
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698