OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ |
6 #define EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ | 6 #define EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ |
7 | 7 |
8 #include "extensions/browser/api/capture_web_contents_function.h" | 8 #include "extensions/browser/api/capture_web_contents_function.h" |
9 #include "extensions/browser/api/execute_code_function.h" | 9 #include "extensions/browser/api/execute_code_function.h" |
10 #include "extensions/browser/extension_function.h" | 10 #include "extensions/browser/extension_function.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 ~WebViewInternalExecuteCodeFunction() override; | 59 ~WebViewInternalExecuteCodeFunction() override; |
60 | 60 |
61 // Initialize |details_| if it hasn't already been. | 61 // Initialize |details_| if it hasn't already been. |
62 bool Init() override; | 62 bool Init() override; |
63 bool ShouldInsertCSS() const override; | 63 bool ShouldInsertCSS() const override; |
64 bool CanExecuteScriptOnPage() override; | 64 bool CanExecuteScriptOnPage() override; |
65 // Guarded by a process ID check. | 65 // Guarded by a process ID check. |
66 extensions::ScriptExecutor* GetScriptExecutor() final; | 66 extensions::ScriptExecutor* GetScriptExecutor() final; |
67 bool IsWebView() const override; | 67 bool IsWebView() const override; |
68 const GURL& GetWebViewSrc() const override; | 68 const GURL& GetWebViewSrc() const override; |
| 69 bool LoadFileForWebUI(const std::string& file_src, |
| 70 const WebUILoadFileCallback& callback) override; |
69 | 71 |
70 private: | 72 private: |
| 73 class WebUIURLFetcher; |
| 74 |
| 75 // Callbacks from WebUIURLFetcher. |
| 76 void OnWebUIURLFetchComplete(const WebUIURLFetcher* fetcher, |
| 77 bool is_success, |
| 78 std::string data); |
| 79 |
71 // Contains extension resource built from path of file which is | 80 // Contains extension resource built from path of file which is |
72 // specified in JSON arguments. | 81 // specified in JSON arguments. |
73 extensions::ExtensionResource resource_; | 82 extensions::ExtensionResource resource_; |
74 | 83 |
75 int guest_instance_id_; | 84 int guest_instance_id_; |
76 | 85 |
77 GURL guest_src_; | 86 GURL guest_src_; |
78 | 87 |
| 88 ScopedVector<WebUIURLFetcher> fetchers_; |
| 89 |
79 DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteCodeFunction); | 90 DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteCodeFunction); |
80 }; | 91 }; |
81 | 92 |
82 class WebViewInternalExecuteScriptFunction | 93 class WebViewInternalExecuteScriptFunction |
83 : public WebViewInternalExecuteCodeFunction { | 94 : public WebViewInternalExecuteCodeFunction { |
84 public: | 95 public: |
85 WebViewInternalExecuteScriptFunction(); | 96 WebViewInternalExecuteScriptFunction(); |
86 | 97 |
87 protected: | 98 protected: |
88 ~WebViewInternalExecuteScriptFunction() override {} | 99 ~WebViewInternalExecuteScriptFunction() override {} |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 uint32 remove_mask_; | 388 uint32 remove_mask_; |
378 // Tracks any data related or parse errors. | 389 // Tracks any data related or parse errors. |
379 bool bad_message_; | 390 bool bad_message_; |
380 | 391 |
381 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); | 392 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); |
382 }; | 393 }; |
383 | 394 |
384 } // namespace extensions | 395 } // namespace extensions |
385 | 396 |
386 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ | 397 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ |
OLD | NEW |