diff options
author | tbarzic <tbarzic@chromium.org> | 2015-05-01 11:44:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-01 18:45:13 +0000 |
commit | 56ebc035717d90057a245bfc7c7e847ea97f938f (patch) | |
tree | bed28aad272e3a8386c61deeeb26ae561c55a98e /components | |
parent | 609a8398a05f7fe1db94fc23b88a1b0c4f96319d (diff) | |
download | chromium_src-56ebc035717d90057a245bfc7c7e847ea97f938f.zip chromium_src-56ebc035717d90057a245bfc7c7e847ea97f938f.tar.gz chromium_src-56ebc035717d90057a245bfc7c7e847ea97f938f.tar.bz2 |
Add components/chrome_apps
This is a new component that will contain Chrome component apps.
Add empty implementation for a new webstore_widget app, which will be used
to show Chrome Webstore Gallery widget to the user (wich displays filtered
list of Chrome Webstore apps and from which the user will be able to
install apps).
The widget is currently implemented as part of file manager app, but will be moved
to a separate app to support more general use cases.
NOTE: I expect to have more component apps moved to the new components
module in the future, first one being file manager.
BUG=477106
TEST=compiles
Review URL: https://codereview.chromium.org/1103943003
Cr-Commit-Position: refs/heads/master@{#327949}
Diffstat (limited to 'components')
-rw-r--r-- | components/BUILD.gn | 6 | ||||
-rw-r--r-- | components/OWNERS | 2 | ||||
-rw-r--r-- | components/chrome_apps.gypi | 51 | ||||
-rw-r--r-- | components/chrome_apps/BUILD.gn | 29 | ||||
-rw-r--r-- | components/chrome_apps/DEPS | 4 | ||||
-rw-r--r-- | components/chrome_apps/OWNERS | 1 | ||||
-rw-r--r-- | components/chrome_apps/chrome_apps_export.h | 32 | ||||
-rw-r--r-- | components/chrome_apps/chrome_apps_resource_util.cc | 19 | ||||
-rw-r--r-- | components/chrome_apps/chrome_apps_resource_util.h | 23 | ||||
-rw-r--r-- | components/chrome_apps/chrome_apps_resources.grd | 19 | ||||
-rw-r--r-- | components/chrome_apps/webstore_widget/OWNERS | 5 | ||||
-rw-r--r-- | components/chrome_apps/webstore_widget/app/background.js | 5 | ||||
-rw-r--r-- | components/chrome_apps/webstore_widget/manifest.json | 15 | ||||
-rw-r--r-- | components/chrome_apps/webstore_widget_resources.grdp | 5 | ||||
-rw-r--r-- | components/components.gyp | 7 |
15 files changed, 223 insertions, 0 deletions
diff --git a/components/BUILD.gn b/components/BUILD.gn index 4898af9..66864f0 100644 --- a/components/BUILD.gn +++ b/components/BUILD.gn @@ -27,6 +27,7 @@ group("all_components") { "//components/cdm/common", "//components/cdm/renderer", "//components/cloud_devices/common", + "//components/chrome_apps", "//components/component_updater", "//components/content_settings/core/browser", "//components/content_settings/core/common", @@ -143,6 +144,11 @@ group("all_components") { "//components/wifi_sync", ] } + + if (!is_chromeos || !enable_extensions) { + deps -= [ "//components/chrome_apps" ] + } + if (is_ios) { deps -= [ "//components/history/content/browser", diff --git a/components/OWNERS b/components/OWNERS index 86bc6db..0c5f5f5 100644 --- a/components/OWNERS +++ b/components/OWNERS @@ -32,6 +32,8 @@ per-file cdm.gypi=xhwang@chromium.org per-file cloud_devices*=gene@chromium.org per-file cloud_devices*=vitalybuka@chromium.org +per-file chrome_apps.gypi=tbarzic@chromium.org + per-file constrained_window*=gbillock@chromium.org per-file constrained_window*=msw@chromium.org diff --git a/components/chrome_apps.gypi b/components/chrome_apps.gypi new file mode 100644 index 0000000..4d01ece --- /dev/null +++ b/components/chrome_apps.gypi @@ -0,0 +1,51 @@ +# Copyright 2015 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. +{ + 'variables': { + 'chromium_code': 1, + 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/components/chrome_apps', + }, + 'targets': [ + { + 'target_name': 'chrome_apps_resources', + 'type': 'none', + 'actions': [ + { + 'action_name': 'chrome_apps_resources', + 'variables': { + 'grit_grd_file': 'chrome_apps/chrome_apps_resources.grd', + }, + 'includes': [ '../build/grit_action.gypi' ], + }, + ], + 'includes': [ '../build/grit_target.gypi' ], + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '<(SHARED_INTERMEDIATE_DIR)/components/chrome_apps/chrome_apps_resources.pak', + ], + }, + ], + }, + { + 'target_name': 'chrome_apps', + 'type': '<(component)', + 'dependencies': [ + '../base/base.gyp:base', + 'chrome_apps_resources', + ], + 'defines': [ + 'CHROME_APPS_IMPLEMENTATION', + ], + 'sources': [ + '<(grit_out_dir)/grit/chrome_apps_resources_map.cc', + '<(grit_out_dir)/grit/chrome_apps_resources_map.h', + 'chrome_apps/chrome_apps_export.h', + 'chrome_apps/chrome_apps_resource_util.cc', + 'chrome_apps/chrome_apps_resource_util.h', + ] + } + ] +} diff --git a/components/chrome_apps/BUILD.gn b/components/chrome_apps/BUILD.gn new file mode 100644 index 0000000..a559500 --- /dev/null +++ b/components/chrome_apps/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2015 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. + +import("//tools/grit/grit_rule.gni") + +grit("resources") { + source = "chrome_apps_resources.grd" + outputs = [ + "grit/chrome_apps_resources.h", + "grit/chrome_apps_resources_map.cc", + "grit/chrome_apps_resources_map.h", + "chrome_apps_resources.pak", + "chrome_apps_resources.rc", + ] +} + +component("chrome_apps") { + sources = [ + "chrome_apps_export.h", + "chrome_apps_resource_util.cc", + "chrome_apps_resource_util.h", + ] + deps = [ + "//base", + ":resources", + ] + defines = [ "CHROME_APPS_IMPLEMENTATION" ] +} diff --git a/components/chrome_apps/DEPS b/components/chrome_apps/DEPS new file mode 100644 index 0000000..8ef0c33 --- /dev/null +++ b/components/chrome_apps/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + "+grit/chrome_apps_resources.h", + "+grit/chrome_apps_resources_map.h" +] diff --git a/components/chrome_apps/OWNERS b/components/chrome_apps/OWNERS new file mode 100644 index 0000000..d063efc --- /dev/null +++ b/components/chrome_apps/OWNERS @@ -0,0 +1 @@ +tbarzic@chromium.org diff --git a/components/chrome_apps/chrome_apps_export.h b/components/chrome_apps/chrome_apps_export.h new file mode 100644 index 0000000..6569016 --- /dev/null +++ b/components/chrome_apps/chrome_apps_export.h @@ -0,0 +1,32 @@ +// Copyright 2015 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 COMPONENTS_CHROME_APPS_CHROME_APPS_EXPORT_H_ +#define COMPONENTS_CHROME_APPS_CHROME_APPS_EXPORT_H_ + +// Defines CHROME_APPS_EXPORT so that functionality implemented by the +// CHROME_APPS module can be exported to consumers. + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(CHROME_APPS_IMPLEMENTATION) +#define CHROME_APPS_EXPORT __declspec(dllexport) +#else +#define CHROME_APPS_EXPORT __declspec(dllimport) +#endif // defined(CHROME_APPS_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(CHROME_APPS_IMPLEMENTATION) +#define CHROME_APPS_EXPORT __attribute__((visibility("default"))) +#else +#define CHROME_APPS_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define CHROME_APPS_EXPORT +#endif + +#endif // COMPONENTS_CHROME_APPS_CHROME_APPS_EXPORT_H_ diff --git a/components/chrome_apps/chrome_apps_resource_util.cc b/components/chrome_apps/chrome_apps_resource_util.cc new file mode 100644 index 0000000..78fd827 --- /dev/null +++ b/components/chrome_apps/chrome_apps_resource_util.cc @@ -0,0 +1,19 @@ +// Copyright 2015 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 "components/chrome_apps/chrome_apps_resource_util.h" + +#include "base/logging.h" +#include "grit/chrome_apps_resources_map.h" + +namespace chrome_apps { + +const GritResourceMap* GetChromeAppsResources(size_t* size) { + DCHECK(size); + + *size = kChromeAppsResourcesSize; + return kChromeAppsResources; +} + +} // namespace chrome_apps diff --git a/components/chrome_apps/chrome_apps_resource_util.h b/components/chrome_apps/chrome_apps_resource_util.h new file mode 100644 index 0000000..591929c --- /dev/null +++ b/components/chrome_apps/chrome_apps_resource_util.h @@ -0,0 +1,23 @@ +// Copyright 2015 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 COMPONENTS_CHROME_APPS_CHROME_APPS_RESOURCE_UTIL_H_ +#define COMPONENTS_CHROME_APPS_CHROME_APPS_RESOURCE_UTIL_H_ + +#include <cstddef> + +#include "components/chrome_apps/chrome_apps_export.h" + +struct GritResourceMap; + +namespace chrome_apps { + +// Get the list of resources. |size| is populated with the number of resources +// in the returned array. +CHROME_APPS_EXPORT const GritResourceMap* GetChromeAppsResources( + size_t* size); + +} // namespace chrome_apps + +#endif // COMPONENTS_CHROME_APPS_CHROME_APPS_RESOURCE_UTIL_H_ diff --git a/components/chrome_apps/chrome_apps_resources.grd b/components/chrome_apps/chrome_apps_resources.grd new file mode 100644 index 0000000..725f042 --- /dev/null +++ b/components/chrome_apps/chrome_apps_resources.grd @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grit latest_public_release="0" current_release="1"> + <outputs> + <output filename="grit/chrome_apps_resources.h" type="rc_header"> + <emit emit_type='prepend'></emit> + </output> + <output filename="grit/chrome_apps_resources_map.cc" type="resource_file_map_source" /> + <output filename="grit/chrome_apps_resources_map.h" type="resource_map_header" /> + <output filename="chrome_apps_resources.pak" type="data_package" /> + <output filename="chrome_apps_resources.rc" type="rc_all" /> + </outputs> + <release seq="1"> + <includes> + <if expr="chromeos"> + <part file="webstore_widget_resources.grdp" /> + </if> + </includes> + </release> +</grit> diff --git a/components/chrome_apps/webstore_widget/OWNERS b/components/chrome_apps/webstore_widget/OWNERS new file mode 100644 index 0000000..c0edc54 --- /dev/null +++ b/components/chrome_apps/webstore_widget/OWNERS @@ -0,0 +1,5 @@ +fukino@chromium.org +hirono@chromium.org +mtomasz@chromium.org +tbarzic@chromium.org +yoshiki@chromium.org diff --git a/components/chrome_apps/webstore_widget/app/background.js b/components/chrome_apps/webstore_widget/app/background.js new file mode 100644 index 0000000..c878b2a --- /dev/null +++ b/components/chrome_apps/webstore_widget/app/background.js @@ -0,0 +1,5 @@ +// Copyright 2015 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. + +// TODO(tbarzic): Implement this. diff --git a/components/chrome_apps/webstore_widget/manifest.json b/components/chrome_apps/webstore_widget/manifest.json new file mode 100644 index 0000000..fad4329 --- /dev/null +++ b/components/chrome_apps/webstore_widget/manifest.json @@ -0,0 +1,15 @@ +{ + // chrome-extension://fbjakikfhfdajcamjleinfciajelkpek/ + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ZSmlOjtKoapSOZ4kH4vpSh2WzGxT7AlJgTet+0v5O/eV56dg1D+hpIltMswe47zX3kozOOzZ3LhnLHZb7kBIyVdgmtAv73XP1/CjvO7w1F5dzdS3zqJEg4JIblKmGIs8Zb93rols5DsJth58w3nPDz94clWQY3VI0IsgPfgssi/5OHyyzd3fVZS6UQU1XBkfZ+mpUQSKD293Rqq2aol1WgmyVumj7o8YM73SU/9Hnxla56ew88Zv/A78o1i1X6mcQcLCexDIAwcerJ09TvrLRv0sexRKBx47YZqVmR5yJRNGQiJdV54Es/jP6K8Oy8oZnz7Wea/nAL0b0OKAcq7+QIDAQAB", + "name": "Chrome Webstore Gallery Widget app", + "description": "App for showing Chrome Webstore Gallery widget and handling extension installs from the widget", + "version": "0.1", + "manifest_version": 2, + "app": { + "background": { + "scripts": ["app/background.js"] + } + }, + "permissions": [ + ] +} diff --git a/components/chrome_apps/webstore_widget_resources.grdp b/components/chrome_apps/webstore_widget_resources.grdp new file mode 100644 index 0000000..b08ef3f --- /dev/null +++ b/components/chrome_apps/webstore_widget_resources.grdp @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<grit-part> + <include name="IDR_CHROME_APPS_WEBSTORE_WIDGET_MANIFEST" file="webstore_widget/manifest.json" type="BINDATA" /> + <include name="IDR_CHROME_APPS_WEBSTORE_WIDGET_BACKGROUND_JS" file="webstore_widget/app/background.js" type="BINDATA" /> +</grit-part> diff --git a/components/components.gyp b/components/components.gyp index 3f6eb49..f8dee130 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -152,5 +152,12 @@ 'pdf.gypi', ], }], + # TODO(tbarzic): Remove chromeos condition when there are non-chromeos apps + # in components/apps. + ['enable_extensions == 1 and chromeos == 1', { + 'includes': [ + 'chrome_apps.gypi', + ], + }], ], } |