fix: don't expose nativeTheme in the renderer process (#20139)

Exposing these in the renderer didn't make sense as they weren't backed
by the same instance / value store.  This API should be browser only
especially now that we have nativeTheme.themeSource.  Exposing in
//common was a mistake from the beginning.
This commit is contained in:
Samuel Attard 2019-09-16 14:23:13 -07:00 committed by GitHub
parent 999f7df158
commit 660e566201
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 11 additions and 14 deletions

View file

@ -2,7 +2,7 @@
> Read and respond to changes in Chromium's native color theme. > Read and respond to changes in Chromium's native color theme.
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) Process: [Main](../glossary.md#main-process)
## Events ## Events

View file

@ -132,7 +132,6 @@ auto_filenames = {
"lib/common/api/deprecate.ts", "lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts", "lib/common/api/module-list.ts",
"lib/common/api/native-image.js", "lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js", "lib/common/api/shell.js",
"lib/common/buffer-utils.ts", "lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts", "lib/common/clipboard-utils.ts",
@ -224,6 +223,7 @@ auto_filenames = {
"lib/browser/api/menu-utils.js", "lib/browser/api/menu-utils.js",
"lib/browser/api/menu.js", "lib/browser/api/menu.js",
"lib/browser/api/module-list.ts", "lib/browser/api/module-list.ts",
"lib/browser/api/native-theme.ts",
"lib/browser/api/net-log.js", "lib/browser/api/net-log.js",
"lib/browser/api/net.js", "lib/browser/api/net.js",
"lib/browser/api/notification.js", "lib/browser/api/notification.js",
@ -265,7 +265,6 @@ auto_filenames = {
"lib/common/api/deprecate.ts", "lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts", "lib/common/api/module-list.ts",
"lib/common/api/native-image.js", "lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js", "lib/common/api/shell.js",
"lib/common/buffer-utils.ts", "lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts", "lib/common/clipboard-utils.ts",
@ -291,7 +290,6 @@ auto_filenames = {
"lib/common/api/deprecate.ts", "lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts", "lib/common/api/module-list.ts",
"lib/common/api/native-image.js", "lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js", "lib/common/api/shell.js",
"lib/common/buffer-utils.ts", "lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts", "lib/common/clipboard-utils.ts",
@ -342,7 +340,6 @@ auto_filenames = {
"lib/common/api/deprecate.ts", "lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts", "lib/common/api/module-list.ts",
"lib/common/api/native-image.js", "lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js", "lib/common/api/shell.js",
"lib/common/buffer-utils.ts", "lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts", "lib/common/clipboard-utils.ts",

View file

@ -65,6 +65,9 @@ filenames = {
"shell/browser/api/atom_api_menu_mac.mm", "shell/browser/api/atom_api_menu_mac.mm",
"shell/browser/api/atom_api_menu_views.cc", "shell/browser/api/atom_api_menu_views.cc",
"shell/browser/api/atom_api_menu_views.h", "shell/browser/api/atom_api_menu_views.h",
"shell/browser/api/atom_api_native_theme.cc",
"shell/browser/api/atom_api_native_theme.h",
"shell/browser/api/atom_api_native_theme_mac.mm",
"shell/browser/api/atom_api_net.cc", "shell/browser/api/atom_api_net.cc",
"shell/browser/api/atom_api_net.h", "shell/browser/api/atom_api_net.h",
"shell/browser/api/atom_api_net_log.cc", "shell/browser/api/atom_api_net_log.cc",
@ -427,9 +430,6 @@ filenames = {
"shell/common/api/atom_api_native_image.cc", "shell/common/api/atom_api_native_image.cc",
"shell/common/api/atom_api_native_image.h", "shell/common/api/atom_api_native_image.h",
"shell/common/api/atom_api_native_image_mac.mm", "shell/common/api/atom_api_native_image_mac.mm",
"shell/common/api/atom_api_native_theme.cc",
"shell/common/api/atom_api_native_theme.h",
"shell/common/api/atom_api_native_theme_mac.mm",
"shell/common/api/atom_api_shell.cc", "shell/common/api/atom_api_shell.cc",
"shell/common/api/atom_api_v8_util.cc", "shell/common/api/atom_api_v8_util.cc",
"shell/common/api/electron_bindings.cc", "shell/common/api/electron_bindings.cc",

View file

@ -16,6 +16,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'inAppPurchase', loader: () => require('./in-app-purchase') }, { name: 'inAppPurchase', loader: () => require('./in-app-purchase') },
{ name: 'Menu', loader: () => require('./menu') }, { name: 'Menu', loader: () => require('./menu') },
{ name: 'MenuItem', loader: () => require('./menu-item') }, { name: 'MenuItem', loader: () => require('./menu-item') },
{ name: 'nativeTheme', loader: () => require('./native-theme') },
{ name: 'net', loader: () => require('./net') }, { name: 'net', loader: () => require('./net') },
{ name: 'netLog', loader: () => require('./net-log') }, { name: 'netLog', loader: () => require('./net-log') },
{ name: 'Notification', loader: () => require('./notification') }, { name: 'Notification', loader: () => require('./notification') },

View file

@ -2,7 +2,6 @@
export const commonModuleList: ElectronInternal.ModuleEntry[] = [ export const commonModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'clipboard', loader: () => require('./clipboard') }, { name: 'clipboard', loader: () => require('./clipboard') },
{ name: 'nativeImage', loader: () => require('./native-image') }, { name: 'nativeImage', loader: () => require('./native-image') },
{ name: 'nativeTheme', loader: () => require('./native-theme') },
{ name: 'shell', loader: () => require('./shell') }, { name: 'shell', loader: () => require('./shell') },
// The internal modules, invisible unless you know their names. // The internal modules, invisible unless you know their names.
{ name: 'deprecate', loader: () => require('./deprecate'), private: true } { name: 'deprecate', loader: () => require('./deprecate'), private: true }

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by the MIT license that can be // Use of this source code is governed by the MIT license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "shell/common/api/atom_api_native_theme.h" #include "shell/browser/api/atom_api_native_theme.h"
#include <string> #include <string>

View file

@ -2,8 +2,8 @@
// Use of this source code is governed by the MIT license that can be // Use of this source code is governed by the MIT license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef SHELL_COMMON_API_ATOM_API_NATIVE_THEME_H_ #ifndef SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_
#define SHELL_COMMON_API_ATOM_API_NATIVE_THEME_H_ #define SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_
#include "native_mate/handle.h" #include "native_mate/handle.h"
#include "shell/browser/api/event_emitter.h" #include "shell/browser/api/event_emitter.h"
@ -62,4 +62,4 @@ struct Converter<ui::NativeTheme::ThemeSource> {
} // namespace mate } // namespace mate
#endif // SHELL_COMMON_API_ATOM_API_NATIVE_THEME_H_ #endif // SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by the MIT license that can be // Use of this source code is governed by the MIT license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "shell/common/api/atom_api_native_theme.h" #include "shell/browser/api/atom_api_native_theme.h"
#include "base/mac/sdk_forward_declarations.h" #include "base/mac/sdk_forward_declarations.h"
#include "shell/browser/mac/atom_application.h" #include "shell/browser/mac/atom_application.h"