| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WEB_UI_USER_SCRIPT_LOADER_H_ | 5 #ifndef EXTENSIONS_BROWSER_WEB_UI_USER_SCRIPT_LOADER_H_ |
| 6 #define EXTENSIONS_BROWSER_WEB_UI_USER_SCRIPT_LOADER_H_ | 6 #define EXTENSIONS_BROWSER_WEB_UI_USER_SCRIPT_LOADER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 WebUIUserScriptLoader(content::BrowserContext* browser_context, | 26 WebUIUserScriptLoader(content::BrowserContext* browser_context, |
| 27 const HostID& host_id); | 27 const HostID& host_id); |
| 28 ~WebUIUserScriptLoader() override; | 28 ~WebUIUserScriptLoader() override; |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 struct UserScriptRenderInfo; | 31 struct UserScriptRenderInfo; |
| 32 using UserScriptRenderInfoMap = std::map<int, UserScriptRenderInfo>; | 32 using UserScriptRenderInfoMap = std::map<int, UserScriptRenderInfo>; |
| 33 | 33 |
| 34 // UserScriptLoader: | 34 // UserScriptLoader: |
| 35 void AddScripts(const std::set<extensions::UserScript>& scripts, | 35 void AddScripts(const extensions::UserScriptList& scripts, |
| 36 int render_process_id, | 36 int render_process_id, |
| 37 int render_frame_id) override; | 37 int render_frame_id) override; |
| 38 void LoadScripts(std::unique_ptr<extensions::UserScriptList> user_scripts, | 38 void LoadScripts(std::unique_ptr<extensions::UserScriptList> user_scripts, |
| 39 const std::set<HostID>& changed_hosts, | 39 const std::set<HostID>& changed_hosts, |
| 40 const std::set<int>& added_script_ids, | 40 const std::set<int>& added_script_ids, |
| 41 LoadScriptsCallback callback) override; | 41 LoadScriptsCallback callback) override; |
| 42 | 42 |
| 43 // Called at the end of each fetch, tracking whether all fetches are done. | 43 // Called at the end of each fetch, tracking whether all fetches are done. |
| 44 void OnSingleWebUIURLFetchComplete(extensions::UserScript::File* script_file, | 44 void OnSingleWebUIURLFetchComplete(extensions::UserScript::File* script_file, |
| 45 bool success, | 45 bool success, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 67 std::unique_ptr<extensions::UserScriptList> user_scripts_cache_; | 67 std::unique_ptr<extensions::UserScriptList> user_scripts_cache_; |
| 68 | 68 |
| 69 LoadScriptsCallback scripts_loaded_callback_; | 69 LoadScriptsCallback scripts_loaded_callback_; |
| 70 | 70 |
| 71 std::vector<std::unique_ptr<WebUIURLFetcher>> fetchers_; | 71 std::vector<std::unique_ptr<WebUIURLFetcher>> fetchers_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(WebUIUserScriptLoader); | 73 DISALLOW_COPY_AND_ASSIGN(WebUIUserScriptLoader); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 #endif // EXTENSIONS_BROWSER_WEB_UI_USER_SCRIPT_LOADER_H_ | 76 #endif // EXTENSIONS_BROWSER_WEB_UI_USER_SCRIPT_LOADER_H_ |
| OLD | NEW |