OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_NACL_BROWSER_NACL_BROWSER_DELEGATE_H_ | 5 #ifndef COMPONENTS_NACL_BROWSER_NACL_BROWSER_DELEGATE_H_ |
6 #define COMPONENTS_NACL_BROWSER_NACL_BROWSER_DELEGATE_H_ | 6 #define COMPONENTS_NACL_BROWSER_NACL_BROWSER_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 // Included because nested OnKeepaliveCallback class can't be forward declared. | |
yzshen1
2013/12/13 21:23:15
nit: might be okay to remove this comment because
scheib
2013/12/14 00:07:41
Done.
| |
12 #include "content/public/browser/browser_ppapi_host.h" | |
11 | 13 |
12 class GURL; | 14 class GURL; |
13 | 15 |
14 namespace base { | 16 namespace base { |
15 class FilePath; | 17 class FilePath; |
16 } | 18 } |
17 | 19 |
18 namespace ppapi { | 20 namespace ppapi { |
19 namespace host { | 21 namespace host { |
20 class HostFactory; | 22 class HostFactory; |
21 } | 23 } |
22 } | 24 } |
23 | 25 |
24 namespace content { | |
25 class BrowserPpapiHost; | |
26 } | |
27 | |
28 // Encapsulates the dependencies of NaCl code on chrome/, to avoid a direct | 26 // Encapsulates the dependencies of NaCl code on chrome/, to avoid a direct |
29 // dependency on chrome/. | 27 // dependency on chrome/. |
30 class NaClBrowserDelegate { | 28 class NaClBrowserDelegate { |
31 public: | 29 public: |
32 virtual ~NaClBrowserDelegate() {} | 30 virtual ~NaClBrowserDelegate() {} |
33 | 31 |
34 // Show an infobar to the user. | 32 // Show an infobar to the user. |
35 virtual void ShowNaClInfobar(int render_process_id, int render_view_id, | 33 virtual void ShowNaClInfobar(int render_process_id, int render_view_id, |
36 int error_id) = 0; | 34 int error_id) = 0; |
37 // Returns whether dialogs are allowed. This is used to decide if to add the | 35 // Returns whether dialogs are allowed. This is used to decide if to add the |
(...skipping 28 matching lines...) Expand all Loading... | |
66 // otherwise non blocking API will be used (which only handles a subset of the | 64 // otherwise non blocking API will be used (which only handles a subset of the |
67 // urls checking only the url scheme against kExtensionScheme). | 65 // urls checking only the url scheme against kExtensionScheme). |
68 virtual bool MapUrlToLocalFilePath(const GURL& url, | 66 virtual bool MapUrlToLocalFilePath(const GURL& url, |
69 bool use_blocking_api, | 67 bool use_blocking_api, |
70 base::FilePath* file_path) = 0; | 68 base::FilePath* file_path) = 0; |
71 // Set match patterns which will be checked before enabling debug stub. | 69 // Set match patterns which will be checked before enabling debug stub. |
72 virtual void SetDebugPatterns(std::string debug_patterns) = 0; | 70 virtual void SetDebugPatterns(std::string debug_patterns) = 0; |
73 | 71 |
74 // Returns whether NaCl application with this manifest URL should be debugged. | 72 // Returns whether NaCl application with this manifest URL should be debugged. |
75 virtual bool URLMatchesDebugPatterns(const GURL& manifest_url) = 0; | 73 virtual bool URLMatchesDebugPatterns(const GURL& manifest_url) = 0; |
74 | |
75 // Returns a callback that handles NaCl idle state transitions. | |
76 virtual content::BrowserPpapiHost::OnKeepaliveCallback | |
77 GetOnKeepaliveCallback() = 0; | |
76 }; | 78 }; |
77 | 79 |
78 #endif // COMPONENTS_NACL_BROWSER_NACL_BROWSER_DELEGATE_H_ | 80 #endif // COMPONENTS_NACL_BROWSER_NACL_BROWSER_DELEGATE_H_ |
OLD | NEW |