1 // Copyright 2013 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef COMPONENTS_NACL_BROWSER_TEST_NACL_BROWSER_DELEGATE_H_ 6 #define COMPONENTS_NACL_BROWSER_TEST_NACL_BROWSER_DELEGATE_H_ 7 8 #include "base/compiler_specific.h" 9 #include "components/nacl/browser/nacl_browser_delegate.h" 10 11 // This is a base test implementation of NaClBrowserDelegate which 12 // does nothing. Individual tests can override the methods further. 13 // To use the test delegate: 14 // 15 // NaClBrowser::SetDelegate(new RefinedTestNaClBrowserDelegate); 16 // 17 // and 18 // 19 // NaClBrowser::ClearAndDeleteDelegate(); 20 class TestNaClBrowserDelegate : public NaClBrowserDelegate { 21 public: 22 TestNaClBrowserDelegate(); 23 24 TestNaClBrowserDelegate(const TestNaClBrowserDelegate&) = delete; 25 TestNaClBrowserDelegate& operator=(const TestNaClBrowserDelegate&) = delete; 26 27 ~TestNaClBrowserDelegate() override; 28 void ShowMissingArchInfobar(int render_process_id, 29 int render_frame_id) override; 30 bool DialogsAreSuppressed() override; 31 bool GetCacheDirectory(base::FilePath* cache_dir) override; 32 bool GetPluginDirectory(base::FilePath* plugin_dir) override; 33 bool GetPnaclDirectory(base::FilePath* pnacl_dir) override; 34 bool GetUserDirectory(base::FilePath* user_dir) override; 35 std::string GetVersionString() const override; 36 ppapi::host::HostFactory* CreatePpapiHostFactory( 37 content::BrowserPpapiHost* ppapi_host) override; 38 MapUrlToLocalFilePathCallback GetMapUrlToLocalFilePathCallback( 39 const base::FilePath& profile_directory) override; 40 void SetDebugPatterns(const std::string& debug_patterns) override; 41 bool URLMatchesDebugPatterns(const GURL& manifest_url) override; 42 }; 43 44 #endif // COMPONENTS_NACL_BROWSER_TEST_NACL_BROWSER_DELEGATE_H_ 45