|
@@ -70,10 +70,10 @@ See also: components/user_scripts/README.md
|
|
.../browser/resources/user-script-ui/BUILD.gn | 12 +
|
|
.../browser/resources/user-script-ui/BUILD.gn | 12 +
|
|
.../user-script-ui/user-scripts-ui.html | 14 +
|
|
.../user-script-ui/user-scripts-ui.html | 14 +
|
|
.../user-script-ui/user-scripts-ui.js | 9 +
|
|
.../user-script-ui/user-scripts-ui.js | 9 +
|
|
- .../browser/ui/user_scripts_ui.cc | 148 ++++
|
|
|
|
- .../user_scripts/browser/ui/user_scripts_ui.h | 39 +
|
|
|
|
|
|
+ .../browser/ui/user_scripts_ui.cc | 147 ++++
|
|
|
|
+ .../user_scripts/browser/ui/user_scripts_ui.h | 37 +
|
|
.../browser/user_script_loader.cc | 721 ++++++++++++++++
|
|
.../browser/user_script_loader.cc | 721 ++++++++++++++++
|
|
- .../user_scripts/browser/user_script_loader.h | 170 ++++
|
|
|
|
|
|
+ .../user_scripts/browser/user_script_loader.h | 169 ++++
|
|
.../browser/user_script_pref_info.cc | 34 +
|
|
.../browser/user_script_pref_info.cc | 34 +
|
|
.../browser/user_script_pref_info.h | 72 ++
|
|
.../browser/user_script_pref_info.h | 72 ++
|
|
.../user_scripts/browser/user_script_prefs.cc | 276 ++++++
|
|
.../user_scripts/browser/user_script_prefs.cc | 276 ++++++
|
|
@@ -115,25 +115,25 @@ See also: components/user_scripts/README.md
|
|
.../renderer/script_injection_callback.cc | 25 +
|
|
.../renderer/script_injection_callback.cc | 25 +
|
|
.../renderer/script_injection_callback.h | 38 +
|
|
.../renderer/script_injection_callback.h | 38 +
|
|
.../renderer/script_injection_manager.cc | 417 +++++++++
|
|
.../renderer/script_injection_manager.cc | 417 +++++++++
|
|
- .../renderer/script_injection_manager.h | 102 +++
|
|
|
|
|
|
+ .../renderer/script_injection_manager.h | 101 +++
|
|
.../user_scripts/renderer/script_injector.h | 96 +++
|
|
.../user_scripts/renderer/script_injector.h | 96 +++
|
|
.../user_scripts/renderer/scripts_run_info.cc | 31 +
|
|
.../user_scripts/renderer/scripts_run_info.cc | 31 +
|
|
- .../user_scripts/renderer/scripts_run_info.h | 70 ++
|
|
|
|
|
|
+ .../user_scripts/renderer/scripts_run_info.h | 69 ++
|
|
.../renderer/user_script_injector.cc | 228 +++++
|
|
.../renderer/user_script_injector.cc | 228 +++++
|
|
- .../renderer/user_script_injector.h | 87 ++
|
|
|
|
|
|
+ .../renderer/user_script_injector.h | 86 ++
|
|
.../user_scripts/renderer/user_script_set.cc | 259 ++++++
|
|
.../user_scripts/renderer/user_script_set.cc | 259 ++++++
|
|
- .../user_scripts/renderer/user_script_set.h | 102 +++
|
|
|
|
|
|
+ .../user_scripts/renderer/user_script_set.h | 101 +++
|
|
.../renderer/user_script_set_manager.cc | 77 ++
|
|
.../renderer/user_script_set_manager.cc | 77 ++
|
|
.../renderer/user_script_set_manager.h | 61 ++
|
|
.../renderer/user_script_set_manager.h | 61 ++
|
|
.../renderer/user_scripts_dispatcher.cc | 36 +
|
|
.../renderer/user_scripts_dispatcher.cc | 36 +
|
|
- .../renderer/user_scripts_dispatcher.h | 48 ++
|
|
|
|
|
|
+ .../renderer/user_scripts_dispatcher.h | 49 ++
|
|
.../renderer/user_scripts_renderer_client.cc | 105 +++
|
|
.../renderer/user_scripts_renderer_client.cc | 105 +++
|
|
- .../renderer/user_scripts_renderer_client.h | 36 +
|
|
|
|
|
|
+ .../renderer/user_scripts_renderer_client.h | 37 +
|
|
.../renderer/web_ui_injection_host.cc | 40 +
|
|
.../renderer/web_ui_injection_host.cc | 40 +
|
|
- .../renderer/web_ui_injection_host.h | 28 +
|
|
|
|
|
|
+ .../renderer/web_ui_injection_host.h | 27 +
|
|
.../strings/userscripts_strings.grdp | 55 ++
|
|
.../strings/userscripts_strings.grdp | 55 ++
|
|
tools/gritsettings/resource_ids.spec | 6 +
|
|
tools/gritsettings/resource_ids.spec | 6 +
|
|
- 111 files changed, 9572 insertions(+), 2 deletions(-)
|
|
|
|
|
|
+ 111 files changed, 9565 insertions(+), 2 deletions(-)
|
|
create mode 100644 components/user_scripts/README.md
|
|
create mode 100644 components/user_scripts/README.md
|
|
create mode 100755 components/user_scripts/android/BUILD.gn
|
|
create mode 100755 components/user_scripts/android/BUILD.gn
|
|
create mode 100644 components/user_scripts/android/java/res/layout/accept_script_item.xml
|
|
create mode 100644 components/user_scripts/android/java/res/layout/accept_script_item.xml
|
|
@@ -430,7 +430,7 @@ diff --git a/chrome/browser/profiles/BUILD.gn b/chrome/browser/profiles/BUILD.gn
|
|
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
--- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
--- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
+++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
+++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
-@@ -228,6 +228,8 @@
|
|
|
|
|
|
+@@ -225,6 +225,8 @@
|
|
#include "chrome/browser/ui/cocoa/screentime/screentime_features.h"
|
|
#include "chrome/browser/ui/cocoa/screentime/screentime_features.h"
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -439,7 +439,7 @@ diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
namespace chrome {
|
|
namespace chrome {
|
|
|
|
|
|
void AddProfilesExtraParts(ChromeBrowserMainParts* main_parts) {
|
|
void AddProfilesExtraParts(ChromeBrowserMainParts* main_parts) {
|
|
-@@ -537,6 +539,7 @@ void ChromeBrowserMainExtraPartsProfiles::
|
|
|
|
|
|
+@@ -536,6 +538,7 @@ void ChromeBrowserMainExtraPartsProfiles::
|
|
#endif
|
|
#endif
|
|
WebDataServiceFactory::GetInstance();
|
|
WebDataServiceFactory::GetInstance();
|
|
webrtc_event_logging::WebRtcEventLogManagerKeyedServiceFactory::GetInstance();
|
|
webrtc_event_logging::WebRtcEventLogManagerKeyedServiceFactory::GetInstance();
|
|
@@ -2634,7 +2634,7 @@ diff --git a/components/user_scripts/browser/ui/user_scripts_ui.cc b/components/
|
|
new file mode 100644
|
|
new file mode 100644
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/browser/ui/user_scripts_ui.cc
|
|
+++ b/components/user_scripts/browser/ui/user_scripts_ui.cc
|
|
-@@ -0,0 +1,148 @@
|
|
|
|
|
|
+@@ -0,0 +1,147 @@
|
|
+/*
|
|
+/*
|
|
+ This file is part of Bromite.
|
|
+ This file is part of Bromite.
|
|
+
|
|
+
|
|
@@ -2657,7 +2657,6 @@ new file mode 100644
|
|
+
|
|
+
|
|
+#include "base/bind.h"
|
|
+#include "base/bind.h"
|
|
+#include "base/json/json_string_value_serializer.h"
|
|
+#include "base/json/json_string_value_serializer.h"
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/memory/writable_shared_memory_region.h"
|
|
+#include "base/memory/writable_shared_memory_region.h"
|
|
+#include "base/strings/string_util.h"
|
|
+#include "base/strings/string_util.h"
|
|
+#include "base/values.h"
|
|
+#include "base/values.h"
|
|
@@ -2680,6 +2679,8 @@ new file mode 100644
|
|
+
|
|
+
|
|
+class UserScriptsUIHandler : public content::WebUIMessageHandler {
|
|
+class UserScriptsUIHandler : public content::WebUIMessageHandler {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScriptsUIHandler(const UserScriptsUIHandler&) = delete;
|
|
|
|
++ UserScriptsUIHandler& operator=(const UserScriptsUIHandler&) = delete;
|
|
+ UserScriptsUIHandler();
|
|
+ UserScriptsUIHandler();
|
|
+ ~UserScriptsUIHandler() override;
|
|
+ ~UserScriptsUIHandler() override;
|
|
+
|
|
+
|
|
@@ -2696,8 +2697,6 @@ new file mode 100644
|
|
+ std::unique_ptr<user_scripts::UserScriptList> loaded_scripts_;
|
|
+ std::unique_ptr<user_scripts::UserScriptList> loaded_scripts_;
|
|
+
|
|
+
|
|
+ base::WeakPtrFactory<UserScriptsUIHandler> weak_factory_{this};
|
|
+ base::WeakPtrFactory<UserScriptsUIHandler> weak_factory_{this};
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(UserScriptsUIHandler);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+UserScriptsUIHandler::UserScriptsUIHandler()
|
|
+UserScriptsUIHandler::UserScriptsUIHandler()
|
|
@@ -2787,7 +2786,7 @@ diff --git a/components/user_scripts/browser/ui/user_scripts_ui.h b/components/u
|
|
new file mode 100644
|
|
new file mode 100644
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/browser/ui/user_scripts_ui.h
|
|
+++ b/components/user_scripts/browser/ui/user_scripts_ui.h
|
|
-@@ -0,0 +1,39 @@
|
|
|
|
|
|
+@@ -0,0 +1,37 @@
|
|
+/*
|
|
+/*
|
|
+ This file is part of Bromite.
|
|
+ This file is part of Bromite.
|
|
+
|
|
+
|
|
@@ -2808,7 +2807,6 @@ new file mode 100644
|
|
+#ifndef USERSCRIPTS_BROWSER_UI_USER_SCRIPTS_UI_H_
|
|
+#ifndef USERSCRIPTS_BROWSER_UI_USER_SCRIPTS_UI_H_
|
|
+#define USERSCRIPTS_BROWSER_UI_USER_SCRIPTS_UI_H_
|
|
+#define USERSCRIPTS_BROWSER_UI_USER_SCRIPTS_UI_H_
|
|
+
|
|
+
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "content/public/browser/web_ui_controller.h"
|
|
+#include "content/public/browser/web_ui_controller.h"
|
|
+
|
|
+
|
|
+namespace user_scripts {
|
|
+namespace user_scripts {
|
|
@@ -2817,17 +2815,15 @@ new file mode 100644
|
|
+
|
|
+
|
|
+class UserScriptsUI : public content::WebUIController {
|
|
+class UserScriptsUI : public content::WebUIController {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScriptsUI(const UserScriptsUI&) = delete;
|
|
|
|
++ UserScriptsUI& operator=(const UserScriptsUI&) = delete;
|
|
+ explicit UserScriptsUI(content::WebUI* web_ui);
|
|
+ explicit UserScriptsUI(content::WebUI* web_ui);
|
|
+ ~UserScriptsUI() override;
|
|
+ ~UserScriptsUI() override;
|
|
-+
|
|
|
|
-+ private:
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(UserScriptsUI);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
+#endif
|
|
+#endif
|
|
-\ No newline at end of file
|
|
|
|
diff --git a/components/user_scripts/browser/user_script_loader.cc b/components/user_scripts/browser/user_script_loader.cc
|
|
diff --git a/components/user_scripts/browser/user_script_loader.cc b/components/user_scripts/browser/user_script_loader.cc
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
@@ -3558,7 +3554,7 @@ diff --git a/components/user_scripts/browser/user_script_loader.h b/components/u
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/browser/user_script_loader.h
|
|
+++ b/components/user_scripts/browser/user_script_loader.h
|
|
-@@ -0,0 +1,170 @@
|
|
|
|
|
|
+@@ -0,0 +1,169 @@
|
|
+/*
|
|
+/*
|
|
+ This file is part of Bromite.
|
|
+ This file is part of Bromite.
|
|
+
|
|
+
|
|
@@ -3585,7 +3581,6 @@ new file mode 100755
|
|
+
|
|
+
|
|
+#include "base/callback_forward.h"
|
|
+#include "base/callback_forward.h"
|
|
+#include "base/compiler_specific.h"
|
|
+#include "base/compiler_specific.h"
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/memory/read_only_shared_memory_region.h"
|
|
+#include "base/memory/read_only_shared_memory_region.h"
|
|
+#include "base/memory/weak_ptr.h"
|
|
+#include "base/memory/weak_ptr.h"
|
|
+#include "base/observer_list.h"
|
|
+#include "base/observer_list.h"
|
|
@@ -3616,6 +3611,8 @@ new file mode 100755
|
|
+class UserScriptLoader : public content::RenderProcessHostCreationObserver,
|
|
+class UserScriptLoader : public content::RenderProcessHostCreationObserver,
|
|
+ public ui::SelectFileDialog::Listener {
|
|
+ public ui::SelectFileDialog::Listener {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScriptLoader(const UserScriptLoader&) = delete;
|
|
|
|
++ UserScriptLoader& operator=(const UserScriptLoader&) = delete;
|
|
+ using LoadScriptsCallback =
|
|
+ using LoadScriptsCallback =
|
|
+ base::OnceCallback<void(std::unique_ptr<UserScriptList>)>;
|
|
+ base::OnceCallback<void(std::unique_ptr<UserScriptList>)>;
|
|
+ using LoadSingleScriptCallback =
|
|
+ using LoadSingleScriptCallback =
|
|
@@ -3722,8 +3719,6 @@ new file mode 100755
|
|
+ bool result, const std::string& error );
|
|
+ bool result, const std::string& error );
|
|
+
|
|
+
|
|
+ base::WeakPtrFactory<UserScriptLoader> weak_factory_{this};
|
|
+ base::WeakPtrFactory<UserScriptLoader> weak_factory_{this};
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(UserScriptLoader);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+} // namespace extensions
|
|
+} // namespace extensions
|
|
@@ -3910,6 +3905,8 @@ new file mode 100644
|
|
+
|
|
+
|
|
+class PrefUpdate : public DictionaryPrefUpdate {
|
|
+class PrefUpdate : public DictionaryPrefUpdate {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ PrefUpdate(const PrefUpdate&) = delete;
|
|
|
|
++ PrefUpdate& operator=(const PrefUpdate&) = delete;
|
|
+ PrefUpdate(PrefService* service,
|
|
+ PrefUpdate(PrefService* service,
|
|
+ const std::string& id,
|
|
+ const std::string& id,
|
|
+ const std::string& path)
|
|
+ const std::string& path)
|
|
@@ -3928,8 +3925,6 @@ new file mode 100644
|
|
+
|
|
+
|
|
+ private:
|
|
+ private:
|
|
+ const std::string id_;
|
|
+ const std::string id_;
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(PrefUpdate);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+bool GetInt64FromPref(const base::DictionaryValue* dict,
|
|
+bool GetInt64FromPref(const base::DictionaryValue* dict,
|
|
@@ -6775,6 +6770,8 @@ new file mode 100755
|
|
+// extension.
|
|
+// extension.
|
|
+class UserScript {
|
|
+class UserScript {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScript(const UserScript&) = delete;
|
|
|
|
++ UserScript& operator=(const UserScript&) = delete;
|
|
+ // The file extension for standalone user scripts.
|
|
+ // The file extension for standalone user scripts.
|
|
+ static const char kFileExtension[];
|
|
+ static const char kFileExtension[];
|
|
+
|
|
+
|
|
@@ -7128,8 +7125,6 @@ new file mode 100755
|
|
+
|
|
+
|
|
+ // Script cannot be enabled
|
|
+ // Script cannot be enabled
|
|
+ bool force_disabled_ = false;
|
|
+ bool force_disabled_ = false;
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(UserScript);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+// Information we need while removing scripts from a UserScriptLoader.
|
|
+// Information we need while removing scripts from a UserScriptLoader.
|
|
@@ -8072,7 +8067,6 @@ new file mode 100755
|
|
+#include "base/bind.h"
|
|
+#include "base/bind.h"
|
|
+#include "base/feature_list.h"
|
|
+#include "base/feature_list.h"
|
|
+#include "base/lazy_instance.h"
|
|
+#include "base/lazy_instance.h"
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/metrics/histogram_macros.h"
|
|
+#include "base/metrics/histogram_macros.h"
|
|
+#include "base/timer/elapsed_timer.h"
|
|
+#include "base/timer/elapsed_timer.h"
|
|
+#include "base/values.h"
|
|
+#include "base/values.h"
|
|
@@ -8177,6 +8171,8 @@ new file mode 100755
|
|
+// false.
|
|
+// false.
|
|
+class ScriptInjection::FrameWatcher : public content::RenderFrameObserver {
|
|
+class ScriptInjection::FrameWatcher : public content::RenderFrameObserver {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ FrameWatcher(const FrameWatcher&) = delete;
|
|
|
|
++ FrameWatcher& operator=(const FrameWatcher&) = delete;
|
|
+ FrameWatcher(content::RenderFrame* render_frame,
|
|
+ FrameWatcher(content::RenderFrame* render_frame,
|
|
+ ScriptInjection* injection)
|
|
+ ScriptInjection* injection)
|
|
+ : content::RenderFrameObserver(render_frame),
|
|
+ : content::RenderFrameObserver(render_frame),
|
|
@@ -8188,8 +8184,6 @@ new file mode 100755
|
|
+ void OnDestruct() override { injection_->invalidate_render_frame(); }
|
|
+ void OnDestruct() override { injection_->invalidate_render_frame(); }
|
|
+
|
|
+
|
|
+ ScriptInjection* injection_;
|
|
+ ScriptInjection* injection_;
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(FrameWatcher);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+// static
|
|
+// static
|
|
@@ -8345,7 +8339,8 @@ new file mode 100755
|
|
+ render_frame_->GetWebFrame()->RequestExecuteScript(
|
|
+ render_frame_->GetWebFrame()->RequestExecuteScript(
|
|
+ world_id, sources, is_user_gesture,
|
|
+ world_id, sources, is_user_gesture,
|
|
+ execution_option, callback.release(),
|
|
+ execution_option, callback.release(),
|
|
-+ blink::BackForwardCacheAware::kPossiblyDisallow);
|
|
|
|
|
|
++ blink::BackForwardCacheAware::kPossiblyDisallow,
|
|
|
|
++ blink::WebLocalFrame::PromiseBehavior::kDontWait);
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
+void ScriptInjection::OnJsInjectionCompleted(
|
|
+void ScriptInjection::OnJsInjectionCompleted(
|
|
@@ -9061,7 +9056,7 @@ diff --git a/components/user_scripts/renderer/script_injection_manager.h b/compo
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/renderer/script_injection_manager.h
|
|
+++ b/components/user_scripts/renderer/script_injection_manager.h
|
|
-@@ -0,0 +1,102 @@
|
|
|
|
|
|
+@@ -0,0 +1,101 @@
|
|
+#include <stdint.h>
|
|
+#include <stdint.h>
|
|
+
|
|
+
|
|
+#include <map>
|
|
+#include <map>
|
|
@@ -9070,7 +9065,6 @@ new file mode 100755
|
|
+#include <vector>
|
|
+#include <vector>
|
|
+
|
|
+
|
|
+#include "base/callback.h"
|
|
+#include "base/callback.h"
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/scoped_observation.h"
|
|
+#include "base/scoped_observation.h"
|
|
+#include "../common/user_script.h"
|
|
+#include "../common/user_script.h"
|
|
+#include "script_injection.h"
|
|
+#include "script_injection.h"
|
|
@@ -9084,6 +9078,8 @@ new file mode 100755
|
|
+// load point, and injecting them when ready.
|
|
+// load point, and injecting them when ready.
|
|
+class ScriptInjectionManager : public UserScriptSetManager::Observer {
|
|
+class ScriptInjectionManager : public UserScriptSetManager::Observer {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ ScriptInjectionManager(const ScriptInjectionManager&) = delete;
|
|
|
|
++ ScriptInjectionManager& operator=(const ScriptInjectionManager&) = delete;
|
|
+ explicit ScriptInjectionManager(
|
|
+ explicit ScriptInjectionManager(
|
|
+ UserScriptSetManager* user_script_set_manager);
|
|
+ UserScriptSetManager* user_script_set_manager);
|
|
+ virtual ~ScriptInjectionManager();
|
|
+ virtual ~ScriptInjectionManager();
|
|
@@ -9159,8 +9155,6 @@ new file mode 100755
|
|
+
|
|
+
|
|
+ base::ScopedObservation<UserScriptSetManager, UserScriptSetManager::Observer>
|
|
+ base::ScopedObservation<UserScriptSetManager, UserScriptSetManager::Observer>
|
|
+ user_script_set_manager_observation_{this};
|
|
+ user_script_set_manager_observation_{this};
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(ScriptInjectionManager);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+}
|
|
+}
|
|
@@ -9305,7 +9299,7 @@ diff --git a/components/user_scripts/renderer/scripts_run_info.h b/components/us
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/renderer/scripts_run_info.h
|
|
+++ b/components/user_scripts/renderer/scripts_run_info.h
|
|
-@@ -0,0 +1,70 @@
|
|
|
|
|
|
+@@ -0,0 +1,69 @@
|
|
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// found in the LICENSE file.
|
|
+// found in the LICENSE file.
|
|
@@ -9319,7 +9313,6 @@ new file mode 100755
|
|
+#include <set>
|
|
+#include <set>
|
|
+#include <string>
|
|
+#include <string>
|
|
+
|
|
+
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/timer/elapsed_timer.h"
|
|
+#include "base/timer/elapsed_timer.h"
|
|
+#include "../common/user_script.h"
|
|
+#include "../common/user_script.h"
|
|
+
|
|
+
|
|
@@ -9331,6 +9324,8 @@ new file mode 100755
|
|
+
|
|
+
|
|
+// A struct containing information about a script run.
|
|
+// A struct containing information about a script run.
|
|
+struct ScriptsRunInfo {
|
|
+struct ScriptsRunInfo {
|
|
|
|
++ ScriptsRunInfo(const ScriptsRunInfo&) = delete;
|
|
|
|
++ ScriptsRunInfo& operator=(const ScriptsRunInfo&) = delete;
|
|
+ // Map of extensions IDs to the executing script paths.
|
|
+ // Map of extensions IDs to the executing script paths.
|
|
+ typedef std::map<std::string, std::set<std::string> > ExecutingScriptsMap;
|
|
+ typedef std::map<std::string, std::set<std::string> > ExecutingScriptsMap;
|
|
+
|
|
+
|
|
@@ -9369,8 +9364,6 @@ new file mode 100755
|
|
+
|
|
+
|
|
+ // The url of the frame, preserved for the same reason as the routing id.
|
|
+ // The url of the frame, preserved for the same reason as the routing id.
|
|
+ GURL frame_url_;
|
|
+ GURL frame_url_;
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(ScriptsRunInfo);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+} // namespace extensions
|
|
+} // namespace extensions
|
|
@@ -9613,7 +9606,7 @@ diff --git a/components/user_scripts/renderer/user_script_injector.h b/component
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/renderer/user_script_injector.h
|
|
+++ b/components/user_scripts/renderer/user_script_injector.h
|
|
-@@ -0,0 +1,87 @@
|
|
|
|
|
|
+@@ -0,0 +1,86 @@
|
|
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// found in the LICENSE file.
|
|
+// found in the LICENSE file.
|
|
@@ -9624,7 +9617,6 @@ new file mode 100755
|
|
+#include <memory>
|
|
+#include <memory>
|
|
+#include <string>
|
|
+#include <string>
|
|
+
|
|
+
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/values.h"
|
|
+#include "base/values.h"
|
|
+#include "base/scoped_observation.h"
|
|
+#include "base/scoped_observation.h"
|
|
+#include "../common/user_script.h"
|
|
+#include "../common/user_script.h"
|
|
@@ -9643,6 +9635,8 @@ new file mode 100755
|
|
+class UserScriptInjector : public ScriptInjector,
|
|
+class UserScriptInjector : public ScriptInjector,
|
|
+ public UserScriptSet::Observer {
|
|
+ public UserScriptSet::Observer {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScriptInjector(const UserScriptInjector&) = delete;
|
|
|
|
++ UserScriptInjector& operator=(const UserScriptInjector&) = delete;
|
|
+ UserScriptInjector(const UserScript* user_script,
|
|
+ UserScriptInjector(const UserScript* user_script,
|
|
+ UserScriptSet* user_script_set);
|
|
+ UserScriptSet* user_script_set);
|
|
+ ~UserScriptInjector() override;
|
|
+ ~UserScriptInjector() override;
|
|
@@ -9694,8 +9688,6 @@ new file mode 100755
|
|
+
|
|
+
|
|
+ base::ScopedObservation<UserScriptSet, UserScriptSet::Observer>
|
|
+ base::ScopedObservation<UserScriptSet, UserScriptSet::Observer>
|
|
+ user_script_set_observer_{this};
|
|
+ user_script_set_observer_{this};
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(UserScriptInjector);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+} // namespace extensions
|
|
+} // namespace extensions
|
|
@@ -9969,7 +9961,7 @@ diff --git a/components/user_scripts/renderer/user_script_set.h b/components/use
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/renderer/user_script_set.h
|
|
+++ b/components/user_scripts/renderer/user_script_set.h
|
|
-@@ -0,0 +1,102 @@
|
|
|
|
|
|
+@@ -0,0 +1,101 @@
|
|
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// found in the LICENSE file.
|
|
+// found in the LICENSE file.
|
|
@@ -9983,7 +9975,6 @@ new file mode 100755
|
|
+#include <string>
|
|
+#include <string>
|
|
+#include <vector>
|
|
+#include <vector>
|
|
+
|
|
+
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/memory/read_only_shared_memory_region.h"
|
|
+#include "base/memory/read_only_shared_memory_region.h"
|
|
+#include "base/observer_list.h"
|
|
+#include "base/observer_list.h"
|
|
+#include "../common/user_script.h"
|
|
+#include "../common/user_script.h"
|
|
@@ -10003,6 +9994,8 @@ new file mode 100755
|
|
+// inject on a page.
|
|
+// inject on a page.
|
|
+class UserScriptSet {
|
|
+class UserScriptSet {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScriptSet(const UserScriptSet&) = delete;
|
|
|
|
++ UserScriptSet& operator=(const UserScriptSet&) = delete;
|
|
+ class Observer {
|
|
+ class Observer {
|
|
+ public:
|
|
+ public:
|
|
+ // Called when the set of user scripts is updated. |changed_hosts| contains
|
|
+ // Called when the set of user scripts is updated. |changed_hosts| contains
|
|
@@ -10065,8 +10058,6 @@ new file mode 100755
|
|
+
|
|
+
|
|
+ // The associated observers.
|
|
+ // The associated observers.
|
|
+ base::ObserverList<Observer>::Unchecked observers_;
|
|
+ base::ObserverList<Observer>::Unchecked observers_;
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(UserScriptSet);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+} // namespace extensions
|
|
+} // namespace extensions
|
|
@@ -10267,7 +10258,7 @@ diff --git a/components/user_scripts/renderer/user_scripts_dispatcher.h b/compon
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/renderer/user_scripts_dispatcher.h
|
|
+++ b/components/user_scripts/renderer/user_scripts_dispatcher.h
|
|
-@@ -0,0 +1,48 @@
|
|
|
|
|
|
+@@ -0,0 +1,49 @@
|
|
+#ifndef USERSCRIPTS_RENDER_DISPATCHER_H_
|
|
+#ifndef USERSCRIPTS_RENDER_DISPATCHER_H_
|
|
+#define USERSCRIPTS_RENDER_DISPATCHER_H_
|
|
+#define USERSCRIPTS_RENDER_DISPATCHER_H_
|
|
+
|
|
+
|
|
@@ -10283,7 +10274,6 @@ new file mode 100755
|
|
+#include <utility>
|
|
+#include <utility>
|
|
+#include <vector>
|
|
+#include <vector>
|
|
+
|
|
+
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "base/scoped_observation.h"
|
|
+#include "base/scoped_observation.h"
|
|
+#include "content/public/renderer/render_thread_observer.h"
|
|
+#include "content/public/renderer/render_thread_observer.h"
|
|
+#include "content/public/renderer/render_thread.h"
|
|
+#include "content/public/renderer/render_thread.h"
|
|
@@ -10297,6 +10287,8 @@ new file mode 100755
|
|
+ public UserScriptSetManager::Observer {
|
|
+ public UserScriptSetManager::Observer {
|
|
+
|
|
+
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScriptsDispatcher(const UserScriptsDispatcher&) = delete;
|
|
|
|
++ UserScriptsDispatcher& operator=(const UserScriptsDispatcher&) = delete;
|
|
+ explicit UserScriptsDispatcher();
|
|
+ explicit UserScriptsDispatcher();
|
|
+ ~UserScriptsDispatcher() override;
|
|
+ ~UserScriptsDispatcher() override;
|
|
+
|
|
+
|
|
@@ -10316,7 +10308,6 @@ new file mode 100755
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
+#endif
|
|
+#endif
|
|
-\ No newline at end of file
|
|
|
|
diff --git a/components/user_scripts/renderer/user_scripts_renderer_client.cc b/components/user_scripts/renderer/user_scripts_renderer_client.cc
|
|
diff --git a/components/user_scripts/renderer/user_scripts_renderer_client.cc b/components/user_scripts/renderer/user_scripts_renderer_client.cc
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
@@ -10432,14 +10423,13 @@ diff --git a/components/user_scripts/renderer/user_scripts_renderer_client.h b/c
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/renderer/user_scripts_renderer_client.h
|
|
+++ b/components/user_scripts/renderer/user_scripts_renderer_client.h
|
|
-@@ -0,0 +1,36 @@
|
|
|
|
|
|
+@@ -0,0 +1,37 @@
|
|
+#ifndef USERSCRIPTS_RENDER_CLIENT_H_
|
|
+#ifndef USERSCRIPTS_RENDER_CLIENT_H_
|
|
+#define USERSCRIPTS_RENDER_CLIENT_H_
|
|
+#define USERSCRIPTS_RENDER_CLIENT_H_
|
|
+
|
|
+
|
|
+#include <memory>
|
|
+#include <memory>
|
|
+#include <string>
|
|
+#include <string>
|
|
+
|
|
+
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "user_scripts_dispatcher.h"
|
|
+#include "user_scripts_dispatcher.h"
|
|
+#include "services/service_manager/public/cpp/binder_registry.h"
|
|
+#include "services/service_manager/public/cpp/binder_registry.h"
|
|
+
|
|
+
|
|
@@ -10447,6 +10437,8 @@ new file mode 100755
|
|
+
|
|
+
|
|
+class UserScriptsRendererClient {
|
|
+class UserScriptsRendererClient {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ UserScriptsRendererClient(const UserScriptsRendererClient&) = delete;
|
|
|
|
++ UserScriptsRendererClient& operator=(const UserScriptsRendererClient&) = delete;
|
|
+ UserScriptsRendererClient();
|
|
+ UserScriptsRendererClient();
|
|
+ ~UserScriptsRendererClient();
|
|
+ ~UserScriptsRendererClient();
|
|
+
|
|
+
|
|
@@ -10469,7 +10461,6 @@ new file mode 100755
|
|
+}
|
|
+}
|
|
+
|
|
+
|
|
+#endif
|
|
+#endif
|
|
-\ No newline at end of file
|
|
|
|
diff --git a/components/user_scripts/renderer/web_ui_injection_host.cc b/components/user_scripts/renderer/web_ui_injection_host.cc
|
|
diff --git a/components/user_scripts/renderer/web_ui_injection_host.cc b/components/user_scripts/renderer/web_ui_injection_host.cc
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
@@ -10519,7 +10510,7 @@ diff --git a/components/user_scripts/renderer/web_ui_injection_host.h b/componen
|
|
new file mode 100755
|
|
new file mode 100755
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/components/user_scripts/renderer/web_ui_injection_host.h
|
|
+++ b/components/user_scripts/renderer/web_ui_injection_host.h
|
|
-@@ -0,0 +1,28 @@
|
|
|
|
|
|
+@@ -0,0 +1,27 @@
|
|
+// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
+// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// Use of this source code is governed by a BSD-style license that can be
|
|
+// found in the LICENSE file.
|
|
+// found in the LICENSE file.
|
|
@@ -10527,11 +10518,12 @@ new file mode 100755
|
|
+#ifndef USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
|
|
+#ifndef USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
|
|
+#define USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
|
|
+#define USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
|
|
+
|
|
+
|
|
-+#include "base/macros.h"
|
|
|
|
+#include "injection_host.h"
|
|
+#include "injection_host.h"
|
|
+
|
|
+
|
|
+class WebUIInjectionHost : public InjectionHost {
|
|
+class WebUIInjectionHost : public InjectionHost {
|
|
+ public:
|
|
+ public:
|
|
|
|
++ WebUIInjectionHost(const WebUIInjectionHost&) = delete;
|
|
|
|
++ WebUIInjectionHost& operator=(const WebUIInjectionHost&) = delete;
|
|
+ WebUIInjectionHost(const HostID& host_id);
|
|
+ WebUIInjectionHost(const HostID& host_id);
|
|
+ ~WebUIInjectionHost() override;
|
|
+ ~WebUIInjectionHost() override;
|
|
+
|
|
+
|
|
@@ -10543,8 +10535,6 @@ new file mode 100755
|
|
+
|
|
+
|
|
+ private:
|
|
+ private:
|
|
+ GURL url_;
|
|
+ GURL url_;
|
|
-+
|
|
|
|
-+ DISALLOW_COPY_AND_ASSIGN(WebUIInjectionHost);
|
|
|
|
+};
|
|
+};
|
|
+
|
|
+
|
|
+#endif // USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
|
|
+#endif // USERSCRIPTS_RENDERER_WEB_UI_INJECTION_HOST_H_
|