From bfa4f35668cd2240120a1a192125f7e8c883552f Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Wed, 2 Aug 2017 14:07:53 +0000 Subject: [PATCH 01/16] Support EFL libraries via jhbuild The ecore, elocation, and elementary are added to be linked in build. Change-Id: Ie021c85e209108bbb51e89baba0fa1dd61a55511 Signed-off-by: Youngsoo Choi --- efl/build/build_desktop.sh | 40 ++++ efl/build/common.sh | 13 ++ efl/build/jhbuild/jhbuild.modules | 222 +++++++++++++++++++++ efl/build/jhbuild/jhbuildrc | 54 +++++ efl/build/system.gyp | 92 +++++++++ electron.gyp | 9 +- vendor/brightray/brightray.gyp | 2 +- .../tools/generate_filenames_gypi.py | 2 +- 8 files changed, 430 insertions(+), 4 deletions(-) create mode 100755 efl/build/jhbuild/jhbuild.modules create mode 100644 efl/build/jhbuild/jhbuildrc create mode 100644 efl/build/system.gyp diff --git a/efl/build/build_desktop.sh b/efl/build/build_desktop.sh index 63f629f..1cb62a3 100755 --- a/efl/build/build_desktop.sh +++ b/efl/build/build_desktop.sh @@ -5,6 +5,8 @@ export SCRIPTDIR=$(readlink -e $(dirname $0)) source ${SCRIPTDIR}/common.sh trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT +host_arch=$(getHostArch) + # "|| :" means "or always succeeding built-in command" CHROMIUM_EFL_PATH=$(echo "$@" | grep -Po "(?<=\--libcc_chromium_efl_path\s)[^\s]*" || :) @@ -15,6 +17,42 @@ if [ "$CHROMIUM_EFL_PATH" == "" ]; then exit 1 fi +# jhbuild + +JHBUILD_STAMPFILE="${TOPDIR}/out/Dependencies/Root/jhbuild.stamp" + +forceJHBuildIfNeeded() { + if [[ $FORCE_JHBUILD == 1 ]]; then + rm -f $JHBUILD_STAMPFILE + return + fi + + # Check if anything in jhbuild is more recent than stamp file. + if [ $(find $SCRIPTDIR/jhbuild -type f -newer $JHBUILD_STAMPFILE -print | wc -l) != "0" ]; then + rm -f $JHBUILD_STAMPFILE + fi +} + +forceJHBuildIfNeeded + +JHBUILD_DEPS="${TOPDIR}/out/Dependencies/Root" +if [ "${host_arch}" == "x64" ]; then + _LIBDIR=lib64 +elif [ "${host_arch}" == "x86" ]; then + _LIBDIR=lib +fi +export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig" + +jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc + +if [ ! -f "$JHBUILD_STAMPFILE" ]; then + if [[ $? == 0 ]]; then + echo "Yay! jhbuild done!" > $JHBUILD_STAMPFILE + fi +fi + +# bootstrap + ${TOPDIR}/script/bootstrap.py \ --define "use_efl=1 libchromiumcontent_component=1" \ --dev \ @@ -22,4 +60,6 @@ ${TOPDIR}/script/bootstrap.py \ -v \ $@ +# build + ${TOPDIR}/script/build.py -c D diff --git a/efl/build/common.sh b/efl/build/common.sh index a46b567..25583ce 100644 --- a/efl/build/common.sh +++ b/efl/build/common.sh @@ -7,3 +7,16 @@ function error_report() { echo "Error: File:$1 Line:$2" exit 1 } + +function getHostOs() { + echo $(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') +} + +function getHostArch() { + echo $(uname -m | sed -e \ + 's/i.86/x86/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/x86/;s/aarch64/arm64/') +} + +function getPythonVersion() { + echo $(python --version 2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/') +} diff --git a/efl/build/jhbuild/jhbuild.modules b/efl/build/jhbuild/jhbuild.modules new file mode 100755 index 0000000..d87eb36 --- /dev/null +++ b/efl/build/jhbuild/jhbuild.modules @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/efl/build/jhbuild/jhbuildrc b/efl/build/jhbuild/jhbuildrc new file mode 100644 index 0000000..122866e --- /dev/null +++ b/efl/build/jhbuild/jhbuildrc @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# Copyright (C) 2013 Samsung Electronics +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +import multiprocessing +import sys +import os + +__efl_build_directory = os.path.abspath(os.path.dirname(__file__)) +sys.path = [__efl_build_directory] + sys.path + +build_policy = 'updated' + +__moduleset_file_uri = 'file://' + os.path.join(__efl_build_directory, 'jhbuild.modules') +moduleset = [ __moduleset_file_uri, ] + +#__extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",") +modules = [ 'electron-efl-dependencies', ] + +#outdir = os.environ.get('GN_GENERATOR_OUTPUT', 'out') +outdir = os.path.join(__efl_build_directory, '../../../out') + +checkoutroot = os.path.abspath(os.path.join(outdir,'Dependencies', 'Source')) +prefix = os.path.abspath(os.path.join(outdir,'Dependencies', 'Root')) + +del outdir + +nonotify = True +notrayicon = True + +if 'NUMBER_OF_PROCESSORS' in os.environ: + jobs = os.environ['NUMBER_OF_PROCESSORS'] + +# Use system libraries while building. +if use_lib64: + _libdir = 'lib64' +else: + _libdir = 'lib' + +partial_build = False + diff --git a/efl/build/system.gyp b/efl/build/system.gyp new file mode 100644 index 0000000..e1894c0 --- /dev/null +++ b/efl/build/system.gyp @@ -0,0 +1,92 @@ +# Copyright (c) 2015 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. + +{ + 'variables': { + 'pkg-config': 'pkg-config', + }, + 'targets': [ + { + 'target_name': 'ecore-x', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + ' Date: Wed, 2 Aug 2017 15:15:54 +0000 Subject: [PATCH 02/16] Support icu library via jhbuild Change-Id: I1c8a34dc21e234a9123a25c94d165738d3d7c62e Signed-off-by: Youngsoo Choi --- efl/build/build_desktop.sh | 1 + efl/build/jhbuild/handle_exceptional_libs.sh | 30 ++++++++++++++++++++++++++++ efl/build/jhbuild/jhbuild.modules | 11 ++++++++++ electron.gyp | 1 + 4 files changed, 43 insertions(+) create mode 100755 efl/build/jhbuild/handle_exceptional_libs.sh diff --git a/efl/build/build_desktop.sh b/efl/build/build_desktop.sh index 1cb62a3..5d56889 100755 --- a/efl/build/build_desktop.sh +++ b/efl/build/build_desktop.sh @@ -43,6 +43,7 @@ elif [ "${host_arch}" == "x86" ]; then fi export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig" +$SCRIPTDIR/jhbuild/handle_exceptional_libs.sh jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc if [ ! -f "$JHBUILD_STAMPFILE" ]; then diff --git a/efl/build/jhbuild/handle_exceptional_libs.sh b/efl/build/jhbuild/handle_exceptional_libs.sh new file mode 100755 index 0000000..a63fb0f --- /dev/null +++ b/efl/build/jhbuild/handle_exceptional_libs.sh @@ -0,0 +1,30 @@ +export SCRIPTDIR=$(readlink -e $(dirname $0)) + +source ${SCRIPTDIR}/common.sh + +echo "** Checkinng exceptional libraries that have different directory name with file name" +echo + +SOURCE_DIR=$TOPDIR/out/Dependencies/Source + +if [ ! -e $SOURCE_DIR ]; then + mkdir -p $SOURCE_DIR +fi +pushd $SOURCE_DIR > /dev/null + +echo "** Checkinng for icu 58.1" +LIB=icu4c-58_1-src +if [ ! -e $LIB ]; then + MD5SUM=1901302aaff1c1633ef81862663d2917 + wget https://jaist.dl.sourceforge.net/project/icu/ICU4C/58.1/$LIB.tgz + if [ "$(md5sum $LIB.tgz | sed -e "s/ .*//g")" == "$MD5SUM" ]; then + tar -zxvf $LIB.tgz > /dev/null + mv icu/source $LIB > /dev/null + cp -f icu/LICENSE ./ > /dev/null + else + echo "Error: Invalid md5sum !!" + exit 1 + fi +fi + +popd > /dev/null diff --git a/efl/build/jhbuild/jhbuild.modules b/efl/build/jhbuild/jhbuild.modules index d87eb36..a00df1b 100755 --- a/efl/build/jhbuild/jhbuild.modules +++ b/efl/build/jhbuild/jhbuild.modules @@ -8,6 +8,7 @@ + @@ -23,6 +24,8 @@ href="ftp://sourceware.org"/> + @@ -204,6 +207,14 @@ + + + + + + Date: Wed, 2 Aug 2017 06:10:57 +0000 Subject: [PATCH 03/16] Remove x11, aura, gtk and views dependency To enable EFL port, the other ports are disabled. Change-Id: I067bd5ab00d8781cb3b2e33483232a1660a8be54 Signed-off-by: Youngsoo Choi --- vendor/brightray/filename_rules.gypi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/vendor/brightray/filename_rules.gypi b/vendor/brightray/filename_rules.gypi index e1ee46d..f24b961 100644 --- a/vendor/brightray/filename_rules.gypi +++ b/vendor/brightray/filename_rules.gypi @@ -73,5 +73,21 @@ ['exclude', '(^|/)views/'], ], }], + ['use_efl==1', { + 'sources/': [ + ['exclude', '_x11(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'], + ['exclude', '(^|/)x11/'], + ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)aura/'], + ['exclude', '_views\\.(h|cc)$'], + ['exclude', '(^|/)views/'], + ['exclude', '_gtk(_browsertest|_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)gtk/'], + ['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'], + ['exclude', '(^|/)libgtk2ui/'], + ['exclude', '(^|/)x/'], + ], + }], ] } -- 2.7.4 From dc3365b42f11e6e6cb4bb1de2ce055b2dfa36834 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sat, 5 Aug 2017 07:42:21 +0000 Subject: [PATCH 04/16] Add flags for desktop linux This adds cflags for desktop linux * Usage in C/C++ #if defined(USE_EFL) // implementation here #endif * Usage in gyp if (desktop_linux) { // implementation here } Change-Id: I73fb49441fb6581bc87b0a5fba05b1ea6de8a46e Signed-off-by: Youngsoo Choi --- common.gypi | 1 + efl/build/build_desktop.sh | 7 +------ efl/build/common.sh | 16 ++++++++++++++++ script/update.py | 1 + vendor/brightray/brightray.gypi | 7 ++++++- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/common.gypi b/common.gypi index 3c8aaf0..ac3f21c 100644 --- a/common.gypi +++ b/common.gypi @@ -23,6 +23,7 @@ 'openssl_fips': '', 'openssl_no_asm': 1, 'use_efl%': 0, + 'desktop_linux%': 0, 'use_openssl_def': 0, 'OPENSSL_PRODUCT': 'libopenssl.a', 'node_release_urlbase': 'https://atom.io/download/atom-shell', diff --git a/efl/build/build_desktop.sh b/efl/build/build_desktop.sh index 5d56889..0888006 100755 --- a/efl/build/build_desktop.sh +++ b/efl/build/build_desktop.sh @@ -54,12 +54,7 @@ fi # bootstrap -${TOPDIR}/script/bootstrap.py \ - --define "use_efl=1 libchromiumcontent_component=1" \ - --dev \ - --disable_clang \ - -v \ - $@ +hostGypElectronEfl $@ # build diff --git a/efl/build/common.sh b/efl/build/common.sh index 25583ce..cf60c90 100644 --- a/efl/build/common.sh +++ b/efl/build/common.sh @@ -20,3 +20,19 @@ function getHostArch() { function getPythonVersion() { echo $(python --version 2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/') } + +function hostGypElectronEfl() { + if [[ $SKIP_GYP != 1 ]]; then + local DEFINE_ARGS=" + desktop_linux=1 + libchromiumcontent_component=1 + use_efl=1 + " + ${TOPDIR}/script/bootstrap.py \ + --define "${DEFINE_ARGS}" \ + --dev \ + --disable_clang \ + -v \ + $@ + fi +} diff --git a/script/update.py b/script/update.py index f53dc4f..2a0df3b 100755 --- a/script/update.py +++ b/script/update.py @@ -95,6 +95,7 @@ def run_gyp(target_arch, component): if args.msvs: generator = 'msvs-ninja' + print "GYP defines ::: ", defines return subprocess.call([python, gyp, '-f', generator, '--depth', '.', 'electron.gyp', '-Icommon.gypi'] + defines, env=env) diff --git a/vendor/brightray/brightray.gypi b/vendor/brightray/brightray.gypi index 49037bf..f039d85 100644 --- a/vendor/brightray/brightray.gypi +++ b/vendor/brightray/brightray.gypi @@ -110,7 +110,7 @@ 'DISABLE_NACL', ], 'conditions': [ - ['OS!="mac"', { + ['OS!="mac" and use_efl!=1', { 'defines': [ 'TOOLKIT_VIEWS', 'USE_AURA', @@ -122,6 +122,11 @@ ], }, { 'conditions': [ + ['desktop_linux==1', { + 'defines': [ + 'DESKTOP_LINUX', + ], + }], ['use_efl==1', { 'defines': [ 'USE_EFL', -- 2.7.4 From 1b8662b4501ae9eb8ac38cb59430164d553577ba Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sat, 5 Aug 2017 07:43:33 +0000 Subject: [PATCH 05/16] Disable desktop_capturer on desktop linux The chromium-efl supports only tizen webrtc using CAPI. So, this disables desktop_capturer using webrtc on desktop linux. Change-Id: Ia6b8481b1347b695ebd07babbbb733cab58bd57c Signed-off-by: Youngsoo Choi --- atom/common/node_bindings.cc | 2 ++ electron.gyp | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index ae757b1..fa9e643 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -36,7 +36,9 @@ REFERENCE_MODULE(atom_browser_auto_updater); REFERENCE_MODULE(atom_browser_browser_view); REFERENCE_MODULE(atom_browser_content_tracing); REFERENCE_MODULE(atom_browser_debugger); +#if !defined(DESKTOP_LINUX) REFERENCE_MODULE(atom_browser_desktop_capturer); +#endif REFERENCE_MODULE(atom_browser_dialog); REFERENCE_MODULE(atom_browser_download_item); REFERENCE_MODULE(atom_browser_global_shortcut); diff --git a/electron.gyp b/electron.gyp index 2f8d7b0..5861329 100644 --- a/electron.gyp +++ b/electron.gyp @@ -373,6 +373,14 @@ ], }, }], # use_efl==1 + ['desktop_linux==1', { + 'sources/': [ + # chromium-efl supports only tizen webrtc using CAPI + # which is not working on desktop linux. + ['exclude', 'atom/browser/api/atom_api_desktop_capturer.cc'], + ['exclude', 'atom/browser/api/atom_api_desktop_capturer.h'], + ], + }], # desktop_linux==1 ], }, # target <(product_name)_lib { -- 2.7.4 From cb0142f7cce78f7aaf4735b5043d7517c2bdfae4 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sat, 5 Aug 2017 10:08:16 +0000 Subject: [PATCH 06/16] [Bringup] Add mockup APIs to bring up EFL port Following files are added to bring up EFL port. atom/browser/api/atom_api_menu_efl.cc atom/browser/api/atom_api_menu_efl.h atom/browser/api/atom_api_web_contents_efl.cc atom/browser/common_web_contents_delegate_efl.cc atom/browser/native_browser_view_efl.cc atom/browser/native_browser_view_efl.h atom/browser/native_window_efl.cc atom/browser/native_window_efl.h atom/browser/ui/accelerator_util_efl.cc atom/browser/ui/drag_util_efl.cc atom/browser/ui/file_dialog_efl.cc atom/browser/ui/message_box_efl.cc atom/browser/ui/tray_icon_efl.cc atom/browser/ui/tray_icon_efl.h chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.cc chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.h chromium_src/chrome/browser/icon_loader_efllinux.cc Change-Id: I170f4b01c6a140159cb1e370880ad466744198b6 Signed-off-by: Youngsoo Choi --- atom/browser/api/atom_api_menu_efl.cc | 33 +++ atom/browser/api/atom_api_menu_efl.h | 32 +++ atom/browser/api/atom_api_web_contents.cc | 6 +- atom/browser/api/atom_api_web_contents_efl.cc | 18 ++ atom/browser/common_web_contents_delegate_efl.cc | 24 ++ atom/browser/native_browser_view_efl.cc | 34 +++ atom/browser/native_browser_view_efl.h | 33 +++ atom/browser/native_window_efl.cc | 275 +++++++++++++++++++++ atom/browser/native_window_efl.h | 94 +++++++ atom/browser/ui/accelerator_util_efl.cc | 15 ++ atom/browser/ui/drag_util_efl.cc | 25 ++ atom/browser/ui/file_dialog_efl.cc | 33 +++ atom/browser/ui/message_box_efl.cc | 45 ++++ atom/browser/ui/tray_icon_efl.cc | 32 +++ atom/browser/ui/tray_icon_efl.h | 37 +++ .../extensions/global_shortcut_listener_ozone.cc | 64 +++++ .../extensions/global_shortcut_listener_ozone.h | 36 +++ .../chrome/browser/icon_loader_efllinux.cc | 26 ++ electron.gyp | 4 + filenames.gypi | 16 ++ 20 files changed, 881 insertions(+), 1 deletion(-) create mode 100755 atom/browser/api/atom_api_menu_efl.cc create mode 100755 atom/browser/api/atom_api_menu_efl.h create mode 100644 atom/browser/api/atom_api_web_contents_efl.cc create mode 100644 atom/browser/common_web_contents_delegate_efl.cc create mode 100644 atom/browser/native_browser_view_efl.cc create mode 100644 atom/browser/native_browser_view_efl.h create mode 100755 atom/browser/native_window_efl.cc create mode 100755 atom/browser/native_window_efl.h create mode 100644 atom/browser/ui/accelerator_util_efl.cc create mode 100644 atom/browser/ui/drag_util_efl.cc create mode 100755 atom/browser/ui/file_dialog_efl.cc create mode 100755 atom/browser/ui/message_box_efl.cc create mode 100755 atom/browser/ui/tray_icon_efl.cc create mode 100755 atom/browser/ui/tray_icon_efl.h create mode 100644 chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.cc create mode 100644 chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.h create mode 100644 chromium_src/chrome/browser/icon_loader_efllinux.cc diff --git a/atom/browser/api/atom_api_menu_efl.cc b/atom/browser/api/atom_api_menu_efl.cc new file mode 100755 index 0000000..dce7934 --- /dev/null +++ b/atom/browser/api/atom_api_menu_efl.cc @@ -0,0 +1,33 @@ +// Copyright 2015 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 "atom/browser/api/atom_api_menu_efl.h" + +#include "base/logging.h" + +namespace atom { + +namespace api { + +MenuEfl::MenuEfl(v8::Isolate* isolate, v8::Local wrapper) + : Menu(isolate, wrapper), + weak_factory_(this) { +} + +void MenuEfl::PopupAt(Window* window, int x, int y, int positioning_item, bool async) { + NOTIMPLEMENTED(); +} + +void MenuEfl::ClosePopupAt(int32_t window_id) { + NOTIMPLEMENTED(); +} + +// static +mate::WrappableBase* Menu::New(mate::Arguments* args) { + return new MenuEfl(args->isolate(), args->GetThis()); +} + +} // namespace api + +} // namespace atom diff --git a/atom/browser/api/atom_api_menu_efl.h b/atom/browser/api/atom_api_menu_efl.h new file mode 100755 index 0000000..36eeb66 --- /dev/null +++ b/atom/browser/api/atom_api_menu_efl.h @@ -0,0 +1,32 @@ +// Copyright 2015 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 ATOM_BROWSER_API_ATOM_API_MENU_EFL_H_ +#define ATOM_BROWSER_API_ATOM_API_MENU_EFL_H_ + +#include "atom/browser/api/atom_api_menu.h" + +namespace atom { + +namespace api { + +class MenuEfl : public Menu { + public: + MenuEfl(v8::Isolate* isolate, v8::Local wrapper); + + protected: + void PopupAt(Window* window, int x, int y, int positioning_item, bool async) override; + void ClosePopupAt(int32_t window_id) override; + + private: + base::WeakPtrFactory weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(MenuEfl); +}; + +} // namespace api + +} // namespace atom + +#endif // ATOM_BROWSER_API_ATOM_API_MENU_EFL_H_ diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index d3e7bae..fc3a559 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -77,7 +77,7 @@ #include "third_party/WebKit/public/web/WebFindOptions.h" #include "ui/display/screen.h" -#if !defined(OS_MACOSX) +#if !defined(OS_MACOSX) && !defined(USE_EFL) #include "ui/aura/window.h" #endif @@ -1359,11 +1359,15 @@ bool WebContents::IsFocused() const { auto view = web_contents()->GetRenderWidgetHostView(); if (!view) return false; +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else if (GetType() != BACKGROUND_PAGE) { auto window = web_contents()->GetNativeView()->GetToplevelWindow(); if (window && !window->IsVisible()) return false; } +#endif return view->HasFocus(); } diff --git a/atom/browser/api/atom_api_web_contents_efl.cc b/atom/browser/api/atom_api_web_contents_efl.cc new file mode 100644 index 0000000..c029437 --- /dev/null +++ b/atom/browser/api/atom_api_web_contents_efl.cc @@ -0,0 +1,18 @@ +// Copyright (c) 2016 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/browser/api/atom_api_web_contents.h" + +namespace atom { + +namespace api { + +bool WebContents::IsFocused() const { + NOTIMPLEMENTED(); + return false; +} + +} // namespace api + +} // namespace atom diff --git a/atom/browser/common_web_contents_delegate_efl.cc b/atom/browser/common_web_contents_delegate_efl.cc new file mode 100644 index 0000000..6b147cf --- /dev/null +++ b/atom/browser/common_web_contents_delegate_efl.cc @@ -0,0 +1,24 @@ +// Copyright (c) 2016 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/browser/common_web_contents_delegate.h" + +#include "atom/browser/native_window_efl.h" +#include "base/strings/string_util.h" +#include "content/public/browser/native_web_keyboard_event.h" +#include "ui/events/keycodes/keyboard_codes.h" + +#if defined(USE_X11) +#include "atom/browser/browser.h" +#endif + +namespace atom { + +void CommonWebContentsDelegate::HandleKeyboardEvent( + content::WebContents* source, + const content::NativeWebKeyboardEvent& event) { + NOTIMPLEMENTED(); +} + +} // namespace atom diff --git a/atom/browser/native_browser_view_efl.cc b/atom/browser/native_browser_view_efl.cc new file mode 100644 index 0000000..d114bcd --- /dev/null +++ b/atom/browser/native_browser_view_efl.cc @@ -0,0 +1,34 @@ +// Copyright (c) 2017 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/browser/native_browser_view_efl.h" + +#include "brightray/browser/inspectable_web_contents_view.h" +#include "ui/gfx/geometry/rect.h" + +namespace atom { + +NativeBrowserViewEfl::NativeBrowserViewEfl( + brightray::InspectableWebContentsView* web_contents_view) + : NativeBrowserView(web_contents_view) { +} + +NativeBrowserViewEfl::~NativeBrowserViewEfl() { +} + +void NativeBrowserViewEfl::SetBounds(const gfx::Rect& bounds) { + NOTIMPLEMENTED(); +} + +void NativeBrowserViewEfl::SetBackgroundColor(SkColor color) { + NOTIMPLEMENTED(); +} + +// static +NativeBrowserView* NativeBrowserView::Create( + brightray::InspectableWebContentsView* web_contents_view) { + return new NativeBrowserViewEfl(web_contents_view); +} + +} // namespace atom diff --git a/atom/browser/native_browser_view_efl.h b/atom/browser/native_browser_view_efl.h new file mode 100644 index 0000000..42e2d94 --- /dev/null +++ b/atom/browser/native_browser_view_efl.h @@ -0,0 +1,33 @@ +// Copyright (c) 2017 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ATOM_BROWSER_NATIVE_BROWSER_VIEW_EFL_H_ +#define ATOM_BROWSER_NATIVE_BROWSER_VIEW_EFL_H_ + +#include "atom/browser/native_browser_view.h" + +namespace atom { + +class NativeBrowserViewEfl : public NativeBrowserView { + public: + explicit NativeBrowserViewEfl( + brightray::InspectableWebContentsView* web_contents_view); + ~NativeBrowserViewEfl() override; + + uint8_t GetAutoResizeFlags() { return auto_resize_flags_; } + void SetAutoResizeFlags(uint8_t flags) override { + auto_resize_flags_ = flags; + } + void SetBounds(const gfx::Rect& bounds) override; + void SetBackgroundColor(SkColor color) override; + + private: + uint8_t auto_resize_flags_; + + DISALLOW_COPY_AND_ASSIGN(NativeBrowserViewEfl); +}; + +} // namespace atom + +#endif // ATOM_BROWSER_NATIVE_BROWSER_VIEW_EFL_H_ diff --git a/atom/browser/native_window_efl.cc b/atom/browser/native_window_efl.cc new file mode 100755 index 0000000..d92c00b --- /dev/null +++ b/atom/browser/native_window_efl.cc @@ -0,0 +1,275 @@ +// Copyright 2015 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 "atom/browser/native_window_efl.h" + +#include "base/logging.h" + +namespace atom { + +NativeWindowEfl::NativeWindowEfl( + brightray::InspectableWebContents* web_contents, + const mate::Dictionary& options, + NativeWindow* parent) + : NativeWindow(web_contents, options, parent) { +} + +NativeWindowEfl::~NativeWindowEfl() { +} + +void NativeWindowEfl::Close() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::CloseImmediately() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::Focus(bool focus) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsFocused() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::Show() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::ShowInactive() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::Hide() { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsVisible() { + NOTIMPLEMENTED(); + return true; +} + +bool NativeWindowEfl::IsEnabled() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::Maximize() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::Unmaximize() { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsMaximized() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::Minimize() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::Restore() { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsMinimized() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetFullScreen(bool fullscreen) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsFullscreen() const { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetBounds(const gfx::Rect& bounds, bool animate) { + NOTIMPLEMENTED(); +} + +gfx::Rect NativeWindowEfl::GetBounds() { + NOTIMPLEMENTED(); + return gfx::Rect(); +} + +void NativeWindowEfl::SetResizable(bool resizable) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsResizable() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetMovable(bool movable) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsMovable() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetMinimizable(bool minimizable) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsMinimizable() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetMaximizable(bool maximizable) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsMaximizable() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetFullScreenable(bool fullscreenable) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsFullScreenable() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetClosable(bool closable) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsClosable() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetAlwaysOnTop(bool top, + const std::string& level, + int relativeLevel, + std::string* error) { + NOTIMPLEMENTED(); +} +bool NativeWindowEfl::IsAlwaysOnTop() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::Center() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::Invalidate() { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::SetTitle(const std::string& title) { + NOTIMPLEMENTED(); +} + +std::string NativeWindowEfl::GetTitle() { + NOTIMPLEMENTED(); +} +void NativeWindowEfl::FlashFrame(bool flash) { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::SetSkipTaskbar(bool skip) { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::SetKiosk(bool kiosk) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsKiosk() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetBackgroundColor(const std::string& color_name) { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::SetHasShadow(bool has_shadow) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::HasShadow() { + NOTIMPLEMENTED(); + return true; +} + +void NativeWindowEfl::SetIgnoreMouseEvents(bool ignore) { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::SetContentProtection(bool enable) { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::SetBrowserView(NativeBrowserView* browser_view) { + NOTIMPLEMENTED(); +} + +gfx::NativeWindow NativeWindowEfl::GetNativeWindow() { + NOTIMPLEMENTED(); + return gfx::NativeWindow(); +} + +gfx::AcceleratedWidget NativeWindowEfl::GetAcceleratedWidget() { + NOTIMPLEMENTED(); + return gfx::AcceleratedWidget(); +} + +void NativeWindowEfl::SetProgressBar(double progress, + const ProgressState state) { + NOTIMPLEMENTED(); +} + +void NativeWindowEfl::SetOverlayIcon(const gfx::Image& overlay, + const std::string& description) { + NOTIMPLEMENTED(); +} + +// Workspace APIs. +void NativeWindowEfl::SetVisibleOnAllWorkspaces(bool visible) { + NOTIMPLEMENTED(); +} + +bool NativeWindowEfl::IsVisibleOnAllWorkspaces() { + NOTIMPLEMENTED(); + return true; +} + +// Converts between content bounds and window bounds. +gfx::Rect NativeWindowEfl::ContentBoundsToWindowBounds(const gfx::Rect& bounds) { + NOTIMPLEMENTED(); + return gfx::Rect(); +} + +gfx::Rect NativeWindowEfl::WindowBoundsToContentBounds(const gfx::Rect& bounds) { + NOTIMPLEMENTED(); + return gfx::Rect(); +} + +// static +NativeWindow* NativeWindow::Create( + brightray::InspectableWebContents* inspectable_web_contents, + const mate::Dictionary& options, + NativeWindow* parent) { + return new NativeWindowEfl(inspectable_web_contents, options, parent); +} + +} diff --git a/atom/browser/native_window_efl.h b/atom/browser/native_window_efl.h new file mode 100755 index 0000000..bd4eb26 --- /dev/null +++ b/atom/browser/native_window_efl.h @@ -0,0 +1,94 @@ +// Copyright 2015 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 ATOM_BROWSER_NATIVE_WINDOW_EFL_H_ +#define ATOM_BROWSER_NATIVE_WINDOW_EFL_H_ + +#include "atom/browser/native_window.h" + +#include +#include + +namespace atom { + +class NativeWindowEfl : public NativeWindow { + public: + NativeWindowEfl(brightray::InspectableWebContents* inspectable_web_contents, + const mate::Dictionary& options, + NativeWindow* parent); + virtual ~NativeWindowEfl() override; + + void Close() override; + void CloseImmediately() override; + void Focus(bool focus) override; + bool IsFocused() override; + void Show() override; + void ShowInactive() override; + void Hide() override; + bool IsVisible() override; + bool IsEnabled() override; + void Maximize() override; + void Unmaximize() override; + bool IsMaximized() override; + void Minimize() override; + void Restore() override; + bool IsMinimized() override; + void SetFullScreen(bool fullscreen) override; + bool IsFullscreen() const override; + void SetBounds(const gfx::Rect& bounds, bool animate = false) override; + gfx::Rect GetBounds() override; + void SetResizable(bool resizable) override; + bool IsResizable() override; + void SetMovable(bool movable) override; + bool IsMovable() override; + void SetMinimizable(bool minimizable) override; + bool IsMinimizable() override; + void SetMaximizable(bool maximizable) override; + bool IsMaximizable() override; + void SetFullScreenable(bool fullscreenable) override; + bool IsFullScreenable() override; + void SetClosable(bool closable) override; + bool IsClosable() override; + void SetAlwaysOnTop(bool top, + const std::string& level = "floating", + int relativeLevel = 0, + std::string* error = nullptr) override; + bool IsAlwaysOnTop() override; + void Center() override; + void Invalidate() override; + void SetTitle(const std::string& title) override; + std::string GetTitle() override; + void FlashFrame(bool flash) override; + void SetSkipTaskbar(bool skip) override; + void SetKiosk(bool kiosk) override; + bool IsKiosk() override; + void SetBackgroundColor(const std::string& color_name) override; + void SetHasShadow(bool has_shadow) override; + bool HasShadow() override; + void SetIgnoreMouseEvents(bool ignore) override; + void SetContentProtection(bool enable) override; + void SetBrowserView(NativeBrowserView* browser_view) override; + gfx::NativeWindow GetNativeWindow() override; + gfx::AcceleratedWidget GetAcceleratedWidget() override; + + void SetProgressBar(double progress, + const ProgressState state) override; + void SetOverlayIcon(const gfx::Image& overlay, + const std::string& description) override; + + // Workspace APIs. + void SetVisibleOnAllWorkspaces(bool visible) override; + bool IsVisibleOnAllWorkspaces() override; + + private: + // Converts between content bounds and window bounds. + virtual gfx::Rect ContentBoundsToWindowBounds(const gfx::Rect& bounds) override; + virtual gfx::Rect WindowBoundsToContentBounds(const gfx::Rect& bounds) override; + + DISALLOW_COPY_AND_ASSIGN(NativeWindowEfl); +}; + +} // namespace atom + +#endif // ATOM_BROWSER_NATIVE_WINDOW_EFL_H_ diff --git a/atom/browser/ui/accelerator_util_efl.cc b/atom/browser/ui/accelerator_util_efl.cc new file mode 100644 index 0000000..d7b7736 --- /dev/null +++ b/atom/browser/ui/accelerator_util_efl.cc @@ -0,0 +1,15 @@ +// Copyright (c) 2013 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/browser/ui/accelerator_util.h" + +#include "ui/base/accelerators/accelerator.h" + +namespace accelerator_util { + +void SetPlatformAccelerator(ui::Accelerator* accelerator) { + NOTIMPLEMENTED(); +} + +} // namespace accelerator_util diff --git a/atom/browser/ui/drag_util_efl.cc b/atom/browser/ui/drag_util_efl.cc new file mode 100644 index 0000000..416bb5b --- /dev/null +++ b/atom/browser/ui/drag_util_efl.cc @@ -0,0 +1,25 @@ +// Copyright (c) 2016 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/browser/ui/drag_util.h" + +#include "ui/aura/client/drag_drop_client.h" +#include "ui/aura/window.h" +#include "ui/base/dragdrop/drag_drop_types.h" +#include "ui/base/dragdrop/drag_utils.h" +#include "ui/base/dragdrop/file_info.h" +#include "ui/base/dragdrop/os_exchange_data.h" +#include "ui/display/screen.h" +#include "ui/gfx/geometry/point.h" +#include "ui/views/widget/widget.h" + +namespace atom { + +void DragFileItems(const std::vector& files, + const gfx::Image& icon, + gfx::NativeView view) { + NOTIMPLEMENTED(); +} + +} // namespace atom diff --git a/atom/browser/ui/file_dialog_efl.cc b/atom/browser/ui/file_dialog_efl.cc new file mode 100755 index 0000000..2364e3a --- /dev/null +++ b/atom/browser/ui/file_dialog_efl.cc @@ -0,0 +1,33 @@ +// Copyright 2015 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 "atom/browser/ui/file_dialog.h" + +#include "base/logging.h" + +namespace file_dialog { + +bool ShowOpenDialog(const DialogSettings& settings, + std::vector* paths) { + NOTIMPLEMENTED(); + return true; +} + +void ShowOpenDialog(const DialogSettings& settings, + const OpenDialogCallback& callback) { + NOTIMPLEMENTED(); +} + +bool ShowSaveDialog(const DialogSettings& settings, + base::FilePath* path) { + NOTIMPLEMENTED(); + return true; +} + +void ShowSaveDialog(const DialogSettings& settings, + const SaveDialogCallback& callback) { + NOTIMPLEMENTED(); +} + +} // namespace file_dialog diff --git a/atom/browser/ui/message_box_efl.cc b/atom/browser/ui/message_box_efl.cc new file mode 100755 index 0000000..56b8443 --- /dev/null +++ b/atom/browser/ui/message_box_efl.cc @@ -0,0 +1,45 @@ +// Copyright 2015 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 "atom/browser/ui/message_box.h" + +#include "base/logging.h" + +namespace atom { + +int ShowMessageBox(NativeWindow* parent_window, + MessageBoxType type, + const std::vector& buttons, + int default_id, + int cancel_id, + int options, + const std::string& title, + const std::string& message, + const std::string& detail, + const gfx::ImageSkia& icon) { + NOTIMPLEMENTED(); + return 0; +} + +void ShowMessageBox(NativeWindow* parent_window, + MessageBoxType type, + const std::vector& buttons, + int default_id, + int cancel_id, + int options, + const std::string& title, + const std::string& message, + const std::string& detail, + const std::string& checkbox_label, + bool checkbox_checked, + const gfx::ImageSkia& icon, + const MessageBoxCallback& callback) { + NOTIMPLEMENTED(); +} + +void ShowErrorBox(const base::string16& title, const base::string16& content) { + NOTIMPLEMENTED(); +} + +} // namespace atom diff --git a/atom/browser/ui/tray_icon_efl.cc b/atom/browser/ui/tray_icon_efl.cc new file mode 100755 index 0000000..388366f --- /dev/null +++ b/atom/browser/ui/tray_icon_efl.cc @@ -0,0 +1,32 @@ +// Copyright 2015 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 "atom/browser/ui/tray_icon_efl.h" + +namespace atom { + +TrayIconEfl::TrayIconEfl() { +} + +TrayIconEfl::~TrayIconEfl() { +} + +void TrayIconEfl::SetImage(const gfx::Image& image) { + NOTIMPLEMENTED(); +} + +void TrayIconEfl::SetToolTip(const std::string& tool_tip) { + NOTIMPLEMENTED(); +} + +void TrayIconEfl::SetContextMenu(AtomMenuModel* menu_model) { + NOTIMPLEMENTED(); +} + +// static +TrayIcon* TrayIcon::Create() { + return new TrayIconEfl; +} + +} // namespace atom diff --git a/atom/browser/ui/tray_icon_efl.h b/atom/browser/ui/tray_icon_efl.h new file mode 100755 index 0000000..8111182 --- /dev/null +++ b/atom/browser/ui/tray_icon_efl.h @@ -0,0 +1,37 @@ +// Copyright 2015 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 ATOM_BROWSER_UI_TRAY_ICON_EFL_H_ +#define ATOM_BROWSER_UI_TRAY_ICON_EFL_H_ + +#include + +#include "atom/browser/ui/tray_icon.h" + +namespace atom { + +class TrayIconEfl : public TrayIcon { + public: + TrayIconEfl(); + virtual ~TrayIconEfl(); + + // Sets the image associated with this status icon. + void SetImage(ImageType image) override; + + // Sets the hover text for this status icon. This is also used as the label + // for the menu item which is created as a replacement for the status icon + // click action on platforms that do not support custom click actions for the + // status icon (e.g. Ubuntu Unity). + void SetToolTip(const std::string& tool_tip) override; + + // Set the context menu for this icon. + void SetContextMenu(AtomMenuModel* menu_model) override; + + private: + DISALLOW_COPY_AND_ASSIGN(TrayIconEfl); +}; + +} // namespace atom + +#endif // ATOM_BROWSER_UI_TRAY_ICON_EFL_H_ diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.cc b/chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.cc new file mode 100644 index 0000000..414b1c5 --- /dev/null +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.cc @@ -0,0 +1,64 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/global_shortcut_listener_ozone.h" + +#include "content/public/browser/browser_thread.h" + +using content::BrowserThread; + +namespace extensions { + +// static +GlobalShortcutListener* GlobalShortcutListener::GetInstance() { + CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + static GlobalShortcutListenerOzone* instance = + new GlobalShortcutListenerOzone(); + return instance; +} + +GlobalShortcutListenerOzone::GlobalShortcutListenerOzone() + : is_listening_(false) { + CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + + // TODO(implementor): Remove this. + LOG(ERROR) << "GlobalShortcutListenerOzone object created"; +} + +GlobalShortcutListenerOzone::~GlobalShortcutListenerOzone() { + if (is_listening_) + StopListening(); +} + +void GlobalShortcutListenerOzone::StartListening() { + DCHECK(!is_listening_); // Don't start twice. + NOTIMPLEMENTED(); + is_listening_ = true; +} + +void GlobalShortcutListenerOzone::StopListening() { + DCHECK(is_listening_); // No point if we are not already listening. + NOTIMPLEMENTED(); + is_listening_ = false; +} + +bool GlobalShortcutListenerOzone::RegisterAcceleratorImpl( + const ui::Accelerator& accelerator) { + NOTIMPLEMENTED(); + // To implement: + // 1) Convert modifiers to platform specific modifiers. + // 2) Register for the hotkey. + // 3) If not successful, return false. + // 4) Else, return true. + + return false; +} + +void GlobalShortcutListenerOzone::UnregisterAcceleratorImpl( + const ui::Accelerator& accelerator) { + NOTIMPLEMENTED(); + // To implement: Unregister for the hotkey. +} + +} // namespace extensions diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.h b/chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.h new file mode 100644 index 0000000..fbd954a --- /dev/null +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.h @@ -0,0 +1,36 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_OZONE_H_ +#define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_OZONE_H_ + +#include "base/macros.h" +#include "chrome/browser/extensions/global_shortcut_listener.h" + +namespace extensions { + +// Ozone-specific implementation of the GlobalShortcutListener class that +// listens for global shortcuts. Handles basic keyboard intercepting and +// forwards its output to the base class for processing. +class GlobalShortcutListenerOzone : public GlobalShortcutListener { + public: + GlobalShortcutListenerOzone(); + ~GlobalShortcutListenerOzone() override; + + private: + // GlobalShortcutListener implementation. + void StartListening() override; + void StopListening() override; + bool RegisterAcceleratorImpl(const ui::Accelerator& accelerator) override; + void UnregisterAcceleratorImpl(const ui::Accelerator& accelerator) override; + + // Whether this object is listening for global shortcuts. + bool is_listening_; + + DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerOzone); +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_OZONE_H_ diff --git a/chromium_src/chrome/browser/icon_loader_efllinux.cc b/chromium_src/chrome/browser/icon_loader_efllinux.cc new file mode 100644 index 0000000..4057b90 --- /dev/null +++ b/chromium_src/chrome/browser/icon_loader_efllinux.cc @@ -0,0 +1,26 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/icon_loader.h" + +#include "base/bind.h" +#include "base/message_loop/message_loop.h" +#include "base/nix/mime_util_xdg.h" + +// static +IconLoader::IconGroup IconLoader::GroupForFilepath( + const base::FilePath& file_path) { + return base::nix::GetFileMimeType(file_path); +} + +// static +content::BrowserThread::ID IconLoader::ReadIconThreadID() { + // ReadIcon() calls into views::LinuxUI and GTK2 code, so it must be on the UI + // thread. + return content::BrowserThread::UI; +} + +void IconLoader::ReadIcon() { + NOTIMPLEMENTED(); +} diff --git a/electron.gyp b/electron.gyp index 5861329..2b34eaa 100644 --- a/electron.gyp +++ b/electron.gyp @@ -362,6 +362,10 @@ '<(DEPTH)/efl/build/system.gyp:elementary', '<(DEPTH)/efl/build/system.gyp:icu', ], + 'sources': [ + 'chromium_src/chrome/browser/icon_loader_efllinux.cc', + ], + }, { 'link_settings': { 'ldflags': [ # Make binary search for libraries under current directory, so we diff --git a/filenames.gypi b/filenames.gypi index 8408b27..fc6d857 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -121,6 +121,8 @@ 'atom/browser/api/atom_api_global_shortcut.h', 'atom/browser/api/atom_api_menu.cc', 'atom/browser/api/atom_api_menu.h', + 'atom/browser/api/atom_api_menu_efl.cc', + 'atom/browser/api/atom_api_menu_efl.h', 'atom/browser/api/atom_api_menu_mac.h', 'atom/browser/api/atom_api_menu_mac.mm', 'atom/browser/api/atom_api_menu_views.cc', @@ -149,6 +151,7 @@ 'atom/browser/api/atom_api_url_request.h', 'atom/browser/api/atom_api_web_contents.cc', 'atom/browser/api/atom_api_web_contents.h', + 'atom/browser/api/atom_api_web_contents_efl.cc', 'atom/browser/api/atom_api_web_contents_mac.mm', 'atom/browser/api/atom_api_web_request.cc', 'atom/browser/api/atom_api_web_request.h', @@ -202,6 +205,7 @@ 'atom/browser/browser_mac.mm', 'atom/browser/browser_win.cc', 'atom/browser/browser_observer.h', + 'atom/browser/common_web_contents_delegate_efl.cc', 'atom/browser/common_web_contents_delegate_mac.mm', 'atom/browser/common_web_contents_delegate_views.cc', 'atom/browser/common_web_contents_delegate.cc', @@ -222,12 +226,16 @@ 'atom/browser/mac/dict_util.mm', 'atom/browser/native_browser_view.cc', 'atom/browser/native_browser_view.h', + 'atom/browser/native_browser_view_efl.cc', + 'atom/browser/native_browser_view_efl.h', 'atom/browser/native_browser_view_mac.h', 'atom/browser/native_browser_view_mac.mm', 'atom/browser/native_browser_view_views.h', 'atom/browser/native_browser_view_views.cc', 'atom/browser/native_window.cc', 'atom/browser/native_window.h', + 'atom/browser/native_window_efl.cc', + 'atom/browser/native_window_efl.h', 'atom/browser/native_window_views_win.cc', 'atom/browser/native_window_views.cc', 'atom/browser/native_window_views.h', @@ -285,6 +293,7 @@ 'atom/browser/render_process_preferences.h', 'atom/browser/ui/accelerator_util.cc', 'atom/browser/ui/accelerator_util.h', + 'atom/browser/ui/accelerator_util_efl.cc', 'atom/browser/ui/accelerator_util_mac.mm', 'atom/browser/ui/accelerator_util_views.cc', 'atom/browser/ui/atom_menu_model.cc', @@ -297,19 +306,24 @@ 'atom/browser/ui/cocoa/atom_touch_bar.h', 'atom/browser/ui/cocoa/atom_touch_bar.mm', 'atom/browser/ui/cocoa/touch_bar_forward_declarations.h', + 'atom/browser/ui/drag_util_efl.cc', 'atom/browser/ui/drag_util_mac.mm', 'atom/browser/ui/drag_util_views.cc', 'atom/browser/ui/drag_util.h', 'atom/browser/ui/file_dialog.h', + 'atom/browser/ui/file_dialog_efl.cc', 'atom/browser/ui/file_dialog_gtk.cc', 'atom/browser/ui/file_dialog_mac.mm', 'atom/browser/ui/file_dialog_win.cc', 'atom/browser/ui/message_box.h', + 'atom/browser/ui/message_box_efl.cc', 'atom/browser/ui/message_box_gtk.cc', 'atom/browser/ui/message_box_mac.mm', 'atom/browser/ui/message_box_win.cc', 'atom/browser/ui/tray_icon.cc', 'atom/browser/ui/tray_icon.h', + 'atom/browser/ui/tray_icon_efl.cc', + 'atom/browser/ui/tray_icon_efl.h', 'atom/browser/ui/tray_icon_gtk.cc', 'atom/browser/ui/tray_icon_gtk.h', 'atom/browser/ui/tray_icon_cocoa.h', @@ -512,6 +526,8 @@ 'chromium_src/chrome/browser/chrome_notification_types.h', 'chromium_src/chrome/browser/extensions/global_shortcut_listener.cc', 'chromium_src/chrome/browser/extensions/global_shortcut_listener.h', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.cc', + 'chromium_src/chrome/browser/extensions/global_shortcut_listener_ozone.h', 'chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.mm', 'chromium_src/chrome/browser/extensions/global_shortcut_listener_mac.h', 'chromium_src/chrome/browser/extensions/global_shortcut_listener_x11.cc', -- 2.7.4 From ab1e5c52ecf8f2f58ed7fd1c4a96e9e09dbefb23 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Wed, 2 Aug 2017 06:14:29 +0000 Subject: [PATCH 07/16] [Bringup] Handle nonexistent function in chromium v56.0.2924.0 The SystemDragEnded's parameters are different between chromium v56.0.2924.0 and v56.0.2924.87. Following patches need to be migarated from opensource to chromium-efl. Until then, this guards the function. Drag-and-drop: Target drag messages to specific RenderWidgets. https://codereview.chromium.org/2505113002 Drag-and-drop: Target drag messages (the sequel). https://codereview.chromium.org/2509933002 Change-Id: I1d5aa24826936d30fc293c67380dda8cd1aacb08 Signed-off-by: Youngsoo Choi --- atom/browser/osr/osr_web_contents_view.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atom/browser/osr/osr_web_contents_view.cc b/atom/browser/osr/osr_web_contents_view.cc index 0d9c527..ccfcac8 100644 --- a/atom/browser/osr/osr_web_contents_view.cc +++ b/atom/browser/osr/osr_web_contents_view.cc @@ -143,8 +143,14 @@ void OffScreenWebContentsView::StartDragging( const gfx::Vector2d& image_offset, const content::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh) { + // FIXME: SystemDragEnded related patches need to be migrated + // from opensource to chromium-efl. +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else if (web_contents_) web_contents_->SystemDragEnded(source_rwh); +#endif } void OffScreenWebContentsView::UpdateDragCursor( -- 2.7.4 From 5a7aea4abea2e94425087728fdb0a08d11f5b2d1 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Wed, 2 Aug 2017 06:14:29 +0000 Subject: [PATCH 08/16] [Bringup] Handle non virtual functions in chromium v56.0.2924.0 There's no virtual functions for followings in chromium v56.0.2924.0 but in chromium v56.0.2924.87. The opensource patches, related to followings, need to be migrated to chromium-efl. bool CanBeEmbeddedInsideCrossProcessFrames(); content::RenderWidgetHost* GetOwnerRenderWidgetHost(); content::SiteInstance* GetOwnerSiteInstance(); void ScriptedPrint(bool user_initiated); v8::Local context); Change-Id: I7a6d56d0c0c7eb89a2cd6f29cb7db4415aa03696 Signed-off-by: Youngsoo Choi --- atom/browser/web_view_guest_delegate.h | 12 +++++++++--- atom/renderer/atom_renderer_client.h | 7 ++++++- .../chrome/renderer/printing/print_web_view_helper.h | 6 +++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/atom/browser/web_view_guest_delegate.h b/atom/browser/web_view_guest_delegate.h index 329b7ec..44549bf 100644 --- a/atom/browser/web_view_guest_delegate.h +++ b/atom/browser/web_view_guest_delegate.h @@ -61,9 +61,15 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate, int element_instance_id, bool is_full_page_plugin, const base::Closure& completion_callback) final; - bool CanBeEmbeddedInsideCrossProcessFrames() override; - content::RenderWidgetHost* GetOwnerRenderWidgetHost() override; - content::SiteInstance* GetOwnerSiteInstance() override; +#if defined(USE_EFL) + bool CanBeEmbeddedInsideCrossProcessFrames(); + content::RenderWidgetHost* GetOwnerRenderWidgetHost(); + content::SiteInstance* GetOwnerSiteInstance(); +#else + bool CanBeEmbeddedInsideCrossProcessFrames(); override; + content::RenderWidgetHost* GetOwnerRenderWidgetHost(); override; + content::SiteInstance* GetOwnerSiteInstance(); override; +#endif // WebContentsZoomController::Observer: void OnZoomLevelChanged(content::WebContents* web_contents, diff --git a/atom/renderer/atom_renderer_client.h b/atom/renderer/atom_renderer_client.h index 3feaff4..c9ffb29 100644 --- a/atom/renderer/atom_renderer_client.h +++ b/atom/renderer/atom_renderer_client.h @@ -56,8 +56,13 @@ class AtomRendererClient : public RendererClientBase { bool* send_referrer) override; void DidInitializeWorkerContextOnWorkerThread( v8::Local context) override; +#if defined(USE_EFL) void WillDestroyWorkerContextOnWorkerThread( - v8::Local context) override; + v8::Local context); +#else + void WillDestroyWorkerContextOnWorkerThread( + v8::Local context); override; +#endif // Whether the node integration has been initialized. bool node_integration_initialized_; diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.h b/chromium_src/chrome/renderer/printing/print_web_view_helper.h index 4929477..49ad0f5 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.h +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.h @@ -95,7 +95,11 @@ class PrintWebViewHelper // RenderFrameObserver implementation. bool OnMessageReceived(const IPC::Message& message) override; void OnDestruct() override; - void ScriptedPrint(bool user_initiated) override; +#if defined(USE_EFL) + void ScriptedPrint(bool user_initiated); +#else + void ScriptedPrint(bool user_initiated); override; +#endif // Message handlers --------------------------------------------------------- #if !defined(DISABLE_BASIC_PRINTING) -- 2.7.4 From d4eaa87b4ee122f8ff922355331b8d64024baed2 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sun, 6 Aug 2017 09:36:21 +0000 Subject: [PATCH 09/16] [Bringup] Fix ShowColorChooser related linking error EFL port needs to be implemented for ShowColorChooser. Change-Id: I53f68bd573527f1168d8e5c5d4593ccdd0964eaf Signed-off-by: Youngsoo Choi --- atom/browser/common_web_contents_delegate.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index a10f959..22bca61 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -238,7 +238,11 @@ content::ColorChooser* CommonWebContentsDelegate::OpenColorChooser( content::WebContents* web_contents, SkColor color, const std::vector& suggestions) { +#if !defined(USE_EFL) return chrome::ShowColorChooser(web_contents, color); +#else + return nullptr; +#endif } void CommonWebContentsDelegate::RunFileChooser( -- 2.7.4 From 365460c3cef9e37ac70a9e5def88a3cc563252b1 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sun, 6 Aug 2017 09:06:28 +0000 Subject: [PATCH 10/16] [Bringup] Fix inspectable_web_contents_view related linking error EFL port needs to be implemented for inspectable_web_contents_view. >> undefined reference to `brightray::CreateInspectableContentsView >> (brightray::InspectableWebContentsImpl*)' Change-Id: I95c10c2a60afb59bf3454b739214e0248a492831 Signed-off-by: Youngsoo Choi --- vendor/brightray/browser/inspectable_web_contents_impl.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vendor/brightray/browser/inspectable_web_contents_impl.cc b/vendor/brightray/browser/inspectable_web_contents_impl.cc index 4c52097..95e5024 100644 --- a/vendor/brightray/browser/inspectable_web_contents_impl.cc +++ b/vendor/brightray/browser/inspectable_web_contents_impl.cc @@ -236,7 +236,12 @@ InspectableWebContentsImpl::InspectableWebContentsImpl( } } + // FIXME: The aura is disabled in chromium-efl. +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else view_.reset(CreateInspectableContentsView(this)); +#endif } InspectableWebContentsImpl::~InspectableWebContentsImpl() { -- 2.7.4 From fb50a04d7967487a3ae5c1f77e0b3f373b52c800 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sun, 6 Aug 2017 08:08:54 +0000 Subject: [PATCH 11/16] [Bringup] Fix widevine_key_system_properties related linking error EFL port needs to be implemented for >> undefined reference to `cdm::WidevineKeySystemProperties:: >> WidevineKeySystemProperties(...)' Change-Id: I3c2aa089b4eab4305833cb897ad7851828a9698c Signed-off-by: Youngsoo Choi --- chromium_src/chrome/renderer/media/chrome_key_systems.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chromium_src/chrome/renderer/media/chrome_key_systems.cc b/chromium_src/chrome/renderer/media/chrome_key_systems.cc index 206ac40..7ab1c1c 100644 --- a/chromium_src/chrome/renderer/media/chrome_key_systems.cc +++ b/chromium_src/chrome/renderer/media/chrome_key_systems.cc @@ -14,7 +14,9 @@ #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/widevine_cdm_messages.h" +#if !defined(USE_EFL) #include "components/cdm/renderer/widevine_key_system_properties.h" +#endif #include "content/public/renderer/render_thread.h" #include "media/base/eme_constants.h" #include "media/base/key_system_properties.h" @@ -241,6 +243,8 @@ static void AddPepperBasedWidevine( #endif // defined(USE_PROPRIETARY_CODECS) } + // FIXME: undefined reference to cdm::WidevineKeySystemProperties::WidevineKeySystemProperties +#if !defined(USE_EFL) using Robustness = cdm::WidevineKeySystemProperties::Robustness; concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties( supported_codecs, @@ -262,6 +266,7 @@ static void AddPepperBasedWidevine( media::EmeFeatureSupport::REQUESTABLE, // Persistent state. media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier. #endif // defined(OS_CHROMEOS) +#endif // defined(USE_EFL) } #endif // defined(WIDEVINE_CDM_AVAILABLE) #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) -- 2.7.4 From 9d37883a959b73adcd0fdcf2a24edd27b44cab34 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sun, 6 Aug 2017 08:08:37 +0000 Subject: [PATCH 12/16] [Bringup] Fix net related linking error The net needs to be exported by chromium-efl. >> undefined reference to `net::CreateProxyServiceUsingV8ProxyResolver(...) Change-Id: Ic4ac0b535a8586d6695f9a107d3d76c3a7361a4a Signed-off-by: Youngsoo Choi --- vendor/brightray/browser/url_request_context_getter.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vendor/brightray/browser/url_request_context_getter.cc b/vendor/brightray/browser/url_request_context_getter.cc index a9e0a22..2da99e1 100644 --- a/vendor/brightray/browser/url_request_context_getter.cc +++ b/vendor/brightray/browser/url_request_context_getter.cc @@ -235,6 +235,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { storage_->set_proxy_service(net::ProxyService::CreateFixed( proxy_config)); } else { +#if !defined(USE_EFL) storage_->set_proxy_service( net::CreateProxyServiceUsingV8ProxyResolver( std::move(proxy_config_service_), @@ -243,6 +244,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { host_resolver.get(), nullptr, url_request_context_->network_delegate())); +#endif } std::vector schemes; -- 2.7.4 From 9b6c15f1821d7cb85e7828aa4434fc30e28be03d Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sun, 6 Aug 2017 05:50:50 +0000 Subject: [PATCH 13/16] [Bringup] Fix security_state related linking error EFL port needs to be implemented. >> undefined reference to `security_state::GetSecurityInfo(...) The chromium-efl does not support security_state. Change-Id: Ic9332d2ba4e298a5d2ffb21d22d4450c97ba02bf Signed-off-by: Youngsoo Choi --- atom/browser/common_web_contents_delegate.cc | 15 ++++++++++++--- .../chrome/browser/ssl/security_state_tab_helper.cc | 14 ++++++++++++++ .../chrome/browser/ssl/security_state_tab_helper.h | 8 ++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index 22bca61..252e8db 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -22,8 +22,11 @@ #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" +// FIXME: The chromium-efl does not support security_state. +#if !defined(USE_EFL) #include "components/security_state/content/content_utils.h" #include "components/security_state/core/security_state.h" +#endif #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/render_process_host.h" @@ -238,10 +241,11 @@ content::ColorChooser* CommonWebContentsDelegate::OpenColorChooser( content::WebContents* web_contents, SkColor color, const std::vector& suggestions) { -#if !defined(USE_EFL) - return chrome::ShowColorChooser(web_contents, color); -#else +#if defined(USE_EFL) + NOTIMPLEMENTED(); return nullptr; +#else + return chrome::ShowColorChooser(web_contents, color); #endif } @@ -290,10 +294,15 @@ blink::WebSecurityStyle CommonWebContentsDelegate::GetSecurityStyle( SecurityStateTabHelper* helper = SecurityStateTabHelper::FromWebContents(web_contents); DCHECK(helper); + // FIXME: The chromium-efl does not support security_state. +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else security_state::SecurityInfo security_info; helper->GetSecurityInfo(&security_info); return security_state::GetSecurityStyle(security_info, security_style_explanations); +#endif } void CommonWebContentsDelegate::DevToolsSaveToFile( diff --git a/chromium_src/chrome/browser/ssl/security_state_tab_helper.cc b/chromium_src/chrome/browser/ssl/security_state_tab_helper.cc index 81da280..5c29952 100644 --- a/chromium_src/chrome/browser/ssl/security_state_tab_helper.cc +++ b/chromium_src/chrome/browser/ssl/security_state_tab_helper.cc @@ -17,7 +17,10 @@ #include "chrome/browser/safe_browsing/ui_manager.h" #endif #include "components/prefs/pref_service.h" +// FIXME: The chromium-efl does not support security_state. +#if !defined(USE_EFL) #include "components/security_state/content/content_utils.h" +#endif #if 0 #include "components/ssl_config/ssl_config_prefs.h" #endif @@ -46,14 +49,21 @@ SecurityStateTabHelper::SecurityStateTabHelper( SecurityStateTabHelper::~SecurityStateTabHelper() {} +// FIXME: The chromium-efl does not support security_state. +#if !defined(USE_EFL) void SecurityStateTabHelper::GetSecurityInfo( security_state::SecurityInfo* result) const { security_state::GetSecurityInfo(GetVisibleSecurityState(), UsedPolicyInstalledCertificate(), base::Bind(&content::IsOriginSecure), result); } +#endif void SecurityStateTabHelper::VisibleSecurityStateChanged() { +// FIXME: The chromium-efl does not support security_state. +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else if (logged_http_warning_on_current_navigation_) return; @@ -102,6 +112,7 @@ void SecurityStateTabHelper::VisibleSecurityStateChanged() { "Security.HTTPBad.UserWarnedAboutSensitiveInput.Password", warning_is_user_visible); } +#endif } void SecurityStateTabHelper::DidStartNavigation( @@ -201,6 +212,8 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const { } #endif +// FIXME: The chromium-efl does not support security_state. +#if !defined(USE_EFL) std::unique_ptr SecurityStateTabHelper::GetVisibleSecurityState() const { auto state = security_state::GetVisibleSecurityState(web_contents()); @@ -213,3 +226,4 @@ SecurityStateTabHelper::GetVisibleSecurityState() const { return state; } +#endif diff --git a/chromium_src/chrome/browser/ssl/security_state_tab_helper.h b/chromium_src/chrome/browser/ssl/security_state_tab_helper.h index 13b2567..4da8da0 100644 --- a/chromium_src/chrome/browser/ssl/security_state_tab_helper.h +++ b/chromium_src/chrome/browser/ssl/security_state_tab_helper.h @@ -8,7 +8,9 @@ #include #include "base/macros.h" +#if !defined(USE_EFL) #include "components/security_state/core/security_state.h" +#endif #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" #include "third_party/WebKit/public/platform/WebSecurityStyle.h" @@ -26,9 +28,12 @@ class SecurityStateTabHelper public: ~SecurityStateTabHelper() override; + // FIXME: The chromium-efl does not support security_state. +#if !defined(USE_EFL) // See security_state::GetSecurityInfo. void GetSecurityInfo( security_state::SecurityInfo* result) const; +#endif // Called when the NavigationEntry's SSLStatus or other security // information changes. @@ -49,8 +54,11 @@ class SecurityStateTabHelper #if 0 security_state::MaliciousContentStatus GetMaliciousContentStatus() const; #endif + // FIXME: The chromium-efl does not support security_state. +#if !defined(USE_EFL) std::unique_ptr GetVisibleSecurityState() const; +#endif // True if a console message has been logged about an omnibox warning that // will be shown in future versions of Chrome for insecure HTTP pages. This -- 2.7.4 From fed74c093668c3ffd09d870ad28cdf0e2812e0e5 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sun, 6 Aug 2017 04:27:34 +0000 Subject: [PATCH 14/16] [Bringup] Fix OffScreenRenderWidgetHostView related linking error The DelegatedFrameHost is not used in chromium-efl. >> undefined reference to `content::DelegatedFrameHost::WasHidden()' >> undefined reference to `content::DelegatedFrameHost::ResetCompositor()' Change-Id: Ibd5631c41153b35bcb8674db48fd57ca1cb2f8ce Signed-off-by: Youngsoo Choi --- atom/browser/osr/osr_render_widget_host_view.cc | 28 +++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/atom/browser/osr/osr_render_widget_host_view.cc b/atom/browser/osr/osr_render_widget_host_view.cc index 2003118..b54f4e7 100644 --- a/atom/browser/osr/osr_render_widget_host_view.cc +++ b/atom/browser/osr/osr_render_widget_host_view.cc @@ -105,7 +105,11 @@ class AtomCopyFrameGenerator { damage_rect)); request->set_area(gfx::Rect(view_->GetPhysicalBackingSize())); +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else view_->GetRootLayer()->RequestCopyOfOutput(std::move(request)); +#endif } void CopyFromCompositingSurfaceHasResult( @@ -151,6 +155,9 @@ class AtomCopyFrameGenerator { return; } +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else content::ImageTransportFactory* factory = content::ImageTransportFactory::GetInstance(); display_compositor::GLHelper* gl_helper = factory->GetGLHelper(); @@ -186,6 +193,7 @@ class AtomCopyFrameGenerator { base::Passed(&bitmap_), base::Passed(&bitmap_pixels_lock)), display_compositor::GLHelper::SCALER_QUALITY_FAST); +#endif } static void CopyFromCompositingSurfaceFinishedProxy( @@ -196,12 +204,16 @@ class AtomCopyFrameGenerator { std::unique_ptr bitmap_pixels_lock, bool result) { gpu::SyncToken sync_token; +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else if (result) { display_compositor::GLHelper* gl_helper = content::ImageTransportFactory::GetInstance()->GetGLHelper(); if (gl_helper) gl_helper->GenerateSyncToken(&sync_token); } +#endif const bool lost_resource = !sync_token.HasData(); release_callback->Run(sync_token, lost_resource); @@ -363,7 +375,9 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView( root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); #endif -#if defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif defined(OS_MACOSX) CreatePlatformWidget(); #else compositor_.reset( @@ -769,7 +783,9 @@ std::unique_ptr bool OffScreenRenderWidgetHostView::InstallTransparency() { if (transparent_) { SetBackgroundColor(SkColor()); -#if defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif defined(OS_MACOSX) browser_compositor_->SetHasTransparentBackground(true); #else compositor_->SetHostHasTransparentBackground(true); @@ -848,8 +864,12 @@ void OffScreenRenderWidgetHostView::SetupFrameRate(bool force) { frame_rate_threshold_ms_ = 1000 / frame_rate_; +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetCompositor()->vsync_manager()->SetAuthoritativeVSyncInterval( base::TimeDelta::FromMilliseconds(frame_rate_threshold_ms_)); +#endif if (copy_frame_generator_) { copy_frame_generator_->set_frame_rate_threshold_ms( @@ -890,8 +910,12 @@ void OffScreenRenderWidgetHostView::ResizeRootLayer() { const gfx::Size& size_in_pixels = gfx::ConvertSizeToPixel(scale_factor_, size); +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetRootLayer()->SetBounds(gfx::Rect(size)); GetCompositor()->SetScaleAndSize(scale_factor_, size_in_pixels); +#endif } void OffScreenRenderWidgetHostView::OnWindowResize() { -- 2.7.4 From 65370084e0e2e3697871a986ed5899a60a497b38 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sat, 5 Aug 2017 08:17:11 +0000 Subject: [PATCH 15/16] [Bringup] Fix DelegatedFrameHost related linking error The DelegatedFrameHost needs to be handled in EFL port. >> undefined reference to `content::DelegatedFrameHost::*' Change-Id: I5a286d8a0bec110548184ebdb11695a05141d1a2 Signed-off-by: Youngsoo Choi --- atom/browser/osr/osr_render_widget_host_view.cc | 60 ++++++++++++++++++++++--- atom/browser/osr/osr_render_widget_host_view.h | 6 +++ 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/atom/browser/osr/osr_render_widget_host_view.cc b/atom/browser/osr/osr_render_widget_host_view.cc index b54f4e7..dda58b0 100644 --- a/atom/browser/osr/osr_render_widget_host_view.cc +++ b/atom/browser/osr/osr_render_widget_host_view.cc @@ -366,7 +366,9 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView( DCHECK(render_widget_host_); render_widget_host_->SetView(this); -#if !defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif !defined(OS_MACOSX) content::ImageTransportFactory* factory = content::ImageTransportFactory::GetInstance(); delegated_frame_host_ = base::MakeUnique( @@ -397,7 +399,9 @@ OffScreenRenderWidgetHostView::~OffScreenRenderWidgetHostView() { if (native_window_) native_window_->RemoveObserver(this); -#if defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif defined(OS_MACOSX) if (is_showing_) browser_compositor_->SetRenderWidgetHostIsHidden(true); #else @@ -464,7 +468,11 @@ void OffScreenRenderWidgetHostView::SetSize(const gfx::Size& size) { ResizeRootLayer(); if (render_widget_host_) render_widget_host_->WasResized(); +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetDelegatedFrameHost()->WasResized(); +#endif } void OffScreenRenderWidgetHostView::SetBounds(const gfx::Rect& new_bounds) { @@ -495,7 +503,12 @@ bool OffScreenRenderWidgetHostView::HasFocus() const { } bool OffScreenRenderWidgetHostView::IsSurfaceAvailableForCopy() const { +#if defined(USE_EFL) + NOTIMPLEMENTED(); + return false; +#else return GetDelegatedFrameHost()->CanCopyToBitmap(); +#endif } void OffScreenRenderWidgetHostView::Show() { @@ -504,7 +517,9 @@ void OffScreenRenderWidgetHostView::Show() { is_showing_ = true; -#if defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif defined(OS_MACOSX) browser_compositor_->SetRenderWidgetHostIsHidden(false); #else delegated_frame_host_->SetCompositor(compositor_.get()); @@ -522,7 +537,9 @@ void OffScreenRenderWidgetHostView::Hide() { if (render_widget_host_) render_widget_host_->WasHidden(); -#if defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif defined(OS_MACOSX) browser_compositor_->SetRenderWidgetHostIsHidden(true); #else GetDelegatedFrameHost()->WasHidden(); @@ -583,7 +600,9 @@ void OffScreenRenderWidgetHostView::OnSwapCompositorFrame( // The compositor will draw directly to the SoftwareOutputDevice which // then calls OnPaint. -#if defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif defined(OS_MACOSX) browser_compositor_->SwapCompositorFrame(output_surface_id, std::move(frame)); #else @@ -605,7 +624,9 @@ void OffScreenRenderWidgetHostView::OnSwapCompositorFrame( gfx::ToEnclosingRect(gfx::RectF(root_pass->damage_rect)); damage_rect.Intersect(gfx::Rect(frame_size)); -#if defined(OS_MACOSX) +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#elif defined(OS_MACOSX) browser_compositor_->SwapCompositorFrame(output_surface_id, std::move(frame)); #else @@ -621,7 +642,11 @@ void OffScreenRenderWidgetHostView::OnSwapCompositorFrame( } void OffScreenRenderWidgetHostView::ClearCompositorFrame() { +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetDelegatedFrameHost()->ClearDelegatedFrame(); +#endif } void OffScreenRenderWidgetHostView::InitAsPopup( @@ -666,29 +691,50 @@ void OffScreenRenderWidgetHostView::CopyFromCompositingSurface( const gfx::Size& dst_size, const content::ReadbackRequestCallback& callback, const SkColorType preferred_color_type) { +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetDelegatedFrameHost()->CopyFromCompositingSurface( src_subrect, dst_size, callback, preferred_color_type); +#endif } void OffScreenRenderWidgetHostView::CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr& target, const base::Callback& callback) { +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetDelegatedFrameHost()->CopyFromCompositingSurfaceToVideoFrame( src_subrect, target, callback); +#endif } bool OffScreenRenderWidgetHostView::CanCopyToVideoFrame() const { +#if defined(USE_EFL) + NOTIMPLEMENTED(); + return false; +#else return GetDelegatedFrameHost()->CanCopyToVideoFrame(); +#endif } void OffScreenRenderWidgetHostView::BeginFrameSubscription( std::unique_ptr subscriber) { +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetDelegatedFrameHost()->BeginFrameSubscription(std::move(subscriber)); +#endif } void OffScreenRenderWidgetHostView::EndFrameSubscription() { +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else GetDelegatedFrameHost()->EndFrameSubscription(); +#endif } bool OffScreenRenderWidgetHostView::HasAcceleratedSurface(const gfx::Size &) { @@ -852,11 +898,13 @@ ui::Layer* OffScreenRenderWidgetHostView::GetRootLayer() const { return root_layer_.get(); } +#if !defined(USE_EFL) content::DelegatedFrameHost* OffScreenRenderWidgetHostView::GetDelegatedFrameHost() const { return delegated_frame_host_.get(); } #endif +#endif void OffScreenRenderWidgetHostView::SetupFrameRate(bool force) { if (!force && frame_rate_threshold_ms_ != 0) diff --git a/atom/browser/osr/osr_render_widget_host_view.h b/atom/browser/osr/osr_render_widget_host_view.h index 7380476..224b6d4 100644 --- a/atom/browser/osr/osr_render_widget_host_view.h +++ b/atom/browser/osr/osr_render_widget_host_view.h @@ -196,7 +196,10 @@ class OffScreenRenderWidgetHostView ui::Compositor* GetCompositor() const; ui::Layer* GetRootLayer() const; + // TODO: Enable DelegatedFrameHost for EFL port +#if !defined(USE_EFL) content::DelegatedFrameHost* GetDelegatedFrameHost() const; +#endif void Invalidate(); @@ -231,7 +234,10 @@ class OffScreenRenderWidgetHostView std::unique_ptr root_layer_; std::unique_ptr compositor_; + // TODO: Enable DelegatedFrameHost for EFL port +#if !defined(USE_EFL) std::unique_ptr delegated_frame_host_; +#endif std::unique_ptr copy_frame_generator_; std::unique_ptr begin_frame_timer_; -- 2.7.4 From b2dab08c19f14242d03b51c4bac9156211d73b65 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Sun, 6 Aug 2017 10:02:31 +0000 Subject: [PATCH 16/16] [Bringup] Fix gtk related linking error EFL port needs to be implemented for LibnotifyNotification::Show. >> undefined reference to `libgtkui::GdkPixbufFromSkBitmap(SkBitmap const&)' Change-Id: Ibd4d3280aa3b1d86b421e41806508a8924663ca7 Signed-off-by: Youngsoo Choi --- vendor/brightray/browser/linux/libnotify_notification.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vendor/brightray/browser/linux/libnotify_notification.cc b/vendor/brightray/browser/linux/libnotify_notification.cc index dad3acb..061ef5f 100644 --- a/vendor/brightray/browser/linux/libnotify_notification.cc +++ b/vendor/brightray/browser/linux/libnotify_notification.cc @@ -105,6 +105,10 @@ void LibnotifyNotification::Show(const base::string16& title, nullptr); } + // FIXME: The chromium-efl does not support gtk port. +#if defined(USE_EFL) + NOTIMPLEMENTED(); +#else if (!icon.drawsNothing()) { GdkPixbuf* pixbuf = libgtkui::GdkPixbufFromSkBitmap(icon); libnotify_loader_.notify_notification_set_image_from_pixbuf( @@ -113,6 +117,7 @@ void LibnotifyNotification::Show(const base::string16& title, notification_, NOTIFY_EXPIRES_DEFAULT); g_object_unref(pixbuf); } +#endif if (!tag.empty()) { GQuark id = g_quark_from_string(tag.c_str()); -- 2.7.4