test_autofill_driver.h revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_DRIVER_H_ 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_DRIVER_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h" 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/compiler_specific.h" 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "components/autofill/core/browser/autofill_driver.h" 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/browser/web_contents_observer.h" 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace autofill { 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This class is only for easier writing of tests. All pure virtual functions 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// have been given empty methods. 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// TODO(blundell): Eliminate this class being a WebContentsObserver once 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// autofill shared code no longer needs knowledge of WebContents. 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class TestAutofillDriver : public AutofillDriver, 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public content::WebContentsObserver { 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public: 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) explicit TestAutofillDriver(content::WebContents* web_contents); 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual ~TestAutofillDriver(); 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // AutofillDriver implementation. 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual content::WebContents* GetWebContents() OVERRIDE; 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool RendererIsAvailable() OVERRIDE; 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void SendFormDataToRenderer(int query_id, 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) const FormData& data) OVERRIDE; 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void SendAutofillTypePredictionsToRenderer( 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) const std::vector<FormStructure*>& forms) OVERRIDE; 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private: 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(TestAutofillDriver); 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace autofill 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_DRIVER_H_ 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)