shell_nacl_browser_delegate.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2014 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. #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_NACL_BROWSER_DELEGATE_H_
  5. #define EXTENSIONS_SHELL_BROWSER_SHELL_NACL_BROWSER_DELEGATE_H_
  6. #include "base/compiler_specific.h"
  7. #include "base/memory/raw_ptr.h"
  8. #include "components/nacl/browser/nacl_browser_delegate.h"
  9. namespace content {
  10. class BrowserContext;
  11. }
  12. namespace extensions {
  13. class InfoMap;
  14. // A lightweight NaClBrowserDelegate for app_shell. Only supports a single
  15. // BrowserContext.
  16. class ShellNaClBrowserDelegate : public NaClBrowserDelegate {
  17. public:
  18. // Uses |context| to look up extensions via InfoMap on the IO thread.
  19. explicit ShellNaClBrowserDelegate(content::BrowserContext* context);
  20. ShellNaClBrowserDelegate(const ShellNaClBrowserDelegate&) = delete;
  21. ShellNaClBrowserDelegate& operator=(const ShellNaClBrowserDelegate&) = delete;
  22. ~ShellNaClBrowserDelegate() override;
  23. // NaClBrowserDelegate overrides:
  24. void ShowMissingArchInfobar(int render_process_id,
  25. int render_frame_id) override;
  26. bool DialogsAreSuppressed() override;
  27. bool GetCacheDirectory(base::FilePath* cache_dir) override;
  28. bool GetPluginDirectory(base::FilePath* plugin_dir) override;
  29. bool GetPnaclDirectory(base::FilePath* pnacl_dir) override;
  30. bool GetUserDirectory(base::FilePath* user_dir) override;
  31. std::string GetVersionString() const override;
  32. ppapi::host::HostFactory* CreatePpapiHostFactory(
  33. content::BrowserPpapiHost* ppapi_host) override;
  34. MapUrlToLocalFilePathCallback GetMapUrlToLocalFilePathCallback(
  35. const base::FilePath& profile_directory) override;
  36. void SetDebugPatterns(const std::string& debug_patterns) override;
  37. bool URLMatchesDebugPatterns(const GURL& manifest_url) override;
  38. private:
  39. raw_ptr<content::BrowserContext> browser_context_; // Not owned.
  40. };
  41. } // namespace extensions
  42. #endif // EXTENSIONS_SHELL_BROWSER_SHELL_NACL_BROWSER_DELEGATE_H_