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

Unified Diff: chrome/test/automation/tab_proxy.h

Issue 113722: Make automation proxy objects to ref_counted. That allows to process async no... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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/test/automation/browser_proxy.cc ('k') | chrome/test/automation/tab_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/tab_proxy.h
===================================================================
--- chrome/test/automation/tab_proxy.h (revision 17078)
+++ chrome/test/automation/tab_proxy.h (working copy)
@@ -14,6 +14,7 @@
#include <string>
#include <vector>
+#include "base/observer_list.h"
#include "chrome/browser/download/save_package.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/security_style.h"
@@ -23,19 +24,23 @@
class ConstrainedWindowProxy;
class GURL;
class Value;
+class IPC::Message;
enum FindInPageDirection { BACK = 0, FWD = 1 };
enum FindInPageCase { IGNORE_CASE = 0, CASE_SENSITIVE = 1 };
class TabProxy : public AutomationResourceProxy {
public:
+ class TabProxyDelegate {
+ public:
+ virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg) {}
+ };
+
TabProxy(AutomationMessageSender* sender,
AutomationHandleTracker* tracker,
int handle)
: AutomationResourceProxy(tracker, sender, handle) {}
- virtual ~TabProxy() {}
-
// Gets the current url of the tab.
bool GetCurrentURL(GURL* url) const;
@@ -51,7 +56,8 @@
// Gets the proxy object for constrained window within this tab. Ownership
// for the returned object is transfered to the caller. Returns NULL on
// failure.
- ConstrainedWindowProxy* GetConstrainedWindow(int window_index) const;
+ scoped_refptr<ConstrainedWindowProxy> GetConstrainedWindow(
+ int window_index) const;
// Executes a javascript in a frame's context whose xpath is provided as the
// first parameter and extract the values from the resulting json string.
@@ -295,7 +301,15 @@
int width, int height, int flags, HWND parent_window);
#endif // defined(OS_WIN)
+ // Calls delegates
+ void AddObserver(TabProxyDelegate* observer);
+ void RemoveObserver(TabProxyDelegate* observer);
+ void OnMessageReceived(const IPC::Message& message);
+ protected:
+ virtual ~TabProxy() {}
private:
+ Lock list_lock_; // Protects the observers_list_.
+ ObserverList<TabProxyDelegate> observers_list_;
DISALLOW_COPY_AND_ASSIGN(TabProxy);
};
« no previous file with comments | « chrome/test/automation/browser_proxy.cc ('k') | chrome/test/automation/tab_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698