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

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

Issue 8790003: Allow the automation provider to accept an ID for performing render-view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 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
Index: chrome/browser/automation/automation_util.h
diff --git a/chrome/browser/automation/automation_util.h b/chrome/browser/automation/automation_util.h
index fb3a3f6aa17731c4dd2ec87b025d83f0b5488d19..6a7bfe5a1c332cf16260c17092c4d839d1782429 100644
--- a/chrome/browser/automation/automation_util.h
+++ b/chrome/browser/automation/automation_util.h
@@ -10,10 +10,16 @@
#include "base/basictypes.h"
+class AutomationId;
class AutomationProvider;
class Browser;
+class Extension;
+class ExtensionHost;
class GURL;
+class Profile;
+class RenderViewHost;
class TabContents;
+class TabContentsWrapper;
namespace base {
class DictionaryValue;
@@ -35,6 +41,9 @@ Browser* GetBrowserAt(int index);
// |BrowserList|. If any of these indices are invalid, NULL will be returned.
TabContents* GetTabContentsAt(int browser_index, int tab_index);
+// Returns the browser that contains the given tab, or NULL if none exists.
+Browser* GetBrowserForTab(TabContents* tab);
+
// Gets the size and value of the cookie string for |url| in the given tab.
// Can be called from any thread.
void GetCookies(const GURL& url,
@@ -77,6 +86,31 @@ void SetCookieJSON(AutomationProvider* provider,
bool SendErrorIfModalDialogActive(AutomationProvider* provider,
IPC::Message* message);
+// Returns a valid automation ID for the given tab.
+AutomationId GetIdForTab(const TabContentsWrapper* tab);
+
+// Returns a valid automation ID for the extension host.
+AutomationId GetIdForExtensionView(const ExtensionHost* ext_host);
+
+// Returns a valid automation ID for the extension.
+AutomationId GetIdForExtension(const Extension* extension);
+
+// Gets the tab for the given ID. Returns true on success.
+bool GetTabForId(const AutomationId& id, TabContents** tab);
+
+// Gets the render view for the given ID. Returns true on success.
+bool GetRenderViewForId(const AutomationId& id,
+ Profile* profile,
+ RenderViewHost** rvh);
+
+// Gets the extension for the given ID. Returns true on success.
+bool GetExtensionForId(const AutomationId& id,
+ Profile* profile,
+ const Extension** extension);
+
+// Returns whether the given ID refers to an actual automation entity.
+bool DoesObjectWithIdExist(const AutomationId& id, Profile* profile);
+
} // namespace automation_util
#endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.cc ('k') | chrome/browser/automation/automation_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698