Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / nacl_host / nacl_browser_delegate_impl.h
blob456d5336cd4428b6785f5e0e1eb652e7934dc7cf
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.
5 #ifndef CHROME_BROWSER_NACL_HOST_NACL_BROWSER_DELEGATE_IMPL_H_
6 #define CHROME_BROWSER_NACL_HOST_NACL_BROWSER_DELEGATE_IMPL_H_
8 #include <set>
9 #include <string>
11 #include "base/compiler_specific.h"
12 #include "components/nacl/browser/nacl_browser_delegate.h"
14 #if defined(ENABLE_EXTENSIONS)
15 #include "extensions/common/url_pattern.h"
17 namespace extensions {
18 class InfoMap;
20 #endif
22 class ProfileManager;
24 class NaClBrowserDelegateImpl : public NaClBrowserDelegate {
25 public:
26 explicit NaClBrowserDelegateImpl(ProfileManager* profile_manager);
27 ~NaClBrowserDelegateImpl() override;
29 void ShowMissingArchInfobar(int render_process_id,
30 int render_view_id) override;
31 bool DialogsAreSuppressed() override;
32 bool GetCacheDirectory(base::FilePath* cache_dir) override;
33 bool GetPluginDirectory(base::FilePath* plugin_dir) override;
34 bool GetPnaclDirectory(base::FilePath* pnacl_dir) override;
35 bool GetUserDirectory(base::FilePath* user_dir) override;
36 std::string GetVersionString() const override;
37 ppapi::host::HostFactory* CreatePpapiHostFactory(
38 content::BrowserPpapiHost* ppapi_host) override;
39 bool MapUrlToLocalFilePath(const GURL& url,
40 bool is_blocking,
41 const base::FilePath& profile_directory,
42 base::FilePath* file_path) override;
43 void SetDebugPatterns(const std::string& debug_patterns) override;
44 bool URLMatchesDebugPatterns(const GURL& manifest_url) override;
45 content::BrowserPpapiHost::OnKeepaliveCallback GetOnKeepaliveCallback()
46 override;
47 bool IsNonSfiModeAllowed(const base::FilePath& profile_directory,
48 const GURL& manifest_url) override;
50 private:
51 #if defined(ENABLE_EXTENSIONS)
52 scoped_refptr<extensions::InfoMap> GetExtensionInfoMap(
53 const base::FilePath& profile_directory);
54 std::vector<URLPattern> debug_patterns_;
55 #endif
57 ProfileManager* profile_manager_;
58 bool inverse_debug_patterns_;
59 std::set<std::string> allowed_nonsfi_origins_;
60 DISALLOW_COPY_AND_ASSIGN(NaClBrowserDelegateImpl);
64 #endif // CHROME_BROWSER_NACL_HOST_NACL_BROWSER_DELEGATE_IMPL_H_