Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: components/nacl/common/test_nacl_browser_delegate.h

Issue 51323004: Move most of TestNaClBrowserDelegate to another file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl.gyp ('k') | components/nacl/common/test_nacl_browser_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/common/test_nacl_browser_delegate.h
diff --git a/chrome/browser/nacl_host/nacl_browser_delegate_impl.h b/components/nacl/common/test_nacl_browser_delegate.h
similarity index 56%
copy from chrome/browser/nacl_host/nacl_browser_delegate_impl.h
copy to components/nacl/common/test_nacl_browser_delegate.h
index de75b825ff6a2e52855c9ac337f4154db659305d..fc0f62218a2720e78946f017c354ad2a679ce979 100644
--- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.h
+++ b/components/nacl/common/test_nacl_browser_delegate.h
@@ -2,19 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_NACL_HOST_NACL_BROWSER_DELEGATE_IMPL_H_
-#define CHROME_BROWSER_NACL_HOST_NACL_BROWSER_DELEGATE_IMPL_H_
+#ifndef COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_
+#define COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_
+#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "chrome/browser/extensions/extension_info_map.h"
#include "components/nacl/common/nacl_browser_delegate.h"
-class NaClBrowserDelegateImpl : public NaClBrowserDelegate {
+// This is a base test implementation of NaClBrowserDelegate which
+// does nothing. Individual tests can override the methods further.
+// To use the test delegate:
+//
+// NaClBrowser::SetDelegate(new RefinedTestNaClBrowserDelegate);
+//
+// and
+//
+// NaClBrowser::SetDelegate(NULL); // frees the test delegate.
+class TestNaClBrowserDelegate : public NaClBrowserDelegate {
public:
- explicit NaClBrowserDelegateImpl(ExtensionInfoMap* extension_info_map);
- virtual ~NaClBrowserDelegateImpl();
-
- virtual void ShowNaClInfobar(int render_process_id, int render_view_id,
+ TestNaClBrowserDelegate();
+ virtual ~TestNaClBrowserDelegate();
+ virtual void ShowNaClInfobar(int render_process_id,
+ int render_view_id,
int error_id) OVERRIDE;
virtual bool DialogsAreSuppressed() OVERRIDE;
virtual bool GetCacheDirectory(base::FilePath* cache_dir) OVERRIDE;
@@ -25,17 +34,13 @@ class NaClBrowserDelegateImpl : public NaClBrowserDelegate {
virtual ppapi::host::HostFactory* CreatePpapiHostFactory(
content::BrowserPpapiHost* ppapi_host) OVERRIDE;
virtual bool MapUrlToLocalFilePath(const GURL& url,
- bool is_blocking,
+ bool use_blocking_api,
base::FilePath* file_path) OVERRIDE;
virtual void SetDebugPatterns(std::string debug_patterns) OVERRIDE;
virtual bool URLMatchesDebugPatterns(const GURL& manifest_url) OVERRIDE;
private:
- scoped_refptr<ExtensionInfoMap> extension_info_map_;
- std::vector<URLPattern> debug_patterns_;
- bool inverse_debug_patterns_;
- DISALLOW_COPY_AND_ASSIGN(NaClBrowserDelegateImpl);
+ DISALLOW_COPY_AND_ASSIGN(TestNaClBrowserDelegate);
};
-
-#endif // CHROME_BROWSER_NACL_HOST_NACL_BROWSER_DELEGATE_IMPL_H_
+#endif // COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_
« no previous file with comments | « components/nacl.gyp ('k') | components/nacl/common/test_nacl_browser_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698