Implement Chromium Theme for Tizen.
authorViatcheslav Ostapenko <sl.ostapenko@samsung.com>
Wed, 26 Nov 2014 00:38:12 +0000 (19:38 -0500)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Original patch:
1) Patch for selectpicker(single type)
http://suprem.sec.samsung.net/gerrit/#/c/3801
2) Implement SelectPicker (multi type)
http://suprem.sec.samsung.net/gerrit/#/c/4007

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=4833
Reviewed by: Antonio Gomes, SeungSeop Park

Change-Id: Id659a3d17a41e6d6cccd030c8a7f6de2402bd382
Signed-off-by: Viatcheslav Ostapenko <sl.ostapenko@samsung.com>
tizen_src/impl/chromium-efl.gyp
tizen_src/impl/chromium-efl.gypi
tizen_src/impl/theme/RenderThemeChromiumDefault_override.cpp [new file with mode: 0644]
tizen_src/impl/theme/RenderThemeChromiumTizen.cpp [new file with mode: 0644]
tizen_src/impl/theme/RenderThemeChromiumTizen.h [new file with mode: 0644]
tizen_src/impl/theme/theme.gyp [new file with mode: 0644]
tizen_src/impl/theme/themeChromiumTizen.css [new file with mode: 0644]

index b608eee0cb91304a226a2bdcd2e9094db4ea0280..deabc4970ae9809345bb41dc4d3022458c3e1649 100644 (file)
@@ -41,6 +41,7 @@
     'dependencies': [
       'chromium-efl-deps.gyp:efl',
       'chromium-efl-deps.gyp:gstreamer',
+      'theme/theme.gyp:tizen_theme',
       '<(chrome_src_dir)/base/allocator/allocator.gyp:allocator',
       '<(chrome_src_dir)/content/content.gyp:content',
       '<(chrome_src_dir)/content/content.gyp:content_app_browser',
index 104044cd74e1c77d5252595f29ab258905989020..34a01fc37e27bdbc1683c2f1f19bd373ab0c1ac4 100644 (file)
       ['exclude', 'x11_event_source_libevent\\.cc$'],
       ['exclude', 'x11_types\\.cc$'],
     ],
+    'target_conditions': [
+      ['_target_name=="webcore_rendering"', {
+        'sources/': [
+          # Have to exclude under target_conditions here because of multiple
+          # includes/excludes in core.gyp
+          ['exclude', 'rendering/RenderThemeChromiumDefault\\.cpp$'],
+        ],
+      }],
+    ],
     'conditions': [
        ['use_efl==1', {
          'defines': [
diff --git a/tizen_src/impl/theme/RenderThemeChromiumDefault_override.cpp b/tizen_src/impl/theme/RenderThemeChromiumDefault_override.cpp
new file mode 100644 (file)
index 0000000..30fb3ac
--- /dev/null
@@ -0,0 +1,7 @@
+// Copyright 2014 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.
+
+// Define theme method to something else, because we want to have our own
+#define theme not_theme
+#include "third_party/WebKit/Source/core/rendering/RenderThemeChromiumDefault.cpp"
diff --git a/tizen_src/impl/theme/RenderThemeChromiumTizen.cpp b/tizen_src/impl/theme/RenderThemeChromiumTizen.cpp
new file mode 100644 (file)
index 0000000..3c9c3da
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2014 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 "config.h"
+#include "RenderThemeChromiumTizen.h"
+
+#include "TizenUserAgentStyleSheets.h"
+
+namespace blink {
+
+PassRefPtr<RenderTheme> RenderThemeChromiumTizen::create()
+{
+    return adoptRef(new RenderThemeChromiumTizen());
+}
+
+RenderTheme& RenderTheme::theme()
+{
+    DEFINE_STATIC_REF(RenderTheme, renderTheme, (RenderThemeChromiumTizen::create()));
+    return *renderTheme;
+}
+
+RenderThemeChromiumTizen::~RenderThemeChromiumTizen()
+{
+}
+
+String RenderThemeChromiumTizen::extraDefaultStyleSheet()
+{
+    return RenderThemeChromiumDefault::extraDefaultStyleSheet() +
+        String(themeChromiumTizenCss, sizeof(themeChromiumTizenCss));
+}
+
+} // namespace blink
diff --git a/tizen_src/impl/theme/RenderThemeChromiumTizen.h b/tizen_src/impl/theme/RenderThemeChromiumTizen.h
new file mode 100644 (file)
index 0000000..6a52527
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright 2014 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 RenderThemeChromiumTizen_h
+#define RenderThemeChromiumTizen_h
+
+#include "core/rendering/RenderThemeChromiumDefault.h"
+
+namespace blink {
+
+class RenderThemeChromiumTizen final : public RenderThemeChromiumDefault {
+public:
+    static PassRefPtr<RenderTheme> create();
+    virtual String extraDefaultStyleSheet() override;
+
+    virtual bool delegatesMenuListRendering() const override { return true; }
+
+private:
+    virtual ~RenderThemeChromiumTizen();
+};
+
+} // namespace blink
+
+#endif // RenderThemeChromiumTizen_h
diff --git a/tizen_src/impl/theme/theme.gyp b/tizen_src/impl/theme/theme.gyp
new file mode 100644 (file)
index 0000000..030e5f4
--- /dev/null
@@ -0,0 +1,67 @@
+{
+  'targets': [{
+    'target_name': 'tizen_theme',
+    'type': 'static_library',
+
+    'includes': [
+      # NOTE: gyp includes need to be relative
+      '../../src/build/common.gypi',
+      '../../src/third_party/WebKit/Source/build/features.gypi',
+      '../../src/skia/skia_common.gypi',
+    ],
+    'dependencies': [
+      '<(chrome_src_dir)/third_party/WebKit/Source/core/core.gyp:webcore',
+    ],
+    'include_dirs': [
+      '.',
+      '<(chrome_src_dir)',
+      '<(chrome_src_dir)/gpu',
+      '<(chrome_src_dir)/third_party/WebKit',
+      '<(chrome_src_dir)/third_party/WebKit/Source',
+      '<(chrome_src_dir)/third_party/skia/include/core',
+      '<(chrome_src_dir)/third_party/skia/include/utils',
+      '<(chrome_src_dir)/v8/include',
+      '<(SHARED_INTERMEDIATE_DIR)',
+      '<(SHARED_INTERMEDIATE_DIR)/webkit/',
+      '<(SHARED_INTERMEDIATE_DIR)/blink',
+    ],
+    'defines': [
+      'INSIDE_BLINK=1',
+      '<@(feature_defines)',
+    ],
+    'sources': [
+      'RenderThemeChromiumDefault_override.cpp',
+      'RenderThemeChromiumTizen.cpp',
+      'RenderThemeChromiumTizen.h',
+      '<(SHARED_INTERMEDIATE_DIR)/TizenUserAgentStyleSheetsData.cpp',
+    ],
+    'actions': [
+      {
+        'action_name': 'TizenUserAgentStyleSheets',
+        'variables': {
+          'scripts': [
+            '<(chrome_src_dir)/third_party/WebKit/Source/build/scripts/make-file-arrays.py',
+          ],
+          'stylesheets': [ 'themeChromiumTizen.css', ],
+        },
+        'inputs': [
+          '<@(scripts)',
+          '<@(stylesheets)'
+        ],
+        'outputs': [
+          '<(SHARED_INTERMEDIATE_DIR)/TizenUserAgentStyleSheets.h',
+          '<(SHARED_INTERMEDIATE_DIR)/TizenUserAgentStyleSheetsData.cpp',
+        ],
+        'action': [
+          'python',
+          '<@(scripts)',
+          '--namespace',
+          'blink',
+          '--out-h=<(SHARED_INTERMEDIATE_DIR)/TizenUserAgentStyleSheets.h',
+          '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/TizenUserAgentStyleSheetsData.cpp',
+          '<@(stylesheets)',
+        ],
+      },
+    ], # actions
+  }],
+}
diff --git a/tizen_src/impl/theme/themeChromiumTizen.css b/tizen_src/impl/theme/themeChromiumTizen.css
new file mode 100644 (file)
index 0000000..e7184d8
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Samsung Electronics Co., Ltd. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* These styles override other user-agent styles for Chromium. */
+
+select[size],
+select[multiple],
+select[size][multiple] {
+    -webkit-appearance: menulist;
+    align-items: center;
+    background-color: ButtonFace;
+    border: 1px solid #a9a9a9;
+    border-radius: initial;
+    white-space: pre;
+}