1 // Copyright 2013 The Chromium Authors. All rights reserved.
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 "base/macros.h"
10 #include "components/nacl/browser/nacl_browser_delegate.h"
11 
12 // This is a base test implementation of NaClBrowserDelegate which
13 // does nothing. Individual tests can override the methods further.
14 // To use the test delegate:
15 //
16 //   NaClBrowser::SetDelegate(new RefinedTestNaClBrowserDelegate);
17 //
18 // and
19 //
20 //   NaClBrowser::ClearAndDeleteDelegateForTest();
21 class TestNaClBrowserDelegate : public NaClBrowserDelegate {
22  public:
23   TestNaClBrowserDelegate();
24   ~TestNaClBrowserDelegate() override;
25   void ShowMissingArchInfobar(int render_process_id,
26                               int render_view_id) override;
27   bool DialogsAreSuppressed() override;
28   bool GetCacheDirectory(base::FilePath* cache_dir) override;
29   bool GetPluginDirectory(base::FilePath* plugin_dir) override;
30   bool GetPnaclDirectory(base::FilePath* pnacl_dir) override;
31   bool GetUserDirectory(base::FilePath* user_dir) override;
32   std::string GetVersionString() const override;
33   ppapi::host::HostFactory* CreatePpapiHostFactory(
34       content::BrowserPpapiHost* ppapi_host) override;
35   MapUrlToLocalFilePathCallback GetMapUrlToLocalFilePathCallback(
36       const base::FilePath& profile_directory) override;
37   void SetDebugPatterns(const std::string& debug_patterns) override;
38   bool URLMatchesDebugPatterns(const GURL& manifest_url) override;
39   bool IsNonSfiModeAllowed(const base::FilePath& profile_directory,
40                            const GURL& manifest_url) override;
41 
42  private:
43   DISALLOW_COPY_AND_ASSIGN(TestNaClBrowserDelegate);
44 };
45 
46 #endif  // COMPONENTS_NACL_BROWSER_TEST_NACL_BROWSER_DELEGATE_H_
47