From c54ab233b57b0c0cab2b814ef915767cece172bd Mon Sep 17 00:00:00 2001 From: "kkania@chromium.org" Date: Mon, 5 Dec 2011 21:05:42 +0000 Subject: Allow AutomationProvider to work with other render view containers besides tabs, particularly extension bg pages, infobars, and popups. This is needed to enable WebDriver to work with these views. BUG=93571 TEST=none Review URL: http://codereview.chromium.org/8790003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113023 0039d316-1c4b-4281-b951-d872f2087c98 --- .../browser/automation/automation_provider_json.h | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to '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 1ea31db..0c1ba7d 100644 --- a/chrome/browser/automation/automation_provider_json.h +++ b/chrome/browser/automation/automation_provider_json.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,8 +12,11 @@ #include "base/compiler_specific.h" +class AutomationId; class AutomationProvider; class Browser; +class Profile; +class RenderViewHost; class TabContents; namespace base { @@ -73,4 +76,22 @@ bool GetBrowserAndTabFromJSONArgs(base::DictionaryValue* args, TabContents** tab, std::string* error) WARN_UNUSED_RESULT; +// Gets an automation ID from the given value in the given dicitionary |args|. +// Returns true on success and sets |id|. Otherwise, |error| will be set. +bool GetAutomationIdFromJSONArgs( + base::DictionaryValue* args, + const std::string& key_name, + AutomationId* id, + std::string* error) WARN_UNUSED_RESULT; + +// Gets the render view specified by the given dictionary |args|. |args| +// should contain a key 'view_id' which refers to an automation ID for the +// render view. Returns true on success and sets |rvh|. Otherwise, |error| +// will be set. +bool GetRenderViewFromJSONArgs( + base::DictionaryValue* args, + Profile* profile, + RenderViewHost** rvh, + std::string* error) WARN_UNUSED_RESULT; + #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ -- cgit v1.1