1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 2cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// found in the LICENSE file. 4cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_ADAPTER_H_ 6cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_ADAPTER_H_ 7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)namespace extensions { 9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 10cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Adapts an object to receive actions from the Automation extension API. 11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)class AutomationActionAdapter { 12cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) public: 13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // Performs a default action (e.g. click, check) on the target node. 14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual void DoDefault(int32 id) = 0; 15cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // Performs a focus action on the target node. 17cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual void Focus(int32 id) = 0; 18cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 19cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // Makes the node visible by scrolling; does not change nodes from hidden to 20cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // shown. 21cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual void MakeVisible(int32 id) = 0; 22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 23cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // Sets selection for a start and end index (usually only relevant on text 24cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) // fields). 25cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual void SetSelection(int32 id, int32 start, int32 end) = 0; 26cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)}; 27cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 28cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)} // namespace extensions 29cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 30cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#endif // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_ADAPTER_H_ 31