testonly flag should be defined for test related modules only.
This commit also removes chromium-efl's dependency on content_shell.pak,
now it is are generating its own pak file named ewk_efl_resources.pak
Change-Id: Idbf20e8e09797acc286a226998d990454e1e290e
Signed-off-by: Rituraj Rai <rituraj.rai@samsung.com>
%files engine
%manifest packaging/chromium-efl.manifest
%{_engine_root_dir}/version
-%{_engine_root_dir}/bin/content_shell.pak
+%{_engine_root_dir}/bin/ewk_efl_resources.pak
%{_engine_root_dir}/bin/snapshot_blob.bin
%{_engine_root_dir}/lib
%{_engine_root_dir}/res/images
install -m 0644 "%{OUTPUT_FOLDER}"/version "%{buildroot}"%{CHROMIUM_LIB_DIR}/
install -m 0644 "%{OUTPUT_FOLDER}"/snapshot_blob.bin "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/
-install -m 0644 "%{OUTPUT_FOLDER}"/content_shell.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/
+install -m 0644 "%{OUTPUT_FOLDER}"/ewk_efl_resources.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/
install -d "%{buildroot}"%{_bindir}
install -d "%{buildroot}"%{_libdir}
%{CHROMIUM_LIB_DIR}/version
%{CHROMIUM_LIB_DIR}/bin/snapshot_blob.bin
-%{CHROMIUM_LIB_DIR}/bin/content_shell.pak
+%{CHROMIUM_LIB_DIR}/bin/ewk_efl_resources.pak
%{CHROMIUM_LIB_DIR}/bin/locales/*.pak
%{CHROMIUM_LIB_DIR}/res/locale/*
import("//tizen_src/build/config/tizen_features.gni")
group("chromium_efl_all") {
- testonly = true
deps = [
"//tizen_src/ewk/efl_webview_app:efl_webview_app",
"//tizen_src/ewk/ubrowser:ubrowser",
import("//printing/buildflags/buildflags.gni")
import("//testing/test.gni")
import("//tizen_src/build/config/tizen_features.gni")
+import("//tools/grit/grit_rule.gni")
+import("//tools/grit/repack.gni")
# Components used to auto generate CHROMIUM_VERSION preprocessor define.
version_file = "//chrome/VERSION"
version_pattern = "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
group("libchromium-ewk") {
- testonly = true
if (enable_ewk_interface) {
deps = [ "//tizen_src/downloadable:ewk-interface" ]
} else {
}
}
+grit("efl_resources_grit") {
+ # External code should depend on ":resources" instead.
+ visibility = [ ":*" ]
+ source = "efl_resources.grd"
+ outputs = [
+ "grit/efl_resources.h",
+ "efl_resources.pak",
+ ]
+}
+
+repack("efl_pak") {
+ sources = [
+ "$root_gen_dir/content/attribution_internals_resources.pak",
+ "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
+ "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
+ "$root_gen_dir/content/content_resources.pak",
+ "$root_gen_dir/content/gpu_resources.pak",
+ "$root_gen_dir/content/histograms_resources.pak",
+ "$root_gen_dir/content/process_resources.pak",
+ "$root_gen_dir/content/quota_internals_resources.pak",
+ "$root_gen_dir/content/service_worker_resources.pak",
+ "$root_gen_dir/content/browser/devtools/devtools_resources.pak",
+ "$root_gen_dir/tizen_src/ewk/efl_integration/efl_resources.pak",
+ "$root_gen_dir/content/traces_internals_resources.pak",
+ "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
+ "$root_gen_dir/net/net_resources.pak",
+ "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
+ "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
+ "$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
+ "$root_gen_dir/third_party/blink/public/strings/blink_strings_en-US.pak",
+ "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
+ "$root_gen_dir/ui/resources/webui_resources.pak",
+ "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
+ "$root_gen_dir/ui/strings/ax_strings_en-US.pak",
+ "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
+ ]
+
+ deps = [
+ ":efl_resources_grit",
+ "//content:content_resources",
+ "//content/browser/resources:resources",
+ "//content/browser/resources/media:resources",
+ "//content/browser/webrtc/resources",
+ "//content/browser/devtools:devtools_resources",
+ "//mojo/public/js:resources",
+ "//net:net_resources",
+ "//third_party/blink/public:devtools_inspector_resources",
+ "//third_party/blink/public:resources",
+ "//third_party/blink/public:scaled_resources_100_percent",
+ "//third_party/blink/public/strings",
+ "//ui/resources",
+ "//ui/strings",
+ ]
+
+ output = "$root_out_dir/ewk_efl_resources.pak"
+}
+
component("chromium_ewk_component") {
include_dirs = [ "." ]
}
shared_library("chromium-ewk") {
- testonly = true
if (enable_ewk_interface) {
output_name = "chromium-impl"
}
"//components/visitedlink/browser",
"//components/visitedlink/renderer",
"//content/public/app",
- "//content/shell:pak",
- "//content/shell:resources",
+ ":efl_pak",
"//printing",
"//services/device:lib",
"//skia",
"//ui/events",
"//ui/events:events_base",
"//ui/gl",
- "//ui/views:test_support",
"//v8",
]
"web_contents_view_delegate_efl.h",
"webview_delegate_efl.cc",
"webview_delegate_efl.h",
+ "focus_client_efl.h",
+ "focus_client_efl.cc",
+ "window_parenting_client_efl.h",
+ "window_parenting_client_efl.cc",
# Make use of Android webview"s simplified pref class.
"browser/autofill/autocomplete_history_manager_factory.cc",
}
executable("efl_webprocess") {
- testonly = true
sources = [ "efl_webprocess.cc" ]
deps = [ ":libchromium-ewk" ]
if (is_tizen && !tizen_product_tv) {
#include "base/containers/contains.h"
#include "base/stl_util.h"
+#include "base/logging.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "url/origin.h"
base::FilePath pak_dir;
base::FilePath pak_file;
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
- pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak"));
+ pak_file = pak_dir.Append(FILE_PATH_LITERAL("ewk_efl_resources.pak"));
ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
const base::CommandLine& command_line =
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
#include "content/shell/browser/shell.h"
-#include "content/shell/grit/shell_resources.h"
+#include "tizen_src/ewk/efl_integration/grit/efl_resources.h"
#include "net/base/net_errors.h"
#include "net/socket/tcp_server_socket.h"
#include "third_party/zlib/google/compression_utils.h"
std::string DevToolsDelegateEfl::GetDiscoveryPageHTML() {
std::string data =
std::string(ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE));
+ IDR_EFL_DEVTOOLS_DISCOVERY_PAGE));
if (data.length() > 2 && data[0] == '\x1F' && data[1] == '\x8B') {
std::string uncompressed_data;
if (compression::GzipUncompress(data, &uncompressed_data))
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
+ <outputs>
+ <output filename="grit/efl_resources.h" type="rc_header">
+ <emit emit_type='prepend'></emit>
+ </output>
+ <output filename="efl_resources.pak" type="data_package" />
+ </outputs>
+ <translations />
+ <release seq="1">
+ <includes>
+ <include name="IDR_EFL_DEVTOOLS_DISCOVERY_PAGE" file="resources/efl_devtools_discovery_page.html" type="BINDATA" />
+ </includes>
+ </release>
+</grit>
#include "third_party/blink/public/platform/web_string.h"
#include "tizen/system_info.h"
#include "ui/aura/env.h"
-#include "ui/aura/test/test_focus_client.h"
-#include "ui/aura/test/test_window_parenting_client.h"
+#include "focus_client_efl.h"
+#include "window_parenting_client_efl.h"
#include "ui/aura/window.h"
#include "ui/base/clipboard/clipboard_helper_efl.h"
#include "ui/base/l10n/l10n_util.h"
host_->window()->Show();
focus_client_ =
- std::make_unique<aura::test::TestFocusClient>(host_->window());
+ std::make_unique<aura::FocusClientEfl>(host_->window());
window_parenting_client_ =
- std::make_unique<aura::test::TestWindowParentingClient>(host_->window());
+ std::make_unique<aura::WindowParentingClientEfl>(host_->window());
compositor_observer_ = std::make_unique<ui::CompositorObserverEfl>(
host_->compositor(), web_contents_.get());
--- /dev/null
+// Copyright 2025 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "focus_client_efl.h"
+
+#include "ui/aura/client/focus_change_observer.h"
+#include "ui/aura/window.h"
+
+namespace aura {
+
+////////////////////////////////////////////////////////////////////////////////
+// FocusClientEfl, public:
+
+FocusClientEfl::FocusClientEfl(Window* root_window)
+ : root_window_(root_window) {
+ DCHECK(root_window_);
+ client::SetFocusClient(root_window_, this);
+}
+
+FocusClientEfl::~FocusClientEfl() {
+ client::SetFocusClient(root_window_, nullptr);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// FocusClientEfl, client::FocusClient implementation:
+
+void FocusClientEfl::AddObserver(client::FocusChangeObserver* observer) {
+ focus_observers_.AddObserver(observer);
+}
+
+void FocusClientEfl::RemoveObserver(client::FocusChangeObserver* observer) {
+ focus_observers_.RemoveObserver(observer);
+}
+
+void FocusClientEfl::FocusWindow(Window* window) {
+ if (window && !window->CanFocus())
+ return;
+
+ if (focused_window_) {
+ DCHECK(observation_manager_.IsObservingSource(focused_window_.get()));
+ observation_manager_.Reset();
+ }
+ aura::Window* old_focused_window = focused_window_;
+ focused_window_ = window;
+ if (focused_window_)
+ observation_manager_.Observe(focused_window_.get());
+
+ for (aura::client::FocusChangeObserver& observer : focus_observers_)
+ observer.OnWindowFocused(focused_window_, old_focused_window);
+ client::FocusChangeObserver* observer =
+ client::GetFocusChangeObserver(old_focused_window);
+ if (observer)
+ observer->OnWindowFocused(focused_window_, old_focused_window);
+ observer = client::GetFocusChangeObserver(focused_window_);
+ if (observer)
+ observer->OnWindowFocused(focused_window_, old_focused_window);
+}
+
+void FocusClientEfl::ResetFocusWithinActiveWindow(Window* window) {
+ if (!window->Contains(focused_window_))
+ FocusWindow(window);
+}
+
+Window* FocusClientEfl::GetFocusedWindow() {
+ return focused_window_;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// FocusClientEfl, WindowObserver implementation:
+
+void FocusClientEfl::OnWindowDestroying(Window* window) {
+ DCHECK_EQ(window, focused_window_);
+ FocusWindow(nullptr);
+}
+
+} // namespace aura
--- /dev/null
+// Copyright 2025 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FOCUS_CLIENT_EFL_H_
+#define FOCUS_CLIENT_EFL_H_
+
+#include "base/memory/raw_ptr.h"
+#include "base/observer_list.h"
+#include "base/scoped_observation.h"
+#include "ui/aura/client/focus_client.h"
+#include "ui/aura/window_observer.h"
+
+namespace aura {
+
+class FocusClientEfl : public client::FocusClient,
+ public WindowObserver {
+ public:
+ explicit FocusClientEfl(Window* root_window);
+
+ FocusClientEfl(const FocusClientEfl&) = delete;
+ FocusClientEfl& operator=(const FocusClientEfl&) = delete;
+
+ ~FocusClientEfl() override;
+
+ private:
+ // Overridden from client::FocusClient:
+ void AddObserver(client::FocusChangeObserver* observer) override;
+ void RemoveObserver(client::FocusChangeObserver* observer) override;
+ void FocusWindow(Window* window) override;
+ void ResetFocusWithinActiveWindow(Window* window) override;
+ Window* GetFocusedWindow() override;
+
+ // Overridden from WindowObserver:
+ void OnWindowDestroying(Window* window) override;
+
+ raw_ptr<Window> root_window_;
+ raw_ptr<Window> focused_window_ = nullptr;
+ base::ScopedObservation<Window, WindowObserver> observation_manager_{this};
+ base::ObserverList<aura::client::FocusChangeObserver> focus_observers_;
+};
+
+} // namespace aura
+
+#endif // FOCUS_CLIENT_EFL_H_
--- /dev/null
+<html>
+<head>
+<title>ewk browser remote debugging</title>
+<style>
+</style>
+
+<script>
+function onLoad() {
+ var tabs_list_request = new XMLHttpRequest();
+ tabs_list_request.open("GET", "/json/list?t=" + new Date().getTime(), true);
+ tabs_list_request.onreadystatechange = onReady;
+ tabs_list_request.send();
+}
+
+function onReady() {
+ if(this.readyState == 4 && this.status == 200) {
+ if(this.response != null)
+ var responseJSON = JSON.parse(this.response);
+ for (var i = 0; i < responseJSON.length; ++i)
+ appendItem(responseJSON[i]);
+ }
+}
+
+function appendItem(item_object) {
+ var frontend_ref;
+ if (item_object.devtoolsFrontendUrl) {
+ frontend_ref = document.createElement("a");
+ frontend_ref.href = item_object.devtoolsFrontendUrl;
+ frontend_ref.title = item_object.title;
+ } else {
+ frontend_ref = document.createElement("div");
+ frontend_ref.title = "The tab already has active debugging session";
+ }
+
+ var text = document.createElement("div");
+ if (item_object.title)
+ text.innerText = item_object.title;
+ else
+ text.innerText = "(untitled tab)";
+ text.style.cssText = "background-image:url(" + item_object.faviconUrl + ")";
+ frontend_ref.appendChild(text);
+
+ var item = document.createElement("p");
+ item.appendChild(frontend_ref);
+
+ document.getElementById("items").appendChild(item);
+}
+</script>
+</head>
+<body onload='onLoad()'>
+ <div id='caption'>Inspectable WebContents</div>
+ <div id='items'></div>
+</body>
+</html>
--- /dev/null
+// Copyright 2025 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "window_parenting_client_efl.h"
+
+#include "ui/aura/window.h"
+
+namespace aura {
+
+WindowParentingClientEfl::WindowParentingClientEfl(Window* root_window)
+ : root_window_(root_window) {
+ client::SetWindowParentingClient(root_window_, this);
+}
+
+WindowParentingClientEfl::~WindowParentingClientEfl() {
+ client::SetWindowParentingClient(root_window_, nullptr);
+}
+
+Window* WindowParentingClientEfl::GetDefaultParent(Window* window,
+ const gfx::Rect& bounds,
+ const int64_t display_id) {
+ return root_window_.get();
+}
+
+} // namespace aura
--- /dev/null
+// Copyright 2025 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WINDOW_PARENTING_CLIENT_EFL_H_
+#define WINDOW_PARENTING_CLIENT_EFL_H_
+
+#include "base/memory/raw_ptr.h"
+#include "ui/aura/client/window_parenting_client.h"
+
+namespace aura {
+
+class WindowParentingClientEfl : public client::WindowParentingClient {
+ public:
+ explicit WindowParentingClientEfl(Window* root_window);
+
+ WindowParentingClientEfl(const WindowParentingClientEfl&) = delete;
+ WindowParentingClientEfl& operator=(const WindowParentingClientEfl&) =
+ delete;
+
+ ~WindowParentingClientEfl() override;
+
+ // Overridden from client::WindowParentingClient:
+ Window* GetDefaultParent(Window* window,
+ const gfx::Rect& bounds,
+ const int64_t display_id) override;
+
+ private:
+ raw_ptr<Window> root_window_;
+};
+
+} // namespace aura
+
+#endif // WINDOW_PARENTING_CLIENT_EFL_H_
}
executable("efl_webview_app") {
- testonly = true
deps = [ ":efl_webview_app_script" ]
if (is_tizen) {
configs += [ "//tizen_src/build/config/tizen:executable_config" ]
}
executable("mini_browser") {
- testonly = true
cflags = [
# Treat warning as error for this target.
# It needs to be included by means of pattern list because '-Werror' cflag
}
executable("ubrowser") {
- testonly = true
configs += [ "//tizen_src/build:capi-system-device" ]
configs += [ "//tizen_src/build:libcapi-system-device" ]
public_configs = [ "//tizen_src/build:capi-system-device-public" ]
# Thinking about appending to the end?
# Please read the header and find the right section above instead.
+ "tizen_src/ewk/efl_integration/efl_resources.grd": {
+ "includes": [31100],
+ },
# for ENABLE_WRT_JS
"wrt/wrt_resources.grd": {