OLD | NEW |
---|---|
(Empty) | |
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_COMMON_TEST_NACL_BROWSER_DELEGATE_H_ | |
6 #define COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_ | |
7 | |
8 #include "components/nacl/common/nacl_browser_delegate.h" | |
9 | |
10 // This is a base test implementation of NaClBrowserDelegate, which | |
Mark Seaborn
2013/10/31 02:36:38
Nit: remove comma, otherwise it looks like you're
jvoung (off chromium)
2013/10/31 16:59:55
Done.
| |
11 // does nothing. Individual tests can override the methods further. | |
12 // To use the test delegate: | |
13 // | |
14 // NaClBrowser::SetDelegate(new RefinedTestNaClBrowserDelegate); | |
15 // | |
16 // and | |
17 // | |
18 // NaClBrowser::SetDelegate(NULL); // frees the test delegate. | |
Mark Seaborn
2013/10/31 02:36:38
Indent by 1 more space to match the other SetDeleg
jvoung (off chromium)
2013/10/31 16:59:55
Done.
| |
19 class TestNaClBrowserDelegate : public NaClBrowserDelegate { | |
20 public: | |
21 virtual ~TestNaClBrowserDelegate() {} | |
22 virtual void ShowNaClInfobar(int render_process_id, | |
23 int render_view_id, | |
24 int error_id) OVERRIDE {} | |
25 virtual bool DialogsAreSuppressed() OVERRIDE { return false; } | |
26 virtual bool GetCacheDirectory(base::FilePath* cache_dir) OVERRIDE { | |
27 return false; | |
28 } | |
29 virtual bool GetPluginDirectory(base::FilePath* plugin_dir) OVERRIDE { | |
30 return false; | |
31 } | |
32 virtual bool GetPnaclDirectory(base::FilePath* pnacl_dir) OVERRIDE { | |
33 return false; | |
34 } | |
35 virtual bool GetUserDirectory(base::FilePath* user_dir) OVERRIDE { | |
36 return false; | |
37 } | |
38 virtual std::string GetVersionString() const OVERRIDE { | |
39 return std::string(); | |
40 } | |
41 virtual ppapi::host::HostFactory* CreatePpapiHostFactory( | |
42 content::BrowserPpapiHost* ppapi_host) OVERRIDE { | |
43 return NULL; | |
44 } | |
45 virtual bool MapUrlToLocalFilePath(const GURL& url, | |
46 bool use_blocking_api, | |
47 base::FilePath* file_path) OVERRIDE { | |
48 return false; | |
49 } | |
50 virtual void TryInstallPnacl(const base::Callback<void(bool)>& installed) | |
51 OVERRIDE { | |
52 installed.Run(false); | |
53 } | |
54 virtual void SetDebugPatterns(std::string debug_patterns) OVERRIDE {} | |
55 virtual bool URLMatchesDebugPatterns(const GURL& manifest_url) OVERRIDE { | |
56 return false; | |
57 } | |
58 }; | |
59 | |
60 #endif // COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_ | |
OLD | NEW |