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

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

Issue 8649004: Allow chromedriver to install an extension and get all installed extension IDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 1 month 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_json.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider_json.h
diff --git a/chrome/browser/automation/automation_provider_json.h b/chrome/browser/automation/automation_provider_json.h
index 1ea31db5b268c2e0f0fd688ef503032c6b155e56..b1083261762396e62af08e4081caf267ba743892 100644
--- a/chrome/browser/automation/automation_provider_json.h
+++ b/chrome/browser/automation/automation_provider_json.h
@@ -14,7 +14,11 @@
class AutomationProvider;
class Browser;
+class Extension;
+class Profile;
+class RenderViewHost;
class TabContents;
+class TabContentsWrapper;
namespace base {
class DictionaryValue;
@@ -48,6 +52,38 @@ class AutomationJSONReply {
IPC::Message* message_;
};
+// A unique ID that automation clients can use to refer to browser entities.
+// The ID contains its type so that:
+// 1) supplying an ID of the wrong type can be detected
+// 2) the client does not have to explicitly supply the type in case multiple
+// ID types can be accepted (e.g., can use a tab ID or extension popup ID for
+// executing javascript).
+class AutomationId {
+ public:
+ // This order should be preserved.
+ enum Type {
+ kInvalidType = -1,
+ kTypeTab = 0,
+ kTypeExtensionPopup
+ };
+
+ static bool FromValue(
+ base::Value* value, AutomationId* id, std::string* error);
+
+ AutomationId();
+ AutomationId(Type type, const std::string& id);
+
+ base::Value* ToValue() const;
+
+ bool is_valid() const;
+ Type type() const;
+ const std::string& id() const;
+
+ private:
+ Type type_;
+ std::string id_;
+};
+
// Gets the browser specified by the given dictionary |args|. |args| should
// contain a key 'windex' which refers to the index of the browser. Returns
// true on success and sets |browser|. Otherwise, |error| will be set.
@@ -73,4 +109,15 @@ bool GetBrowserAndTabFromJSONArgs(base::DictionaryValue* args,
TabContents** tab,
std::string* error) WARN_UNUSED_RESULT;
+bool GetAutomationIdFromJSONArgs(
+ base::DictionaryValue* args,
+ AutomationId* id,
+ std::string* error) WARN_UNUSED_RESULT;
+
+bool GetRenderViewFromJSONArgs(
+ base::DictionaryValue* args,
+ Profile* profile,
+ RenderViewHost** rvh,
+ std::string* error) WARN_UNUSED_RESULT;
+
#endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider_json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698