From d9321f4df751fa32813fab1b6387bbd61bd681d0 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Tue, 4 Feb 2020 12:19:40 -0800 Subject: [PATCH] chore: rename atom -> electron (#21986) --- BUILD.gn | 48 +-- .../chrome/browser/process_singleton_posix.cc | 4 +- filenames.gni | 354 +++++++++--------- patches/node/build_add_gn_build_files.patch | 6 +- script/lint.js | 6 +- ...t_client.cc => electron_content_client.cc} | 30 +- ...ent_client.h => electron_content_client.h} | 14 +- ...library_main.h => electron_library_main.h} | 10 +- ...brary_main.mm => electron_library_main.mm} | 14 +- ...gin_helper.mm => electron_login_helper.mm} | 0 shell/app/{atom_main.cc => electron_main.cc} | 26 +- shell/app/{atom_main.h => electron_main.h} | 6 +- ..._delegate.cc => electron_main_delegate.cc} | 62 +-- ...in_delegate.h => electron_main_delegate.h} | 14 +- ...ate_mac.h => electron_main_delegate_mac.h} | 6 +- ...e_mac.mm => electron_main_delegate_mac.mm} | 12 +- .../{atom_api_app.cc => electron_api_app.cc} | 46 +-- .../{atom_api_app.h => electron_api_app.h} | 10 +- ...api_app_mac.mm => electron_api_app_mac.mm} | 4 +- ...api_app_mas.mm => electron_api_app_mas.mm} | 2 +- ...pdater.cc => electron_api_auto_updater.cc} | 2 +- ..._updater.h => electron_api_auto_updater.h} | 6 +- ...r_view.cc => electron_api_browser_view.cc} | 4 +- ...ser_view.h => electron_api_browser_view.h} | 6 +- ...ndow.cc => electron_api_browser_window.cc} | 2 +- ...window.h => electron_api_browser_window.h} | 10 +- ....mm => electron_api_browser_window_mac.mm} | 2 +- ...c => electron_api_browser_window_views.cc} | 2 +- ...ing.cc => electron_api_content_tracing.cc} | 0 ...api_cookies.cc => electron_api_cookies.cc} | 8 +- ...m_api_cookies.h => electron_api_cookies.h} | 14 +- ...er.cc => electron_api_data_pipe_holder.cc} | 2 +- ...lder.h => electron_api_data_pipe_holder.h} | 6 +- ...i_debugger.cc => electron_api_debugger.cc} | 2 +- ...api_debugger.h => electron_api_debugger.h} | 6 +- ...er.cc => electron_api_desktop_capturer.cc} | 4 +- ...urer.h => electron_api_desktop_capturer.h} | 6 +- ...m_api_dialog.cc => electron_api_dialog.cc} | 0 ..._item.cc => electron_api_download_item.cc} | 4 +- ...ad_item.h => electron_api_download_item.h} | 6 +- ...tom_api_event.cc => electron_api_event.cc} | 0 ...cut.cc => electron_api_global_shortcut.cc} | 4 +- ...rtcut.h => electron_api_global_shortcut.h} | 6 +- ...ase.cc => electron_api_in_app_purchase.cc} | 2 +- ...chase.h => electron_api_in_app_purchase.h} | 6 +- ...{atom_api_menu.cc => electron_api_menu.cc} | 4 +- .../{atom_api_menu.h => electron_api_menu.h} | 22 +- ...api_menu_mac.h => electron_api_menu_mac.h} | 14 +- ...i_menu_mac.mm => electron_api_menu_mac.mm} | 14 +- ...nu_views.cc => electron_api_menu_views.cc} | 2 +- ...menu_views.h => electron_api_menu_views.h} | 8 +- ..._theme.cc => electron_api_native_theme.cc} | 2 +- ...ve_theme.h => electron_api_native_theme.h} | 6 +- ...ac.mm => electron_api_native_theme_mac.mm} | 4 +- .../{atom_api_net.cc => electron_api_net.cc} | 4 +- .../{atom_api_net.h => electron_api_net.h} | 6 +- ...api_net_log.cc => electron_api_net_log.cc} | 8 +- ...m_api_net_log.h => electron_api_net_log.h} | 15 +- ...cation.cc => electron_api_notification.cc} | 10 +- ...fication.h => electron_api_notification.h} | 6 +- ...nitor.cc => electron_api_power_monitor.cc} | 2 +- ...monitor.h => electron_api_power_monitor.h} | 6 +- ...c.mm => electron_api_power_monitor_mac.mm} | 2 +- ...n.cc => electron_api_power_monitor_win.cc} | 2 +- ....cc => electron_api_power_save_blocker.cc} | 2 +- ...er.h => electron_api_power_save_blocker.h} | 6 +- ...i_protocol.cc => electron_api_protocol.cc} | 14 +- ...api_protocol.h => electron_api_protocol.h} | 16 +- ...m_api_screen.cc => electron_api_screen.cc} | 2 +- ...tom_api_screen.h => electron_api_screen.h} | 6 +- ...api_session.cc => electron_api_session.cc} | 53 +-- ...m_api_session.h => electron_api_session.h} | 21 +- ....cc => electron_api_system_preferences.cc} | 2 +- ...es.h => electron_api_system_preferences.h} | 6 +- ...=> electron_api_system_preferences_mac.mm} | 4 +- ...=> electron_api_system_preferences_win.cc} | 2 +- ...ow.cc => electron_api_top_level_window.cc} | 10 +- ...ndow.h => electron_api_top_level_window.h} | 8 +- ...{atom_api_tray.cc => electron_api_tray.cc} | 6 +- .../{atom_api_tray.h => electron_api_tray.h} | 6 +- ...l_loader.cc => electron_api_url_loader.cc} | 6 +- ...url_loader.h => electron_api_url_loader.h} | 6 +- ...{atom_api_view.cc => electron_api_view.cc} | 2 +- .../{atom_api_view.h => electron_api_view.h} | 8 +- ...ntents.cc => electron_api_web_contents.cc} | 35 +- ...contents.h => electron_api_web_contents.h} | 14 +- ...l.cc => electron_api_web_contents_impl.cc} | 2 +- ...ac.mm => electron_api_web_contents_mac.mm} | 2 +- ...w.cc => electron_api_web_contents_view.cc} | 4 +- ...iew.h => electron_api_web_contents_view.h} | 8 +- ...request.cc => electron_api_web_request.cc} | 12 +- ...b_request.h => electron_api_web_request.h} | 6 +- ...er.cc => electron_api_web_view_manager.cc} | 0 shell/browser/api/save_page_handler.cc | 2 +- ...x_layout.cc => electron_api_box_layout.cc} | 4 +- ...box_layout.h => electron_api_box_layout.h} | 8 +- ...m_api_button.cc => electron_api_button.cc} | 2 +- ...tom_api_button.h => electron_api_button.h} | 8 +- ...button.cc => electron_api_label_button.cc} | 2 +- ...l_button.h => electron_api_label_button.h} | 8 +- ...ager.cc => electron_api_layout_manager.cc} | 2 +- ...anager.h => electron_api_layout_manager.h} | 6 +- ...tton.cc => electron_api_md_text_button.cc} | 2 +- ...button.h => electron_api_md_text_button.h} | 8 +- ...ze_area.cc => electron_api_resize_area.cc} | 2 +- ...size_area.h => electron_api_resize_area.h} | 8 +- ...xt_field.cc => electron_api_text_field.cc} | 2 +- ...text_field.h => electron_api_text_field.h} | 8 +- shell/browser/atom_navigation_throttle.h | 27 -- ...tom_speech_recognition_manager_delegate.cc | 64 ---- shell/browser/browser.cc | 8 +- shell/browser/browser.h | 4 +- shell/browser/browser_mac.mm | 44 +-- shell/browser/common_web_contents_delegate.cc | 12 +- shell/browser/common_web_contents_delegate.h | 6 +- .../common_web_contents_delegate_views.cc | 2 +- shell/browser/cookie_change_notifier.cc | 5 +- shell/browser/cookie_change_notifier.h | 6 +- ..._driver.cc => electron_autofill_driver.cc} | 4 +- ...ll_driver.h => electron_autofill_driver.h} | 6 +- ...cc => electron_autofill_driver_factory.cc} | 4 +- ...y.h => electron_autofill_driver_factory.h} | 6 +- ...r_client.cc => electron_browser_client.cc} | 201 +++++----- ...ser_client.h => electron_browser_client.h} | 18 +- ...context.cc => electron_browser_context.cc} | 98 ++--- ...r_context.h => electron_browser_context.h} | 42 +-- ...arts.cc => electron_browser_main_parts.cc} | 68 ++-- ..._parts.h => electron_browser_main_parts.h} | 20 +- ....mm => electron_browser_main_parts_mac.mm} | 21 +- ...c => electron_browser_main_parts_posix.cc} | 6 +- ... => electron_download_manager_delegate.cc} | 43 ++- ...h => electron_download_manager_delegate.h} | 17 +- ...m_gpu_client.cc => electron_gpu_client.cc} | 6 +- ...tom_gpu_client.h => electron_gpu_client.h} | 12 +- ... => electron_javascript_dialog_manager.cc} | 18 +- ...h => electron_javascript_dialog_manager.h} | 13 +- ...tle.cc => electron_navigation_throttle.cc} | 14 +- shell/browser/electron_navigation_throttle.h | 28 ++ .../{atom_paths.h => electron_paths.h} | 6 +- ...ager.cc => electron_permission_manager.cc} | 53 +-- ...anager.h => electron_permission_manager.h} | 14 +- ...c => electron_quota_permission_context.cc} | 8 +- ....h => electron_quota_permission_context.h} | 14 +- ...ron_speech_recognition_manager_delegate.cc | 66 ++++ ...ron_speech_recognition_manager_delegate.h} | 14 +- ... => electron_web_ui_controller_factory.cc} | 23 +- ...h => electron_web_ui_controller_factory.h} | 18 +- shell/browser/extensions/api/tabs/tabs_api.cc | 2 +- .../electron_extensions_browser_client.cc | 16 +- .../extensions/electron_messaging_delegate.cc | 2 +- shell/browser/lib/bluetooth_chooser.h | 2 +- shell/browser/login_handler.cc | 2 +- shell/browser/mac/atom_application_delegate.h | 17 - ...m_application.h => electron_application.h} | 8 +- ...application.mm => electron_application.mm} | 12 +- .../mac/electron_application_delegate.h | 17 + ...te.mm => electron_application_delegate.mm} | 12 +- shell/browser/native_browser_view.cc | 2 +- shell/browser/native_window.cc | 2 +- shell/browser/native_window.h | 4 +- shell/browser/native_window_mac.h | 20 +- shell/browser/native_window_mac.mm | 28 +- shell/browser/native_window_views.cc | 10 +- shell/browser/native_window_views.h | 2 +- shell/browser/native_window_views_win.cc | 2 +- ...tory.cc => electron_url_loader_factory.cc} | 42 ++- ...actory.h => electron_url_loader_factory.h} | 14 +- shell/browser/net/network_context_service.cc | 6 +- shell/browser/net/network_context_service.h | 4 +- .../net/network_context_service_factory.cc | 3 +- .../net/proxying_url_loader_factory.cc | 2 +- .../browser/net/proxying_url_loader_factory.h | 2 +- shell/browser/net/resolve_proxy_helper.cc | 4 +- shell/browser/net/resolve_proxy_helper.h | 6 +- .../net/system_network_context_manager.cc | 4 +- shell/browser/network_hints_handler_impl.cc | 6 +- .../platform_notification_service.cc | 4 +- .../platform_notification_service.h | 6 +- .../osr/osr_render_widget_host_view.cc | 19 +- .../browser/osr/osr_render_widget_host_view.h | 11 +- shell/browser/pref_store_delegate.cc | 4 +- shell/browser/pref_store_delegate.h | 7 +- shell/browser/relauncher.cc | 4 +- shell/browser/resources/mac/Info.plist | 2 +- shell/browser/ui/accelerator_util.cc | 6 +- shell/browser/ui/accelerator_util.h | 6 +- .../browser/ui/cocoa/atom_native_widget_mac.h | 35 -- ...bundle_mover.h => electron_bundle_mover.h} | 10 +- ...ndle_mover.mm => electron_bundle_mover.mm} | 36 +- ... electron_inspectable_web_contents_view.h} | 2 +- ...electron_inspectable_web_contents_view.mm} | 4 +- ...ontroller.h => electron_menu_controller.h} | 18 +- ...troller.mm => electron_menu_controller.mm} | 41 +- .../ui/cocoa/electron_native_widget_mac.h | 35 ++ ...t_mac.mm => electron_native_widget_mac.mm} | 14 +- ...{atom_ns_window.h => electron_ns_window.h} | 8 +- ...tom_ns_window.mm => electron_ns_window.mm} | 8 +- ...legate.h => electron_ns_window_delegate.h} | 8 +- ...gate.mm => electron_ns_window_delegate.mm} | 8 +- ...preview_item.h => electron_preview_item.h} | 8 +- ...eview_item.mm => electron_preview_item.mm} | 4 +- ...{atom_touch_bar.h => electron_touch_bar.h} | 12 +- ...tom_touch_bar.mm => electron_touch_bar.mm} | 4 +- shell/browser/ui/devtools_manager_delegate.cc | 2 +- ...m_menu_model.cc => electron_menu_model.cc} | 34 +- ...tom_menu_model.h => electron_menu_model.h} | 16 +- shell/browser/ui/file_dialog_mac.mm | 8 +- .../ui/inspectable_web_contents_impl.cc | 2 +- .../ui/inspectable_web_contents_view_mac.h | 4 +- .../ui/inspectable_web_contents_view_mac.mm | 4 +- shell/browser/ui/tray_icon.cc | 2 +- shell/browser/ui/tray_icon.h | 6 +- shell/browser/ui/tray_icon_cocoa.h | 10 +- shell/browser/ui/tray_icon_cocoa.mm | 26 +- shell/browser/ui/tray_icon_gtk.cc | 2 +- shell/browser/ui/tray_icon_gtk.h | 2 +- ...delegate.cc => electron_views_delegate.cc} | 2 +- ...s_delegate.h => electron_views_delegate.h} | 6 +- ..._win.cc => electron_views_delegate_win.cc} | 2 +- shell/browser/ui/views/global_menu_bar_x11.cc | 33 +- shell/browser/ui/views/global_menu_bar_x11.h | 6 +- shell/browser/ui/views/menu_bar.cc | 10 +- shell/browser/ui/views/menu_bar.h | 8 +- shell/browser/ui/views/menu_delegate.cc | 4 +- shell/browser/ui/views/menu_delegate.h | 4 +- shell/browser/ui/views/menu_model_adapter.cc | 4 +- shell/browser/ui/views/menu_model_adapter.h | 6 +- shell/browser/ui/views/native_frame_view.cc | 2 +- shell/browser/ui/views/root_view.cc | 5 +- shell/browser/ui/views/root_view.h | 6 +- ...=> electron_desktop_native_widget_aura.cc} | 16 +- ... => electron_desktop_native_widget_aura.h} | 13 +- ... electron_desktop_window_tree_host_win.cc} | 21 +- ...> electron_desktop_window_tree_host_win.h} | 15 +- shell/browser/ui/win/notify_icon.cc | 4 +- shell/browser/ui/win/notify_icon.h | 6 +- .../browser/web_contents_permission_helper.cc | 6 +- shell/browser/web_contents_preferences.h | 2 +- shell/browser/web_dialog_helper.cc | 9 +- shell/browser/web_view_guest_delegate.cc | 2 +- shell/browser/web_view_manager.cc | 2 +- ...{atom_api_asar.cc => electron_api_asar.cc} | 0 ...clipboard.cc => electron_api_clipboard.cc} | 2 +- ...i_clipboard.h => electron_api_clipboard.h} | 6 +- ...d_mac.mm => electron_api_clipboard_mac.mm} | 2 +- ...d_line.cc => electron_api_command_line.cc} | 0 ...rter.cc => electron_api_crash_reporter.cc} | 0 ...weak_map.h => electron_api_key_weak_map.h} | 6 +- ..._image.cc => electron_api_native_image.cc} | 2 +- ...ve_image.h => electron_api_native_image.h} | 6 +- ...ac.mm => electron_api_native_image_mac.mm} | 2 +- ...tom_api_shell.cc => electron_api_shell.cc} | 0 ...api_v8_util.cc => electron_api_v8_util.cc} | 2 +- shell/common/crash_reporter/crash_reporter.cc | 2 +- .../crash_reporter/crash_reporter_win.cc | 2 +- ...mmand_line.cc => electron_command_line.cc} | 8 +- ...command_line.h => electron_command_line.h} | 10 +- ...tom_constants.cc => electron_constants.cc} | 2 +- ...{atom_constants.h => electron_constants.h} | 6 +- .../gin_converters/content_converter.cc | 2 +- .../gin_converters/file_dialog_converter.cc | 2 +- .../common/gin_converters/image_converter.cc | 2 +- .../gin_converters/native_window_converter.h | 2 +- shell/common/gin_converters/net_converter.cc | 2 +- .../common/gin_helper/persistent_dictionary.h | 4 +- shell/common/gin_helper/trackable_object.cc | 4 +- shell/common/node_bindings.cc | 8 +- shell/common/resources/mac/MainMenu.xib | 2 +- .../render_frame_context_bridge_store.h | 2 +- ...idge.cc => electron_api_context_bridge.cc} | 4 +- ...bridge.h => electron_api_context_bridge.h} | 6 +- ...er_ipc.cc => electron_api_renderer_ipc.cc} | 0 ....cc => electron_api_spell_check_client.cc} | 2 +- ...nt.h => electron_api_spell_check_client.h} | 6 +- ...web_frame.cc => electron_api_web_frame.cc} | 2 +- shell/renderer/electron_api_service_impl.cc | 4 +- ...ll_agent.cc => electron_autofill_agent.cc} | 2 +- ...fill_agent.h => electron_autofill_agent.h} | 6 +- ...r.cc => electron_render_frame_observer.cc} | 22 +- ...ver.h => electron_render_frame_observer.h} | 14 +- ..._client.cc => electron_renderer_client.cc} | 40 +- ...er_client.h => electron_renderer_client.h} | 14 +- ... => electron_sandboxed_renderer_client.cc} | 28 +- ...h => electron_sandboxed_renderer_client.h} | 14 +- shell/renderer/renderer_client_base.cc | 6 +- ....cc => electron_content_utility_client.cc} | 17 +- ...nt.h => electron_content_utility_client.h} | 14 +- 287 files changed, 1771 insertions(+), 1708 deletions(-) rename shell/app/{atom_content_client.cc => electron_content_client.cc} (91%) rename shell/app/{atom_content_client.h => electron_content_client.h} (75%) rename shell/app/{atom_library_main.h => electron_library_main.h} (54%) rename shell/app/{atom_library_main.mm => electron_library_main.mm} (74%) rename shell/app/{atom_login_helper.mm => electron_login_helper.mm} (100%) rename shell/app/{atom_main.cc => electron_main.cc} (90%) rename shell/app/{atom_main.h => electron_main.h} (62%) rename shell/app/{atom_main_delegate.cc => electron_main_delegate.cc} (84%) rename shell/app/{atom_main_delegate.h => electron_main_delegate.h} (85%) rename shell/app/{atom_main_delegate_mac.h => electron_main_delegate_mac.h} (65%) rename shell/app/{atom_main_delegate_mac.mm => electron_main_delegate_mac.mm} (90%) rename shell/browser/api/{atom_api_app.cc => electron_api_app.cc} (97%) rename shell/browser/api/{atom_api_app.h => electron_api_app.h} (97%) rename shell/browser/api/{atom_api_app_mac.mm => electron_api_app_mac.mm} (92%) rename shell/browser/api/{atom_api_app_mas.mm => electron_api_app_mas.mm} (97%) rename shell/browser/api/{atom_api_auto_updater.cc => electron_api_auto_updater.cc} (98%) rename shell/browser/api/{atom_api_auto_updater.h => electron_api_auto_updater.h} (90%) rename shell/browser/api/{atom_api_browser_view.cc => electron_api_browser_view.cc} (97%) rename shell/browser/api/{atom_api_browser_view.h => electron_api_browser_view.h} (91%) rename shell/browser/api/{atom_api_browser_window.cc => electron_api_browser_window.cc} (99%) rename shell/browser/api/{atom_api_browser_window.h => electron_api_browser_window.h} (93%) rename shell/browser/api/{atom_api_browser_window_mac.mm => electron_api_browser_window_mac.mm} (98%) rename shell/browser/api/{atom_api_browser_window_views.cc => electron_api_browser_window_views.cc} (90%) rename shell/browser/api/{atom_api_content_tracing.cc => electron_api_content_tracing.cc} (100%) rename shell/browser/api/{atom_api_cookies.cc => electron_api_cookies.cc} (97%) rename shell/browser/api/{atom_api_cookies.h => electron_api_cookies.h} (79%) rename shell/browser/api/{atom_api_data_pipe_holder.cc => electron_api_data_pipe_holder.cc} (98%) rename shell/browser/api/{atom_api_data_pipe_holder.h => electron_api_data_pipe_holder.h} (88%) rename shell/browser/api/{atom_api_debugger.cc => electron_api_debugger.cc} (99%) rename shell/browser/api/{atom_api_debugger.h => electron_api_debugger.h} (93%) rename shell/browser/api/{atom_api_desktop_capturer.cc => electron_api_desktop_capturer.cc} (98%) rename shell/browser/api/{atom_api_desktop_capturer.h => electron_api_desktop_capturer.h} (92%) rename shell/browser/api/{atom_api_dialog.cc => electron_api_dialog.cc} (100%) rename shell/browser/api/{atom_api_download_item.cc => electron_api_download_item.cc} (98%) rename shell/browser/api/{atom_api_download_item.h => electron_api_download_item.h} (92%) rename shell/browser/api/{atom_api_event.cc => electron_api_event.cc} (100%) rename shell/browser/api/{atom_api_global_shortcut.cc => electron_api_global_shortcut.cc} (97%) rename shell/browser/api/{atom_api_global_shortcut.h => electron_api_global_shortcut.h} (90%) rename shell/browser/api/{atom_api_in_app_purchase.cc => electron_api_in_app_purchase.cc} (98%) rename shell/browser/api/{atom_api_in_app_purchase.h => electron_api_in_app_purchase.h} (89%) rename shell/browser/api/{atom_api_menu.cc => electron_api_menu.cc} (98%) rename shell/browser/api/{atom_api_menu.h => electron_api_menu.h} (89%) rename shell/browser/api/{atom_api_menu_mac.h => electron_api_menu_mac.h} (73%) rename shell/browser/api/{atom_api_menu_mac.mm => electron_api_menu_mac.mm} (93%) rename shell/browser/api/{atom_api_menu_views.cc => electron_api_menu_views.cc} (98%) rename shell/browser/api/{atom_api_menu_views.h => electron_api_menu_views.h} (82%) rename shell/browser/api/{atom_api_native_theme.cc => electron_api_native_theme.cc} (98%) rename shell/browser/api/{atom_api_native_theme.h => electron_api_native_theme.h} (91%) rename shell/browser/api/{atom_api_native_theme_mac.mm => electron_api_native_theme_mac.mm} (90%) rename shell/browser/api/{atom_api_net.cc => electron_api_net.cc} (95%) rename shell/browser/api/{atom_api_net.h => electron_api_net.h} (82%) rename shell/browser/api/{atom_api_net_log.cc => electron_api_net_log.cc} (96%) rename shell/browser/api/{atom_api_net_log.h => electron_api_net_log.h} (81%) rename shell/browser/api/{atom_api_notification.cc => electron_api_notification.cc} (96%) rename shell/browser/api/{atom_api_notification.h => electron_api_notification.h} (94%) rename shell/browser/api/{atom_api_power_monitor.cc => electron_api_power_monitor.cc} (98%) rename shell/browser/api/{atom_api_power_monitor.h => electron_api_power_monitor.h} (92%) rename shell/browser/api/{atom_api_power_monitor_mac.mm => electron_api_power_monitor_mac.mm} (96%) rename shell/browser/api/{atom_api_power_monitor_win.cc => electron_api_power_monitor_win.cc} (97%) rename shell/browser/api/{atom_api_power_save_blocker.cc => electron_api_power_save_blocker.cc} (98%) rename shell/browser/api/{atom_api_power_save_blocker.h => electron_api_power_save_blocker.h} (88%) rename shell/browser/api/{atom_api_protocol.cc => electron_api_protocol.cc} (96%) rename shell/browser/api/{atom_api_protocol.h => electron_api_protocol.h} (86%) rename shell/browser/api/{atom_api_screen.cc => electron_api_screen.cc} (99%) rename shell/browser/api/{atom_api_screen.h => electron_api_screen.h} (91%) rename shell/browser/api/{atom_api_session.cc => electron_api_session.cc} (95%) rename shell/browser/api/{atom_api_session.h => electron_api_session.h} (89%) rename shell/browser/api/{atom_api_system_preferences.cc => electron_api_system_preferences.cc} (98%) rename shell/browser/api/{atom_api_system_preferences.h => electron_api_system_preferences.h} (96%) rename shell/browser/api/{atom_api_system_preferences_mac.mm => electron_api_system_preferences_mac.mm} (99%) rename shell/browser/api/{atom_api_system_preferences_win.cc => electron_api_system_preferences_win.cc} (99%) rename shell/browser/api/{atom_api_top_level_window.cc => electron_api_top_level_window.cc} (99%) rename shell/browser/api/{atom_api_top_level_window.h => electron_api_top_level_window.h} (97%) rename shell/browser/api/{atom_api_tray.cc => electron_api_tray.cc} (98%) rename shell/browser/api/{atom_api_tray.h => electron_api_tray.h} (95%) rename shell/browser/api/{atom_api_url_loader.cc => electron_api_url_loader.cc} (99%) rename shell/browser/api/{atom_api_url_loader.h => electron_api_url_loader.h} (94%) rename shell/browser/api/{atom_api_view.cc => electron_api_view.cc} (98%) rename shell/browser/api/{atom_api_view.h => electron_api_view.h} (88%) rename shell/browser/api/{atom_api_web_contents.cc => electron_api_web_contents.cc} (98%) rename shell/browser/api/{atom_api_web_contents.h => electron_api_web_contents.h} (98%) rename shell/browser/api/{atom_api_web_contents_impl.cc => electron_api_web_contents_impl.cc} (97%) rename shell/browser/api/{atom_api_web_contents_mac.mm => electron_api_web_contents_mac.mm} (93%) rename shell/browser/api/{atom_api_web_contents_view.cc => electron_api_web_contents_view.cc} (97%) rename shell/browser/api/{atom_api_web_contents_view.h => electron_api_web_contents_view.h} (82%) rename shell/browser/api/{atom_api_web_request.cc => electron_api_web_request.cc} (98%) rename shell/browser/api/{atom_api_web_request.h => electron_api_web_request.h} (97%) rename shell/browser/api/{atom_api_web_view_manager.cc => electron_api_web_view_manager.cc} (100%) rename shell/browser/api/views/{atom_api_box_layout.cc => electron_api_box_layout.cc} (95%) rename shell/browser/api/views/{atom_api_box_layout.h => electron_api_box_layout.h} (76%) rename shell/browser/api/views/{atom_api_button.cc => electron_api_button.cc} (96%) rename shell/browser/api/views/{atom_api_button.h => electron_api_button.h} (80%) rename shell/browser/api/views/{atom_api_label_button.cc => electron_api_label_button.cc} (97%) rename shell/browser/api/views/{atom_api_label_button.h => electron_api_label_button.h} (81%) rename shell/browser/api/views/{atom_api_layout_manager.cc => electron_api_layout_manager.cc} (96%) rename shell/browser/api/views/{atom_api_layout_manager.h => electron_api_layout_manager.h} (84%) rename shell/browser/api/views/{atom_api_md_text_button.cc => electron_api_md_text_button.cc} (96%) rename shell/browser/api/views/{atom_api_md_text_button.h => electron_api_md_text_button.h} (77%) rename shell/browser/api/views/{atom_api_resize_area.cc => electron_api_resize_area.cc} (96%) rename shell/browser/api/views/{atom_api_resize_area.h => electron_api_resize_area.h} (79%) rename shell/browser/api/views/{atom_api_text_field.cc => electron_api_text_field.cc} (96%) rename shell/browser/api/views/{atom_api_text_field.h => electron_api_text_field.h} (78%) delete mode 100644 shell/browser/atom_navigation_throttle.h delete mode 100644 shell/browser/atom_speech_recognition_manager_delegate.cc rename shell/browser/{atom_autofill_driver.cc => electron_autofill_driver.cc} (92%) rename shell/browser/{atom_autofill_driver.h => electron_autofill_driver.h} (84%) rename shell/browser/{atom_autofill_driver_factory.cc => electron_autofill_driver_factory.cc} (93%) rename shell/browser/{atom_autofill_driver_factory.h => electron_autofill_driver_factory.h} (87%) rename shell/browser/{atom_browser_client.cc => electron_browser_client.cc} (86%) rename shell/browser/{atom_browser_client.h => electron_browser_client.h} (96%) rename shell/browser/{atom_browser_context.cc => electron_browser_context.cc} (82%) rename shell/browser/{atom_browser_context.h => electron_browser_context.h} (84%) rename shell/browser/{atom_browser_main_parts.cc => electron_browser_main_parts.cc} (89%) rename shell/browser/{atom_browser_main_parts.h => electron_browser_main_parts.h} (88%) rename shell/browser/{atom_browser_main_parts_mac.mm => electron_browser_main_parts_mac.mm} (77%) rename shell/browser/{atom_browser_main_parts_posix.cc => electron_browser_main_parts_posix.cc} (97%) rename shell/browser/{atom_download_manager_delegate.cc => electron_download_manager_delegate.cc} (87%) rename shell/browser/{atom_download_manager_delegate.h => electron_download_manager_delegate.h} (75%) rename shell/browser/{atom_gpu_client.cc => electron_gpu_client.cc} (75%) rename shell/browser/{atom_gpu_client.h => electron_gpu_client.h} (55%) rename shell/browser/{atom_javascript_dialog_manager.cc => electron_javascript_dialog_manager.cc} (86%) rename shell/browser/{atom_javascript_dialog_manager.h => electron_javascript_dialog_manager.h} (78%) rename shell/browser/{atom_navigation_throttle.cc => electron_navigation_throttle.cc} (69%) create mode 100644 shell/browser/electron_navigation_throttle.h rename shell/browser/{atom_paths.h => electron_paths.h} (90%) rename shell/browser/{atom_permission_manager.cc => electron_permission_manager.cc} (84%) rename shell/browser/{atom_permission_manager.h => electron_permission_manager.h} (92%) rename shell/browser/{atom_quota_permission_context.cc => electron_quota_permission_context.cc} (58%) rename shell/browser/{atom_quota_permission_context.h => electron_quota_permission_context.h} (61%) create mode 100644 shell/browser/electron_speech_recognition_manager_delegate.cc rename shell/browser/{atom_speech_recognition_manager_delegate.h => electron_speech_recognition_manager_delegate.h} (79%) rename shell/browser/{atom_web_ui_controller_factory.cc => electron_web_ui_controller_factory.cc} (61%) rename shell/browser/{atom_web_ui_controller_factory.h => electron_web_ui_controller_factory.h} (64%) delete mode 100644 shell/browser/mac/atom_application_delegate.h rename shell/browser/mac/{atom_application.h => electron_application.h} (81%) rename shell/browser/mac/{atom_application.mm => electron_application.mm} (95%) create mode 100644 shell/browser/mac/electron_application_delegate.h rename shell/browser/mac/{atom_application_delegate.mm => electron_application_delegate.mm} (92%) rename shell/browser/net/{atom_url_loader_factory.cc => electron_url_loader_factory.cc} (94%) rename shell/browser/net/{atom_url_loader_factory.h => electron_url_loader_factory.h} (90%) delete mode 100644 shell/browser/ui/cocoa/atom_native_widget_mac.h rename shell/browser/ui/cocoa/{atom_bundle_mover.h => electron_bundle_mover.h} (86%) rename shell/browser/ui/cocoa/{atom_bundle_mover.mm => electron_bundle_mover.mm} (92%) rename shell/browser/ui/cocoa/{atom_inspectable_web_contents_view.h => electron_inspectable_web_contents_view.h} (94%) rename shell/browser/ui/cocoa/{atom_inspectable_web_contents_view.mm => electron_inspectable_web_contents_view.mm} (98%) rename shell/browser/ui/cocoa/{atom_menu_controller.h => electron_menu_controller.h} (77%) rename shell/browser/ui/cocoa/{atom_menu_controller.mm => electron_menu_controller.mm} (90%) create mode 100644 shell/browser/ui/cocoa/electron_native_widget_mac.h rename shell/browser/ui/cocoa/{atom_native_widget_mac.mm => electron_native_widget_mac.mm} (51%) rename shell/browser/ui/cocoa/{atom_ns_window.h => electron_ns_window.h} (85%) rename shell/browser/ui/cocoa/{atom_ns_window.mm => electron_ns_window.mm} (96%) rename shell/browser/ui/cocoa/{atom_ns_window_delegate.h => electron_ns_window_delegate.h} (70%) rename shell/browser/ui/cocoa/{atom_ns_window_delegate.mm => electron_ns_window_delegate.mm} (98%) rename shell/browser/ui/cocoa/{atom_preview_item.h => electron_preview_item.h} (60%) rename shell/browser/ui/cocoa/{atom_preview_item.mm => electron_preview_item.mm} (80%) rename shell/browser/ui/cocoa/{atom_touch_bar.h => electron_touch_bar.h} (91%) rename shell/browser/ui/cocoa/{atom_touch_bar.mm => electron_touch_bar.mm} (99%) rename shell/browser/ui/{atom_menu_model.cc => electron_menu_model.cc} (66%) rename shell/browser/ui/{atom_menu_model.h => electron_menu_model.h} (86%) rename shell/browser/ui/views/{atom_views_delegate.cc => electron_views_delegate.cc} (98%) rename shell/browser/ui/views/{atom_views_delegate.h => electron_views_delegate.h} (94%) rename shell/browser/ui/views/{atom_views_delegate_win.cc => electron_views_delegate_win.cc} (99%) rename shell/browser/ui/win/{atom_desktop_native_widget_aura.cc => electron_desktop_native_widget_aura.cc} (78%) rename shell/browser/ui/win/{atom_desktop_native_widget_aura.h => electron_desktop_native_widget_aura.h} (66%) rename shell/browser/ui/win/{atom_desktop_window_tree_host_win.cc => electron_desktop_window_tree_host_win.cc} (64%) rename shell/browser/ui/win/{atom_desktop_window_tree_host_win.h => electron_desktop_window_tree_host_win.h} (65%) rename shell/common/api/{atom_api_asar.cc => electron_api_asar.cc} (100%) rename shell/common/api/{atom_api_clipboard.cc => electron_api_clipboard.cc} (99%) rename shell/common/api/{atom_api_clipboard.h => electron_api_clipboard.h} (93%) rename shell/common/api/{atom_api_clipboard_mac.mm => electron_api_clipboard_mac.mm} (91%) rename shell/common/api/{atom_api_command_line.cc => electron_api_command_line.cc} (100%) rename shell/common/api/{atom_api_crash_reporter.cc => electron_api_crash_reporter.cc} (100%) rename shell/common/api/{atom_api_key_weak_map.h => electron_api_key_weak_map.h} (91%) rename shell/common/api/{atom_api_native_image.cc => electron_api_native_image.cc} (99%) rename shell/common/api/{atom_api_native_image.h => electron_api_native_image.h} (96%) rename shell/common/api/{atom_api_native_image_mac.mm => electron_api_native_image_mac.mm} (97%) rename shell/common/api/{atom_api_shell.cc => electron_api_shell.cc} (100%) rename shell/common/api/{atom_api_v8_util.cc => electron_api_v8_util.cc} (98%) rename shell/common/{atom_command_line.cc => electron_command_line.cc} (74%) rename shell/common/{atom_command_line.h => electron_command_line.h} (77%) rename shell/common/{atom_constants.cc => electron_constants.cc} (97%) rename shell/common/{atom_constants.h => electron_constants.h} (91%) rename shell/renderer/api/{atom_api_context_bridge.cc => electron_api_context_bridge.cc} (99%) rename shell/renderer/api/{atom_api_context_bridge.h => electron_api_context_bridge.h} (81%) rename shell/renderer/api/{atom_api_renderer_ipc.cc => electron_api_renderer_ipc.cc} (100%) rename shell/renderer/api/{atom_api_spell_check_client.cc => electron_api_spell_check_client.cc} (99%) rename shell/renderer/api/{atom_api_spell_check_client.h => electron_api_spell_check_client.h} (95%) rename shell/renderer/api/{atom_api_web_frame.cc => electron_api_web_frame.cc} (99%) rename shell/renderer/{atom_autofill_agent.cc => electron_autofill_agent.cc} (99%) rename shell/renderer/{atom_autofill_agent.h => electron_autofill_agent.h} (95%) rename shell/renderer/{atom_render_frame_observer.cc => electron_render_frame_observer.cc} (89%) rename shell/renderer/{atom_render_frame_observer.h => electron_render_frame_observer.h} (81%) rename shell/renderer/{atom_renderer_client.cc => electron_renderer_client.cc} (88%) rename shell/renderer/{atom_renderer_client.h => electron_renderer_client.h} (88%) rename shell/renderer/{atom_sandboxed_renderer_client.cc => electron_sandboxed_renderer_client.cc} (91%) rename shell/renderer/{atom_sandboxed_renderer_client.h => electron_sandboxed_renderer_client.h} (82%) rename shell/utility/{atom_content_utility_client.cc => electron_content_utility_client.cc} (87%) rename shell/utility/{atom_content_utility_client.h => electron_content_utility_client.h} (73%) diff --git a/BUILD.gn b/BUILD.gn index 0fa3e0bf222..f4ff7d3d489 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -136,7 +136,7 @@ webpack_build("electron_content_script_bundle") { out_file = "$target_gen_dir/js2c/content_script_bundle.js" } -copy("atom_js2c_copy") { +copy("electron_js2c_copy") { sources = [ "lib/common/asar.js", "lib/common/asar_init.js", @@ -144,12 +144,12 @@ copy("atom_js2c_copy") { outputs = [ "$target_gen_dir/js2c/{{source_file_part}}" ] } -action("atom_js2c") { +action("electron_js2c") { deps = [ - ":atom_js2c_copy", ":electron_browser_bundle", ":electron_content_script_bundle", ":electron_isolated_renderer_bundle", + ":electron_js2c_copy", ":electron_renderer_bundle", ":electron_sandboxed_renderer_bundle", ":electron_worker_bundle", @@ -170,7 +170,7 @@ action("atom_js2c") { ] inputs = sources + [ "//third_party/electron_node/tools/js2c.py" ] - outputs = [ "$root_gen_dir/atom_natives.cc" ] + outputs = [ "$root_gen_dir/electron_natives.cc" ] script = "tools/js2c.py" args = [ rebase_path("//third_party/electron_node") ] + @@ -312,7 +312,7 @@ source_set("electron_lib") { ] deps = [ - ":atom_js2c", + ":electron_js2c", ":electron_version_header", ":manifests", ":resources", @@ -468,7 +468,7 @@ source_set("electron_lib") { "shell/browser/ui/views/autofill_popup_view.h", ] if (is_mas_build) { - sources += [ "shell/browser/api/atom_api_app_mas.mm" ] + sources += [ "shell/browser/api/electron_api_app_mas.mm" ] sources -= [ "shell/browser/auto_updater_mac.mm", "shell/common/crash_reporter/crash_reporter_mac.h", @@ -595,27 +595,27 @@ source_set("electron_lib") { deps += [ "//third_party/webrtc/modules/desktop_capture" ] } sources += [ - "shell/browser/api/atom_api_desktop_capturer.cc", - "shell/browser/api/atom_api_desktop_capturer.h", + "shell/browser/api/electron_api_desktop_capturer.cc", + "shell/browser/api/electron_api_desktop_capturer.h", ] } if (enable_view_api) { sources += [ - "shell/browser/api/views/atom_api_box_layout.cc", - "shell/browser/api/views/atom_api_box_layout.h", - "shell/browser/api/views/atom_api_button.cc", - "shell/browser/api/views/atom_api_button.h", - "shell/browser/api/views/atom_api_label_button.cc", - "shell/browser/api/views/atom_api_label_button.h", - "shell/browser/api/views/atom_api_layout_manager.cc", - "shell/browser/api/views/atom_api_layout_manager.h", - "shell/browser/api/views/atom_api_md_text_button.cc", - "shell/browser/api/views/atom_api_md_text_button.h", - "shell/browser/api/views/atom_api_resize_area.cc", - "shell/browser/api/views/atom_api_resize_area.h", - "shell/browser/api/views/atom_api_text_field.cc", - "shell/browser/api/views/atom_api_text_field.h", + "shell/browser/api/views/electron_api_box_layout.cc", + "shell/browser/api/views/electron_api_box_layout.h", + "shell/browser/api/views/electron_api_button.cc", + "shell/browser/api/views/electron_api_button.h", + "shell/browser/api/views/electron_api_label_button.cc", + "shell/browser/api/views/electron_api_label_button.h", + "shell/browser/api/views/electron_api_layout_manager.cc", + "shell/browser/api/views/electron_api_layout_manager.h", + "shell/browser/api/views/electron_api_md_text_button.cc", + "shell/browser/api/views/electron_api_md_text_button.h", + "shell/browser/api/views/electron_api_resize_area.cc", + "shell/browser/api/views/electron_api_resize_area.h", + "shell/browser/api/views/electron_api_text_field.cc", + "shell/browser/api/views/electron_api_text_field.h", ] } @@ -816,7 +816,7 @@ if (is_mac) { } defines = [ "HELPER_EXECUTABLE" ] sources = filenames.app_sources - sources += [ "shell/common/atom_constants.cc" ] + sources += [ "shell/common/electron_constants.cc" ] include_dirs = [ "." ] info_plist = "shell/renderer/resources/mac/Info.plist" extra_substitutions = @@ -918,7 +918,7 @@ if (is_mac) { mac_app_bundle("electron_app") { output_name = electron_product_name sources = filenames.app_sources - sources += [ "shell/common/atom_constants.cc" ] + sources += [ "shell/common/electron_constants.cc" ] include_dirs = [ "." ] deps = [ ":electron_app_framework_bundle_data", diff --git a/chromium_src/chrome/browser/process_singleton_posix.cc b/chromium_src/chrome/browser/process_singleton_posix.cc index 9df2c7a4e6c..c2181827552 100644 --- a/chromium_src/chrome/browser/process_singleton_posix.cc +++ b/chromium_src/chrome/browser/process_singleton_posix.cc @@ -56,7 +56,7 @@ #include #include "shell/browser/browser.h" -#include "shell/common/atom_command_line.h" +#include "shell/common/electron_command_line.h" #include "base/base_paths.h" #include "base/bind.h" @@ -826,7 +826,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( return PROCESS_NONE; to_send.append(current_dir.value()); - const std::vector& argv = electron::AtomCommandLine::argv(); + const std::vector& argv = electron::ElectronCommandLine::argv(); for (std::vector::const_iterator it = argv.begin(); it != argv.end(); ++it) { to_send.push_back(kTokenDelimiter); diff --git a/filenames.gni b/filenames.gni index b7a54b23f68..a71d5efee80 100644 --- a/filenames.gni +++ b/filenames.gni @@ -27,90 +27,90 @@ filenames = { "chromium_src/chrome/browser/process_singleton_win.cc", "chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc", "chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h", - "shell/app/atom_content_client.cc", - "shell/app/atom_content_client.h", - "shell/app/atom_main_delegate.cc", - "shell/app/atom_main_delegate.h", - "shell/app/atom_main_delegate_mac.h", - "shell/app/atom_main_delegate_mac.mm", "shell/app/command_line_args.cc", "shell/app/command_line_args.h", + "shell/app/electron_content_client.cc", + "shell/app/electron_content_client.h", + "shell/app/electron_main_delegate.cc", + "shell/app/electron_main_delegate.h", + "shell/app/electron_main_delegate_mac.h", + "shell/app/electron_main_delegate_mac.mm", "shell/app/uv_task_runner.cc", "shell/app/uv_task_runner.h", - "shell/browser/api/atom_api_app.cc", - "shell/browser/api/atom_api_app.h", - "shell/browser/api/atom_api_app_mac.mm", - "shell/browser/api/atom_api_auto_updater.cc", - "shell/browser/api/atom_api_auto_updater.h", - "shell/browser/api/atom_api_browser_view.cc", - "shell/browser/api/atom_api_browser_view.h", - "shell/browser/api/atom_api_browser_window.cc", - "shell/browser/api/atom_api_browser_window.h", - "shell/browser/api/atom_api_browser_window_mac.mm", - "shell/browser/api/atom_api_browser_window_views.cc", - "shell/browser/api/atom_api_content_tracing.cc", - "shell/browser/api/atom_api_cookies.cc", - "shell/browser/api/atom_api_cookies.h", - "shell/browser/api/atom_api_data_pipe_holder.cc", - "shell/browser/api/atom_api_data_pipe_holder.h", - "shell/browser/api/atom_api_debugger.cc", - "shell/browser/api/atom_api_debugger.h", - "shell/browser/api/atom_api_dialog.cc", - "shell/browser/api/atom_api_download_item.cc", - "shell/browser/api/atom_api_download_item.h", - "shell/browser/api/atom_api_event.cc", - "shell/browser/api/atom_api_global_shortcut.cc", - "shell/browser/api/atom_api_global_shortcut.h", - "shell/browser/api/atom_api_in_app_purchase.cc", - "shell/browser/api/atom_api_in_app_purchase.h", - "shell/browser/api/atom_api_menu.cc", - "shell/browser/api/atom_api_menu.h", - "shell/browser/api/atom_api_menu_mac.h", - "shell/browser/api/atom_api_menu_mac.mm", - "shell/browser/api/atom_api_menu_views.cc", - "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.h", - "shell/browser/api/atom_api_net_log.cc", - "shell/browser/api/atom_api_net_log.h", - "shell/browser/api/atom_api_notification.cc", - "shell/browser/api/atom_api_notification.h", - "shell/browser/api/atom_api_power_monitor.cc", - "shell/browser/api/atom_api_power_monitor.h", - "shell/browser/api/atom_api_power_monitor_mac.mm", - "shell/browser/api/atom_api_power_monitor_win.cc", - "shell/browser/api/atom_api_power_save_blocker.cc", - "shell/browser/api/atom_api_power_save_blocker.h", - "shell/browser/api/atom_api_protocol.cc", - "shell/browser/api/atom_api_protocol.h", - "shell/browser/api/atom_api_screen.cc", - "shell/browser/api/atom_api_screen.h", - "shell/browser/api/atom_api_session.cc", - "shell/browser/api/atom_api_session.h", - "shell/browser/api/atom_api_system_preferences.cc", - "shell/browser/api/atom_api_system_preferences.h", - "shell/browser/api/atom_api_system_preferences_mac.mm", - "shell/browser/api/atom_api_system_preferences_win.cc", - "shell/browser/api/atom_api_top_level_window.cc", - "shell/browser/api/atom_api_top_level_window.h", - "shell/browser/api/atom_api_tray.cc", - "shell/browser/api/atom_api_tray.h", - "shell/browser/api/atom_api_url_loader.cc", - "shell/browser/api/atom_api_url_loader.h", - "shell/browser/api/atom_api_view.cc", - "shell/browser/api/atom_api_view.h", - "shell/browser/api/atom_api_web_contents.cc", - "shell/browser/api/atom_api_web_contents.h", - "shell/browser/api/atom_api_web_contents_impl.cc", - "shell/browser/api/atom_api_web_contents_mac.mm", - "shell/browser/api/atom_api_web_contents_view.cc", - "shell/browser/api/atom_api_web_contents_view.h", - "shell/browser/api/atom_api_web_request.cc", - "shell/browser/api/atom_api_web_request.h", - "shell/browser/api/atom_api_web_view_manager.cc", + "shell/browser/api/electron_api_app.cc", + "shell/browser/api/electron_api_app.h", + "shell/browser/api/electron_api_app_mac.mm", + "shell/browser/api/electron_api_auto_updater.cc", + "shell/browser/api/electron_api_auto_updater.h", + "shell/browser/api/electron_api_browser_view.cc", + "shell/browser/api/electron_api_browser_view.h", + "shell/browser/api/electron_api_browser_window.cc", + "shell/browser/api/electron_api_browser_window.h", + "shell/browser/api/electron_api_browser_window_mac.mm", + "shell/browser/api/electron_api_browser_window_views.cc", + "shell/browser/api/electron_api_content_tracing.cc", + "shell/browser/api/electron_api_cookies.cc", + "shell/browser/api/electron_api_cookies.h", + "shell/browser/api/electron_api_data_pipe_holder.cc", + "shell/browser/api/electron_api_data_pipe_holder.h", + "shell/browser/api/electron_api_debugger.cc", + "shell/browser/api/electron_api_debugger.h", + "shell/browser/api/electron_api_dialog.cc", + "shell/browser/api/electron_api_download_item.cc", + "shell/browser/api/electron_api_download_item.h", + "shell/browser/api/electron_api_event.cc", + "shell/browser/api/electron_api_global_shortcut.cc", + "shell/browser/api/electron_api_global_shortcut.h", + "shell/browser/api/electron_api_in_app_purchase.cc", + "shell/browser/api/electron_api_in_app_purchase.h", + "shell/browser/api/electron_api_menu.cc", + "shell/browser/api/electron_api_menu.h", + "shell/browser/api/electron_api_menu_mac.h", + "shell/browser/api/electron_api_menu_mac.mm", + "shell/browser/api/electron_api_menu_views.cc", + "shell/browser/api/electron_api_menu_views.h", + "shell/browser/api/electron_api_native_theme.cc", + "shell/browser/api/electron_api_native_theme.h", + "shell/browser/api/electron_api_native_theme_mac.mm", + "shell/browser/api/electron_api_net.cc", + "shell/browser/api/electron_api_net.h", + "shell/browser/api/electron_api_net_log.cc", + "shell/browser/api/electron_api_net_log.h", + "shell/browser/api/electron_api_notification.cc", + "shell/browser/api/electron_api_notification.h", + "shell/browser/api/electron_api_power_monitor.cc", + "shell/browser/api/electron_api_power_monitor.h", + "shell/browser/api/electron_api_power_monitor_mac.mm", + "shell/browser/api/electron_api_power_monitor_win.cc", + "shell/browser/api/electron_api_power_save_blocker.cc", + "shell/browser/api/electron_api_power_save_blocker.h", + "shell/browser/api/electron_api_protocol.cc", + "shell/browser/api/electron_api_protocol.h", + "shell/browser/api/electron_api_screen.cc", + "shell/browser/api/electron_api_screen.h", + "shell/browser/api/electron_api_session.cc", + "shell/browser/api/electron_api_session.h", + "shell/browser/api/electron_api_system_preferences.cc", + "shell/browser/api/electron_api_system_preferences.h", + "shell/browser/api/electron_api_system_preferences_mac.mm", + "shell/browser/api/electron_api_system_preferences_win.cc", + "shell/browser/api/electron_api_top_level_window.cc", + "shell/browser/api/electron_api_top_level_window.h", + "shell/browser/api/electron_api_tray.cc", + "shell/browser/api/electron_api_tray.h", + "shell/browser/api/electron_api_url_loader.cc", + "shell/browser/api/electron_api_url_loader.h", + "shell/browser/api/electron_api_view.cc", + "shell/browser/api/electron_api_view.h", + "shell/browser/api/electron_api_web_contents.cc", + "shell/browser/api/electron_api_web_contents.h", + "shell/browser/api/electron_api_web_contents_impl.cc", + "shell/browser/api/electron_api_web_contents_mac.mm", + "shell/browser/api/electron_api_web_contents_view.cc", + "shell/browser/api/electron_api_web_contents_view.h", + "shell/browser/api/electron_api_web_request.cc", + "shell/browser/api/electron_api_web_request.h", + "shell/browser/api/electron_api_web_view_manager.cc", "shell/browser/api/event.cc", "shell/browser/api/event.h", "shell/browser/api/frame_subscriber.cc", @@ -123,35 +123,6 @@ filenames = { "shell/browser/api/process_metric.h", "shell/browser/api/save_page_handler.cc", "shell/browser/api/save_page_handler.h", - "shell/browser/atom_autofill_driver.cc", - "shell/browser/atom_autofill_driver.h", - "shell/browser/atom_autofill_driver_factory.cc", - "shell/browser/atom_autofill_driver_factory.h", - "shell/browser/atom_browser_client.cc", - "shell/browser/atom_browser_client.h", - "shell/browser/atom_browser_context.cc", - "shell/browser/atom_browser_context.h", - "shell/browser/atom_browser_main_parts.cc", - "shell/browser/atom_browser_main_parts.h", - "shell/browser/atom_browser_main_parts_mac.mm", - "shell/browser/atom_browser_main_parts_posix.cc", - "shell/browser/atom_download_manager_delegate.cc", - "shell/browser/atom_download_manager_delegate.h", - "shell/browser/atom_gpu_client.cc", - "shell/browser/atom_gpu_client.h", - "shell/browser/atom_javascript_dialog_manager.cc", - "shell/browser/atom_javascript_dialog_manager.h", - "shell/browser/atom_navigation_throttle.cc", - "shell/browser/atom_navigation_throttle.h", - "shell/browser/atom_paths.h", - "shell/browser/atom_permission_manager.cc", - "shell/browser/atom_permission_manager.h", - "shell/browser/atom_quota_permission_context.cc", - "shell/browser/atom_quota_permission_context.h", - "shell/browser/atom_speech_recognition_manager_delegate.cc", - "shell/browser/atom_speech_recognition_manager_delegate.h", - "shell/browser/atom_web_ui_controller_factory.cc", - "shell/browser/atom_web_ui_controller_factory.h", "shell/browser/auto_updater.cc", "shell/browser/auto_updater.h", "shell/browser/auto_updater_mac.mm", @@ -171,6 +142,35 @@ filenames = { "shell/browser/common_web_contents_delegate_views.cc", "shell/browser/cookie_change_notifier.cc", "shell/browser/cookie_change_notifier.h", + "shell/browser/electron_autofill_driver.cc", + "shell/browser/electron_autofill_driver.h", + "shell/browser/electron_autofill_driver_factory.cc", + "shell/browser/electron_autofill_driver_factory.h", + "shell/browser/electron_browser_client.cc", + "shell/browser/electron_browser_client.h", + "shell/browser/electron_browser_context.cc", + "shell/browser/electron_browser_context.h", + "shell/browser/electron_browser_main_parts.cc", + "shell/browser/electron_browser_main_parts.h", + "shell/browser/electron_browser_main_parts_mac.mm", + "shell/browser/electron_browser_main_parts_posix.cc", + "shell/browser/electron_download_manager_delegate.cc", + "shell/browser/electron_download_manager_delegate.h", + "shell/browser/electron_gpu_client.cc", + "shell/browser/electron_gpu_client.h", + "shell/browser/electron_javascript_dialog_manager.cc", + "shell/browser/electron_javascript_dialog_manager.h", + "shell/browser/electron_navigation_throttle.cc", + "shell/browser/electron_navigation_throttle.h", + "shell/browser/electron_paths.h", + "shell/browser/electron_permission_manager.cc", + "shell/browser/electron_permission_manager.h", + "shell/browser/electron_quota_permission_context.cc", + "shell/browser/electron_quota_permission_context.h", + "shell/browser/electron_speech_recognition_manager_delegate.cc", + "shell/browser/electron_speech_recognition_manager_delegate.h", + "shell/browser/electron_web_ui_controller_factory.cc", + "shell/browser/electron_web_ui_controller_factory.h", "shell/browser/feature_list.cc", "shell/browser/feature_list.h", "shell/browser/font_defaults.cc", @@ -186,12 +186,12 @@ filenames = { "shell/browser/linux/unity_service.h", "shell/browser/login_handler.cc", "shell/browser/login_handler.h", - "shell/browser/mac/atom_application.h", - "shell/browser/mac/atom_application.mm", - "shell/browser/mac/atom_application_delegate.h", - "shell/browser/mac/atom_application_delegate.mm", "shell/browser/mac/dict_util.h", "shell/browser/mac/dict_util.mm", + "shell/browser/mac/electron_application.h", + "shell/browser/mac/electron_application.mm", + "shell/browser/mac/electron_application_delegate.h", + "shell/browser/mac/electron_application_delegate.mm", "shell/browser/mac/in_app_purchase.h", "shell/browser/mac/in_app_purchase.mm", "shell/browser/mac/in_app_purchase_observer.h", @@ -222,10 +222,10 @@ filenames = { "shell/browser/native_window_views_win.cc", "shell/browser/net/asar/asar_url_loader.cc", "shell/browser/net/asar/asar_url_loader.h", - "shell/browser/net/atom_url_loader_factory.cc", - "shell/browser/net/atom_url_loader_factory.h", "shell/browser/net/cert_verifier_client.cc", "shell/browser/net/cert_verifier_client.h", + "shell/browser/net/electron_url_loader_factory.cc", + "shell/browser/net/electron_url_loader_factory.h", "shell/browser/net/network_context_service.cc", "shell/browser/net/network_context_service.h", "shell/browser/net/network_context_service_factory.cc", @@ -289,8 +289,6 @@ filenames = { "shell/browser/special_storage_policy.h", "shell/browser/ui/accelerator_util.cc", "shell/browser/ui/accelerator_util.h", - "shell/browser/ui/atom_menu_model.cc", - "shell/browser/ui/atom_menu_model.h", "shell/browser/ui/autofill_popup.cc", "shell/browser/ui/autofill_popup.h", "shell/browser/ui/certificate_trust.h", @@ -300,24 +298,24 @@ filenames = { "shell/browser/ui/cocoa/NSColor+Hex.mm", "shell/browser/ui/cocoa/NSString+ANSI.h", "shell/browser/ui/cocoa/NSString+ANSI.mm", - "shell/browser/ui/cocoa/atom_bundle_mover.h", - "shell/browser/ui/cocoa/atom_bundle_mover.mm", - "shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h", - "shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm", - "shell/browser/ui/cocoa/atom_menu_controller.h", - "shell/browser/ui/cocoa/atom_menu_controller.mm", - "shell/browser/ui/cocoa/atom_native_widget_mac.h", - "shell/browser/ui/cocoa/atom_native_widget_mac.mm", - "shell/browser/ui/cocoa/atom_ns_window.h", - "shell/browser/ui/cocoa/atom_ns_window.mm", - "shell/browser/ui/cocoa/atom_ns_window_delegate.h", - "shell/browser/ui/cocoa/atom_ns_window_delegate.mm", - "shell/browser/ui/cocoa/atom_preview_item.h", - "shell/browser/ui/cocoa/atom_preview_item.mm", - "shell/browser/ui/cocoa/atom_touch_bar.h", - "shell/browser/ui/cocoa/atom_touch_bar.mm", "shell/browser/ui/cocoa/delayed_native_view_host.cc", "shell/browser/ui/cocoa/delayed_native_view_host.h", + "shell/browser/ui/cocoa/electron_bundle_mover.h", + "shell/browser/ui/cocoa/electron_bundle_mover.mm", + "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h", + "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm", + "shell/browser/ui/cocoa/electron_menu_controller.h", + "shell/browser/ui/cocoa/electron_menu_controller.mm", + "shell/browser/ui/cocoa/electron_native_widget_mac.h", + "shell/browser/ui/cocoa/electron_native_widget_mac.mm", + "shell/browser/ui/cocoa/electron_ns_window.h", + "shell/browser/ui/cocoa/electron_ns_window.mm", + "shell/browser/ui/cocoa/electron_ns_window_delegate.h", + "shell/browser/ui/cocoa/electron_ns_window_delegate.mm", + "shell/browser/ui/cocoa/electron_preview_item.h", + "shell/browser/ui/cocoa/electron_preview_item.mm", + "shell/browser/ui/cocoa/electron_touch_bar.h", + "shell/browser/ui/cocoa/electron_touch_bar.mm", "shell/browser/ui/cocoa/event_dispatching_window.h", "shell/browser/ui/cocoa/event_dispatching_window.mm", "shell/browser/ui/cocoa/root_view_mac.h", @@ -331,6 +329,8 @@ filenames = { "shell/browser/ui/drag_util.h", "shell/browser/ui/drag_util_mac.mm", "shell/browser/ui/drag_util_views.cc", + "shell/browser/ui/electron_menu_model.cc", + "shell/browser/ui/electron_menu_model.h", "shell/browser/ui/file_dialog.h", "shell/browser/ui/file_dialog_gtk.cc", "shell/browser/ui/file_dialog_mac.mm", @@ -357,11 +357,11 @@ filenames = { "shell/browser/ui/tray_icon_gtk.h", "shell/browser/ui/tray_icon_observer.h", "shell/browser/ui/tray_icon_win.cc", - "shell/browser/ui/views/atom_views_delegate.cc", - "shell/browser/ui/views/atom_views_delegate.h", - "shell/browser/ui/views/atom_views_delegate_win.cc", "shell/browser/ui/views/autofill_popup_view.cc", "shell/browser/ui/views/autofill_popup_view.h", + "shell/browser/ui/views/electron_views_delegate.cc", + "shell/browser/ui/views/electron_views_delegate.h", + "shell/browser/ui/views/electron_views_delegate_win.cc", "shell/browser/ui/views/frameless_view.cc", "shell/browser/ui/views/frameless_view.h", "shell/browser/ui/views/global_menu_bar_x11.cc", @@ -382,10 +382,10 @@ filenames = { "shell/browser/ui/views/submenu_button.h", "shell/browser/ui/views/win_frame_view.cc", "shell/browser/ui/views/win_frame_view.h", - "shell/browser/ui/win/atom_desktop_native_widget_aura.cc", - "shell/browser/ui/win/atom_desktop_native_widget_aura.h", - "shell/browser/ui/win/atom_desktop_window_tree_host_win.cc", - "shell/browser/ui/win/atom_desktop_window_tree_host_win.h", + "shell/browser/ui/win/electron_desktop_native_widget_aura.cc", + "shell/browser/ui/win/electron_desktop_native_widget_aura.h", + "shell/browser/ui/win/electron_desktop_window_tree_host_win.cc", + "shell/browser/ui/win/electron_desktop_window_tree_host_win.h", "shell/browser/ui/win/jump_list.cc", "shell/browser/ui/win/jump_list.h", "shell/browser/ui/win/notify_icon.cc", @@ -421,18 +421,18 @@ filenames = { "shell/browser/window_list_observer.h", "shell/browser/zoom_level_delegate.cc", "shell/browser/zoom_level_delegate.h", - "shell/common/api/atom_api_asar.cc", - "shell/common/api/atom_api_clipboard.cc", - "shell/common/api/atom_api_clipboard.h", - "shell/common/api/atom_api_clipboard_mac.mm", - "shell/common/api/atom_api_command_line.cc", - "shell/common/api/atom_api_crash_reporter.cc", - "shell/common/api/atom_api_key_weak_map.h", - "shell/common/api/atom_api_native_image.cc", - "shell/common/api/atom_api_native_image.h", - "shell/common/api/atom_api_native_image_mac.mm", - "shell/common/api/atom_api_shell.cc", - "shell/common/api/atom_api_v8_util.cc", + "shell/common/api/electron_api_asar.cc", + "shell/common/api/electron_api_clipboard.cc", + "shell/common/api/electron_api_clipboard.h", + "shell/common/api/electron_api_clipboard_mac.mm", + "shell/common/api/electron_api_command_line.cc", + "shell/common/api/electron_api_crash_reporter.cc", + "shell/common/api/electron_api_key_weak_map.h", + "shell/common/api/electron_api_native_image.cc", + "shell/common/api/electron_api_native_image.h", + "shell/common/api/electron_api_native_image_mac.mm", + "shell/common/api/electron_api_shell.cc", + "shell/common/api/electron_api_v8_util.cc", "shell/common/api/electron_bindings.cc", "shell/common/api/electron_bindings.h", "shell/common/api/features.cc", @@ -447,10 +447,6 @@ filenames = { "shell/common/asar/asar_util.h", "shell/common/asar/scoped_temporary_file.cc", "shell/common/asar/scoped_temporary_file.h", - "shell/common/atom_command_line.cc", - "shell/common/atom_command_line.h", - "shell/common/atom_constants.cc", - "shell/common/atom_constants.h", "shell/common/color_util.cc", "shell/common/color_util.h", "shell/common/crash_reporter/crash_reporter.cc", @@ -465,6 +461,10 @@ filenames = { "shell/common/crash_reporter/linux/crash_dump_handler.h", "shell/common/crash_reporter/win/crash_service_main.cc", "shell/common/crash_reporter/win/crash_service_main.h", + "shell/common/electron_command_line.cc", + "shell/common/electron_command_line.h", + "shell/common/electron_constants.cc", + "shell/common/electron_constants.h", "shell/common/gin_converters/accelerator_converter.cc", "shell/common/gin_converters/accelerator_converter.h", "shell/common/gin_converters/blink_converter.cc", @@ -551,38 +551,38 @@ filenames = { "shell/common/skia_util.h", "shell/common/v8_value_converter.cc", "shell/common/v8_value_converter.h", - "shell/renderer/api/atom_api_context_bridge.cc", - "shell/renderer/api/atom_api_context_bridge.h", - "shell/renderer/api/atom_api_renderer_ipc.cc", - "shell/renderer/api/atom_api_spell_check_client.cc", - "shell/renderer/api/atom_api_spell_check_client.h", - "shell/renderer/api/atom_api_web_frame.cc", "shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc", "shell/renderer/api/context_bridge/render_frame_context_bridge_store.h", - "shell/renderer/atom_autofill_agent.cc", - "shell/renderer/atom_autofill_agent.h", - "shell/renderer/atom_render_frame_observer.cc", - "shell/renderer/atom_render_frame_observer.h", - "shell/renderer/atom_renderer_client.cc", - "shell/renderer/atom_renderer_client.h", - "shell/renderer/atom_sandboxed_renderer_client.cc", - "shell/renderer/atom_sandboxed_renderer_client.h", + "shell/renderer/api/electron_api_context_bridge.cc", + "shell/renderer/api/electron_api_context_bridge.h", + "shell/renderer/api/electron_api_renderer_ipc.cc", + "shell/renderer/api/electron_api_spell_check_client.cc", + "shell/renderer/api/electron_api_spell_check_client.h", + "shell/renderer/api/electron_api_web_frame.cc", "shell/renderer/browser_exposed_renderer_interfaces.cc", "shell/renderer/browser_exposed_renderer_interfaces.h", "shell/renderer/content_settings_observer.cc", "shell/renderer/content_settings_observer.h", "shell/renderer/electron_api_service_impl.cc", "shell/renderer/electron_api_service_impl.h", + "shell/renderer/electron_autofill_agent.cc", + "shell/renderer/electron_autofill_agent.h", + "shell/renderer/electron_render_frame_observer.cc", + "shell/renderer/electron_render_frame_observer.h", + "shell/renderer/electron_renderer_client.cc", + "shell/renderer/electron_renderer_client.h", "shell/renderer/electron_renderer_pepper_host_factory.cc", "shell/renderer/electron_renderer_pepper_host_factory.h", + "shell/renderer/electron_sandboxed_renderer_client.cc", + "shell/renderer/electron_sandboxed_renderer_client.h", "shell/renderer/guest_view_container.cc", "shell/renderer/guest_view_container.h", "shell/renderer/renderer_client_base.cc", "shell/renderer/renderer_client_base.h", "shell/renderer/web_worker_observer.cc", "shell/renderer/web_worker_observer.h", - "shell/utility/atom_content_utility_client.cc", - "shell/utility/atom_content_utility_client.h", + "shell/utility/electron_content_utility_client.cc", + "shell/utility/electron_content_utility_client.h", ] lib_sources_nss = [ @@ -632,14 +632,14 @@ filenames = { ] app_sources = [ - "shell/app/atom_main.cc", - "shell/app/atom_main.h", + "shell/app/electron_main.cc", + "shell/app/electron_main.h", ] framework_sources = [ - "shell/app/atom_library_main.h", - "shell/app/atom_library_main.mm", + "shell/app/electron_library_main.h", + "shell/app/electron_library_main.mm", ] - login_helper_sources = [ "shell/app/atom_login_helper.mm" ] + login_helper_sources = [ "shell/app/electron_login_helper.mm" ] } diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 7ae0cbe1520..2565f04f687 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -7,7 +7,7 @@ This adds GN build files for Node, so we don't have to build with GYP. diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 -index 0000000000000000000000000000000000000000..5bc9ff072414a4c3bae896a08b9771984944f087 +index 0000000000000000000000000000000000000000..ec06e14dd327cdf89dc6fd584b6972ae64311ea0 --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,370 @@ @@ -228,7 +228,7 @@ index 0000000000000000000000000000000000000000..5bc9ff072414a4c3bae896a08b977198 + ] + public_deps = [ + "deps/uv", -+ "//electron:atom_js2c", ++ "//electron:electron_js2c", + "//v8", + ] + configs += [ ":node_internal_config" ] @@ -253,7 +253,7 @@ index 0000000000000000000000000000000000000000..5bc9ff072414a4c3bae896a08b977198 + + sources = node_files.node_sources + sources += [ -+ "$root_gen_dir/atom_natives.cc", ++ "$root_gen_dir/electron_natives.cc", + "$target_gen_dir/node_javascript.cc", + "src/node_code_cache_stub.cc", + "src/node_snapshot_stub.cc", diff --git a/script/lint.js b/script/lint.js index 81d5928408d..456666f7618 100755 --- a/script/lint.js +++ b/script/lint.js @@ -53,10 +53,14 @@ function cpplint (args) { } } +function isObjCHeader (filename) { + return /\/(mac|cocoa)\//.test(filename) +} + const LINTERS = [ { key: 'c++', roots: ['shell'], - test: filename => filename.endsWith('.cc') || filename.endsWith('.h'), + test: filename => filename.endsWith('.cc') || (filename.endsWith('.h') && !isObjCHeader(filename)), run: (opts, filenames) => { if (opts.fix) { spawnAndCheckExitCode('python', ['script/run-clang-format.py', '--fix', ...filenames]) diff --git a/shell/app/atom_content_client.cc b/shell/app/electron_content_client.cc similarity index 91% rename from shell/app/atom_content_client.cc rename to shell/app/electron_content_client.cc index c904651b034..a3938c36a27 100644 --- a/shell/app/atom_content_client.cc +++ b/shell/app/electron_content_client.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/app/atom_content_client.h" +#include "shell/app/electron_content_client.h" #include #include @@ -18,7 +18,7 @@ #include "electron/buildflags/buildflags.h" #include "extensions/common/constants.h" #include "ppapi/buildflags/buildflags.h" -#include "shell/browser/atom_paths.h" +#include "shell/browser/electron_paths.h" #include "shell/common/options_switches.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -33,10 +33,10 @@ #endif // defined(WIDEVINE_CDM_AVAILABLE) #if BUILDFLAG(ENABLE_PDF_VIEWER) -#include "pdf/pdf.h" // nogncheck -#include "pdf/pdf_ppapi.h" // nogncheck -#include "shell/common/atom_constants.h" // nogncheck -#endif // BUILDFLAG(ENABLE_PDF_VIEWER) +#include "pdf/pdf.h" // nogncheck +#include "pdf/pdf_ppapi.h" // nogncheck +#include "shell/common/electron_constants.h" // nogncheck +#endif // BUILDFLAG(ENABLE_PDF_VIEWER) #if BUILDFLAG(ENABLE_PLUGINS) #include "content/public/common/pepper_plugin_info.h" @@ -187,33 +187,33 @@ void AppendDelimitedSwitchToVector(const base::StringPiece cmd_switch, } // namespace -AtomContentClient::AtomContentClient() = default; +ElectronContentClient::ElectronContentClient() = default; -AtomContentClient::~AtomContentClient() = default; +ElectronContentClient::~ElectronContentClient() = default; -base::string16 AtomContentClient::GetLocalizedString(int message_id) { +base::string16 ElectronContentClient::GetLocalizedString(int message_id) { return l10n_util::GetStringUTF16(message_id); } -base::StringPiece AtomContentClient::GetDataResource( +base::StringPiece ElectronContentClient::GetDataResource( int resource_id, ui::ScaleFactor scale_factor) { return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( resource_id, scale_factor); } -gfx::Image& AtomContentClient::GetNativeImageNamed(int resource_id) { +gfx::Image& ElectronContentClient::GetNativeImageNamed(int resource_id) { return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( resource_id); } -base::RefCountedMemory* AtomContentClient::GetDataResourceBytes( +base::RefCountedMemory* ElectronContentClient::GetDataResourceBytes( int resource_id) { return ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( resource_id); } -void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) { +void ElectronContentClient::AddAdditionalSchemes(Schemes* schemes) { AppendDelimitedSwitchToVector(switches::kServiceWorkerSchemes, &schemes->service_worker_schemes); AppendDelimitedSwitchToVector(switches::kStandardSchemes, @@ -229,7 +229,7 @@ void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) { schemes->standard_schemes.emplace_back(extensions::kExtensionScheme); } -void AtomContentClient::AddPepperPlugins( +void ElectronContentClient::AddPepperPlugins( std::vector* plugins) { #if BUILDFLAG(ENABLE_PEPPER_FLASH) base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -240,7 +240,7 @@ void AtomContentClient::AddPepperPlugins( #endif // BUILDFLAG(ENABLE_PLUGINS) } -void AtomContentClient::AddContentDecryptionModules( +void ElectronContentClient::AddContentDecryptionModules( std::vector* cdms, std::vector* cdm_host_file_paths) { if (cdms) { diff --git a/shell/app/atom_content_client.h b/shell/app/electron_content_client.h similarity index 75% rename from shell/app/atom_content_client.h rename to shell/app/electron_content_client.h index 92a34c10f77..0e6eb9715e0 100644 --- a/shell/app/atom_content_client.h +++ b/shell/app/electron_content_client.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_APP_ATOM_CONTENT_CLIENT_H_ -#define SHELL_APP_ATOM_CONTENT_CLIENT_H_ +#ifndef SHELL_APP_ELECTRON_CONTENT_CLIENT_H_ +#define SHELL_APP_ELECTRON_CONTENT_CLIENT_H_ #include #include @@ -14,10 +14,10 @@ namespace electron { -class AtomContentClient : public content::ContentClient { +class ElectronContentClient : public content::ContentClient { public: - AtomContentClient(); - ~AtomContentClient() override; + ElectronContentClient(); + ~ElectronContentClient() override; protected: // content::ContentClient: @@ -33,9 +33,9 @@ class AtomContentClient : public content::ContentClient { std::vector* cdm_host_file_paths) override; private: - DISALLOW_COPY_AND_ASSIGN(AtomContentClient); + DISALLOW_COPY_AND_ASSIGN(ElectronContentClient); }; } // namespace electron -#endif // SHELL_APP_ATOM_CONTENT_CLIENT_H_ +#endif // SHELL_APP_ELECTRON_CONTENT_CLIENT_H_ diff --git a/shell/app/atom_library_main.h b/shell/app/electron_library_main.h similarity index 54% rename from shell/app/atom_library_main.h rename to shell/app/electron_library_main.h index c5d6f654258..ffc3eb92354 100644 --- a/shell/app/atom_library_main.h +++ b/shell/app/electron_library_main.h @@ -2,22 +2,22 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_APP_ATOM_LIBRARY_MAIN_H_ -#define SHELL_APP_ATOM_LIBRARY_MAIN_H_ +#ifndef SHELL_APP_ELECTRON_LIBRARY_MAIN_H_ +#define SHELL_APP_ELECTRON_LIBRARY_MAIN_H_ #include "build/build_config.h" #include "electron/buildflags/buildflags.h" #if defined(OS_MACOSX) extern "C" { -__attribute__((visibility("default"))) int AtomMain(int argc, char* argv[]); +__attribute__((visibility("default"))) int ElectronMain(int argc, char* argv[]); #if BUILDFLAG(ENABLE_RUN_AS_NODE) -__attribute__((visibility("default"))) int AtomInitializeICUandStartNode( +__attribute__((visibility("default"))) int ElectronInitializeICUandStartNode( int argc, char* argv[]); #endif } #endif // OS_MACOSX -#endif // SHELL_APP_ATOM_LIBRARY_MAIN_H_ +#endif // SHELL_APP_ELECTRON_LIBRARY_MAIN_H_ diff --git a/shell/app/atom_library_main.mm b/shell/app/electron_library_main.mm similarity index 74% rename from shell/app/atom_library_main.mm rename to shell/app/electron_library_main.mm index b53e296716a..58baed01c7d 100644 --- a/shell/app/atom_library_main.mm +++ b/shell/app/electron_library_main.mm @@ -2,29 +2,29 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/app/atom_library_main.h" +#include "shell/app/electron_library_main.h" #include "base/at_exit.h" #include "base/i18n/icu_util.h" #include "base/mac/bundle_locations.h" #include "base/mac/scoped_nsautorelease_pool.h" #include "content/public/app/content_main.h" -#include "shell/app/atom_main_delegate.h" +#include "shell/app/electron_main_delegate.h" #include "shell/app/node_main.h" -#include "shell/common/atom_command_line.h" +#include "shell/common/electron_command_line.h" #include "shell/common/mac/main_application_bundle.h" -int AtomMain(int argc, char* argv[]) { - electron::AtomMainDelegate delegate; +int ElectronMain(int argc, char* argv[]) { + electron::ElectronMainDelegate delegate; content::ContentMainParams params(&delegate); params.argc = argc; params.argv = const_cast(argv); - electron::AtomCommandLine::Init(argc, argv); + electron::ElectronCommandLine::Init(argc, argv); return content::ContentMain(params); } #if BUILDFLAG(ENABLE_RUN_AS_NODE) -int AtomInitializeICUandStartNode(int argc, char* argv[]) { +int ElectronInitializeICUandStartNode(int argc, char* argv[]) { base::AtExitManager atexit_manager; base::mac::ScopedNSAutoreleasePool pool; base::mac::SetOverrideFrameworkBundlePath( diff --git a/shell/app/atom_login_helper.mm b/shell/app/electron_login_helper.mm similarity index 100% rename from shell/app/atom_login_helper.mm rename to shell/app/electron_login_helper.mm diff --git a/shell/app/atom_main.cc b/shell/app/electron_main.cc similarity index 90% rename from shell/app/atom_main.cc rename to shell/app/electron_main.cc index a570b0cdbc8..6982c4eb6cb 100644 --- a/shell/app/atom_main.cc +++ b/shell/app/electron_main.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/app/atom_main.h" +#include "shell/app/electron_main.h" #include #include @@ -23,27 +23,27 @@ #include "base/win/windows_version.h" #include "content/public/app/sandbox_helper_win.h" #include "sandbox/win/src/sandbox_types.h" -#include "shell/app/atom_main_delegate.h" #include "shell/app/command_line_args.h" +#include "shell/app/electron_main_delegate.h" #include "shell/common/crash_reporter/win/crash_service_main.h" #elif defined(OS_LINUX) // defined(OS_WIN) #include #include #include "content/public/app/content_main.h" -#include "shell/app/atom_main_delegate.h" // NOLINT -#else // defined(OS_LINUX) +#include "shell/app/electron_main_delegate.h" // NOLINT +#else // defined(OS_LINUX) #include #include #include -#include "shell/app/atom_library_main.h" +#include "shell/app/electron_library_main.h" #endif // defined(OS_MACOSX) #include "base/at_exit.h" #include "base/i18n/icu_util.h" #include "electron/buildflags/buildflags.h" #include "shell/app/node_main.h" -#include "shell/common/atom_command_line.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_command_line.h" +#include "shell/common/electron_constants.h" #if defined(HELPER_EXECUTABLE) && !defined(MAS_BUILD) #include "sandbox/mac/seatbelt_exec.h" // nogncheck @@ -149,12 +149,12 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { sandbox::SandboxInterfaceInfo sandbox_info = {0}; content::InitializeSandboxInfo(&sandbox_info); - electron::AtomMainDelegate delegate; + electron::ElectronMainDelegate delegate; content::ContentMainParams params(&delegate); params.instance = instance; params.sandbox_info = &sandbox_info; - electron::AtomCommandLine::Init(arguments.argc, arguments.argv); + electron::ElectronCommandLine::Init(arguments.argc, arguments.argv); return content::ContentMain(params); } @@ -171,11 +171,11 @@ int main(int argc, char* argv[]) { } #endif - electron::AtomMainDelegate delegate; + electron::ElectronMainDelegate delegate; content::ContentMainParams params(&delegate); params.argc = argc; params.argv = const_cast(argv); - electron::AtomCommandLine::Init(argc, argv); + electron::ElectronCommandLine::Init(argc, argv); return content::ContentMain(params); } @@ -186,7 +186,7 @@ int main(int argc, char* argv[]) { #if BUILDFLAG(ENABLE_RUN_AS_NODE) if (IsEnvSet(electron::kRunAsNode)) { - return AtomInitializeICUandStartNode(argc, argv); + return ElectronInitializeICUandStartNode(argc, argv); } #endif @@ -219,7 +219,7 @@ int main(int argc, char* argv[]) { } #endif // defined(HELPER_EXECUTABLE) && !defined(MAS_BUILD) - return AtomMain(argc, argv); + return ElectronMain(argc, argv); } #endif // defined(OS_MACOSX) diff --git a/shell/app/atom_main.h b/shell/app/electron_main.h similarity index 62% rename from shell/app/atom_main.h rename to shell/app/electron_main.h index 611eeec830e..b49e5576e95 100644 --- a/shell/app/atom_main.h +++ b/shell/app/electron_main.h @@ -2,9 +2,9 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_APP_ATOM_MAIN_H_ -#define SHELL_APP_ATOM_MAIN_H_ +#ifndef SHELL_APP_ELECTRON_MAIN_H_ +#define SHELL_APP_ELECTRON_MAIN_H_ #include "content/public/app/content_main.h" -#endif // SHELL_APP_ATOM_MAIN_H_ +#endif // SHELL_APP_ELECTRON_MAIN_H_ diff --git a/shell/app/atom_main_delegate.cc b/shell/app/electron_main_delegate.cc similarity index 84% rename from shell/app/atom_main_delegate.cc rename to shell/app/electron_main_delegate.cc index e682198d24e..45eae234226 100644 --- a/shell/app/atom_main_delegate.cc +++ b/shell/app/electron_main_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/app/atom_main_delegate.h" +#include "shell/app/electron_main_delegate.h" #include #include @@ -27,21 +27,21 @@ #include "services/service_manager/embedder/switches.h" #include "services/service_manager/sandbox/switches.h" #include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h" -#include "shell/app/atom_content_client.h" -#include "shell/browser/atom_browser_client.h" -#include "shell/browser/atom_gpu_client.h" +#include "shell/app/electron_content_client.h" +#include "shell/browser/electron_browser_client.h" +#include "shell/browser/electron_gpu_client.h" #include "shell/browser/feature_list.h" #include "shell/browser/relauncher.h" #include "shell/common/options_switches.h" -#include "shell/renderer/atom_renderer_client.h" -#include "shell/renderer/atom_sandboxed_renderer_client.h" -#include "shell/utility/atom_content_utility_client.h" +#include "shell/renderer/electron_renderer_client.h" +#include "shell/renderer/electron_sandboxed_renderer_client.h" +#include "shell/utility/electron_content_utility_client.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" #if defined(OS_MACOSX) -#include "shell/app/atom_main_delegate_mac.h" +#include "shell/app/electron_main_delegate_mac.h" #endif #if defined(OS_WIN) @@ -129,16 +129,16 @@ void LoadResourceBundle(const std::string& locale) { #endif // BUILDFLAG(ENABLE_PDF_VIEWER) } -AtomMainDelegate::AtomMainDelegate() = default; +ElectronMainDelegate::ElectronMainDelegate() = default; -AtomMainDelegate::~AtomMainDelegate() = default; +ElectronMainDelegate::~ElectronMainDelegate() = default; -const char* const AtomMainDelegate::kNonWildcardDomainNonPortSchemes[] = { +const char* const ElectronMainDelegate::kNonWildcardDomainNonPortSchemes[] = { extensions::kExtensionScheme}; -const size_t AtomMainDelegate::kNonWildcardDomainNonPortSchemesSize = +const size_t ElectronMainDelegate::kNonWildcardDomainNonPortSchemesSize = base::size(kNonWildcardDomainNonPortSchemes); -bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { +bool ElectronMainDelegate::BasicStartupComplete(int* exit_code) { auto* command_line = base::CommandLine::ForCurrentProcess(); logging::LoggingSettings settings; @@ -224,13 +224,13 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { << " is not supported. See https://crbug.com/638180."; #endif - content_client_ = std::make_unique(); + content_client_ = std::make_unique(); SetContentClient(content_client_.get()); return false; } -void AtomMainDelegate::PostEarlyInitialization(bool is_running_tests) { +void ElectronMainDelegate::PostEarlyInitialization(bool is_running_tests) { std::string custom_locale; ui::ResourceBundle::InitSharedInstanceWithLocale( custom_locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES); @@ -256,11 +256,11 @@ void AtomMainDelegate::PostEarlyInitialization(bool is_running_tests) { LoadResourceBundle(custom_locale); - AtomBrowserClient::SetApplicationLocale( + ElectronBrowserClient::SetApplicationLocale( l10n_util::GetApplicationLocale(custom_locale)); } -void AtomMainDelegate::PreSandboxStartup() { +void ElectronMainDelegate::PreSandboxStartup() { auto* command_line = base::CommandLine::ForCurrentProcess(); std::string process_type = @@ -287,7 +287,7 @@ void AtomMainDelegate::PreSandboxStartup() { #endif } -void AtomMainDelegate::PreCreateMainMessageLoop() { +void ElectronMainDelegate::PreCreateMainMessageLoop() { // This is initialized early because the service manager reads some feature // flags and we need to make sure the feature list is initialized before the // service manager reads the features. @@ -297,35 +297,37 @@ void AtomMainDelegate::PreCreateMainMessageLoop() { #endif } -content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() { - browser_client_ = std::make_unique(); +content::ContentBrowserClient* +ElectronMainDelegate::CreateContentBrowserClient() { + browser_client_ = std::make_unique(); return browser_client_.get(); } -content::ContentGpuClient* AtomMainDelegate::CreateContentGpuClient() { - gpu_client_ = std::make_unique(); +content::ContentGpuClient* ElectronMainDelegate::CreateContentGpuClient() { + gpu_client_ = std::make_unique(); return gpu_client_.get(); } content::ContentRendererClient* -AtomMainDelegate::CreateContentRendererClient() { +ElectronMainDelegate::CreateContentRendererClient() { auto* command_line = base::CommandLine::ForCurrentProcess(); if (IsSandboxEnabled(command_line)) { - renderer_client_ = std::make_unique(); + renderer_client_ = std::make_unique(); } else { - renderer_client_ = std::make_unique(); + renderer_client_ = std::make_unique(); } return renderer_client_.get(); } -content::ContentUtilityClient* AtomMainDelegate::CreateContentUtilityClient() { - utility_client_ = std::make_unique(); +content::ContentUtilityClient* +ElectronMainDelegate::CreateContentUtilityClient() { + utility_client_ = std::make_unique(); return utility_client_.get(); } -int AtomMainDelegate::RunProcess( +int ElectronMainDelegate::RunProcess( const std::string& process_type, const content::MainFunctionParams& main_function_params) { if (process_type == kRelauncherProcess) @@ -335,13 +337,13 @@ int AtomMainDelegate::RunProcess( } #if defined(OS_MACOSX) -bool AtomMainDelegate::DelaySandboxInitialization( +bool ElectronMainDelegate::DelaySandboxInitialization( const std::string& process_type) { return process_type == kRelauncherProcess; } #endif -bool AtomMainDelegate::ShouldCreateFeatureList() { +bool ElectronMainDelegate::ShouldCreateFeatureList() { return false; } diff --git a/shell/app/atom_main_delegate.h b/shell/app/electron_main_delegate.h similarity index 85% rename from shell/app/atom_main_delegate.h rename to shell/app/electron_main_delegate.h index 0ee5cf48790..deff4e2218f 100644 --- a/shell/app/atom_main_delegate.h +++ b/shell/app/electron_main_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_APP_ATOM_MAIN_DELEGATE_H_ -#define SHELL_APP_ATOM_MAIN_DELEGATE_H_ +#ifndef SHELL_APP_ELECTRON_MAIN_DELEGATE_H_ +#define SHELL_APP_ELECTRON_MAIN_DELEGATE_H_ #include #include @@ -19,12 +19,12 @@ namespace electron { void LoadResourceBundle(const std::string& locale); -class AtomMainDelegate : public content::ContentMainDelegate { +class ElectronMainDelegate : public content::ContentMainDelegate { public: static const char* const kNonWildcardDomainNonPortSchemes[]; static const size_t kNonWildcardDomainNonPortSchemesSize; - AtomMainDelegate(); - ~AtomMainDelegate() override; + ElectronMainDelegate(); + ~ElectronMainDelegate() override; protected: // content::ContentMainDelegate: @@ -58,9 +58,9 @@ class AtomMainDelegate : public content::ContentMainDelegate { std::unique_ptr utility_client_; std::unique_ptr tracing_sampler_profiler_; - DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate); + DISALLOW_COPY_AND_ASSIGN(ElectronMainDelegate); }; } // namespace electron -#endif // SHELL_APP_ATOM_MAIN_DELEGATE_H_ +#endif // SHELL_APP_ELECTRON_MAIN_DELEGATE_H_ diff --git a/shell/app/atom_main_delegate_mac.h b/shell/app/electron_main_delegate_mac.h similarity index 65% rename from shell/app/atom_main_delegate_mac.h rename to shell/app/electron_main_delegate_mac.h index ba49e2456e0..dc4004608cf 100644 --- a/shell/app/atom_main_delegate_mac.h +++ b/shell/app/electron_main_delegate_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SHELL_APP_ATOM_MAIN_DELEGATE_MAC_H_ -#define SHELL_APP_ATOM_MAIN_DELEGATE_MAC_H_ +#ifndef SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_ +#define SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_ namespace electron { @@ -12,4 +12,4 @@ void RegisterAtomCrApp(); } // namespace electron -#endif // SHELL_APP_ATOM_MAIN_DELEGATE_MAC_H_ +#endif // SHELL_APP_ELECTRON_MAIN_DELEGATE_MAC_H_ diff --git a/shell/app/atom_main_delegate_mac.mm b/shell/app/electron_main_delegate_mac.mm similarity index 90% rename from shell/app/atom_main_delegate_mac.mm rename to shell/app/electron_main_delegate_mac.mm index 48dc62a9ffe..31f8bf364bc 100644 --- a/shell/app/atom_main_delegate_mac.mm +++ b/shell/app/electron_main_delegate_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/app/atom_main_delegate.h" +#include "shell/app/electron_main_delegate.h" #include @@ -15,7 +15,7 @@ #include "base/strings/sys_string_conversions.h" #include "content/common/mac_helpers.h" #include "content/public/common/content_paths.h" -#include "shell/browser/mac/atom_application.h" +#include "shell/browser/mac/electron_application.h" #include "shell/common/application_info.h" #include "shell/common/mac/main_application_bundle.h" @@ -53,12 +53,12 @@ base::FilePath GetHelperAppPath(const base::FilePath& frameworks_path, } // namespace -void AtomMainDelegate::OverrideFrameworkBundlePath() { +void ElectronMainDelegate::OverrideFrameworkBundlePath() { base::mac::SetOverrideFrameworkBundlePath( GetFrameworksPath().Append(ELECTRON_PRODUCT_NAME " Framework.framework")); } -void AtomMainDelegate::OverrideChildProcessPath() { +void ElectronMainDelegate::OverrideChildProcessPath() { base::FilePath frameworks_path = GetFrameworksPath(); base::FilePath helper_path = GetHelperAppPath(frameworks_path, ELECTRON_PRODUCT_NAME); @@ -69,7 +69,7 @@ void AtomMainDelegate::OverrideChildProcessPath() { base::PathService::Override(content::CHILD_PROCESS_EXE, helper_path); } -void AtomMainDelegate::SetUpBundleOverrides() { +void ElectronMainDelegate::SetUpBundleOverrides() { base::mac::ScopedNSAutoreleasePool pool; NSBundle* bundle = MainApplicationBundle(); std::string base_bundle_id = @@ -82,7 +82,7 @@ void AtomMainDelegate::SetUpBundleOverrides() { void RegisterAtomCrApp() { // Force the NSApplication subclass to be used. - [AtomApplication sharedApplication]; + [ElectronApplication sharedApplication]; } } // namespace electron diff --git a/shell/browser/api/atom_api_app.cc b/shell/browser/api/electron_api_app.cc similarity index 97% rename from shell/browser/api/atom_api_app.cc rename to shell/browser/api/electron_api_app.cc index 4f4ab66906e..1a1e49b6d9f 100644 --- a/shell/browser/api/atom_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_app.h" +#include "shell/browser/api/electron_api_app.h" #include @@ -33,17 +33,17 @@ #include "net/ssl/client_cert_identity.h" #include "net/ssl/ssl_cert_request_info.h" #include "services/service_manager/sandbox/switches.h" -#include "shell/browser/api/atom_api_menu.h" -#include "shell/browser/api/atom_api_session.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_menu.h" +#include "shell/browser/api/electron_api_session.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/api/gpuinfo_manager.h" -#include "shell/browser/atom_browser_context.h" -#include "shell/browser/atom_browser_main_parts.h" -#include "shell/browser/atom_paths.h" +#include "shell/browser/electron_browser_context.h" +#include "shell/browser/electron_browser_main_parts.h" +#include "shell/browser/electron_paths.h" #include "shell/browser/login_handler.h" #include "shell/browser/relauncher.h" #include "shell/common/application_info.h" -#include "shell/common/atom_command_line.h" +#include "shell/common/electron_command_line.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_converters/gurl_converter.h" @@ -63,7 +63,7 @@ #if defined(OS_MACOSX) #include -#include "shell/browser/ui/cocoa/atom_bundle_mover.h" +#include "shell/browser/ui/cocoa/electron_bundle_mover.h" #endif using electron::Browser; @@ -536,7 +536,8 @@ void OnIconDataAvailable(gin_helper::Promise promise, } // namespace App::App(v8::Isolate* isolate) { - static_cast(AtomBrowserClient::Get())->set_delegate(this); + static_cast(ElectronBrowserClient::Get()) + ->set_delegate(this); Browser::Get()->AddObserver(this); content::GpuDataManager::GetInstance()->AddObserver(this); @@ -549,7 +550,7 @@ App::App(v8::Isolate* isolate) { } App::~App() { - static_cast(AtomBrowserClient::Get()) + static_cast(ElectronBrowserClient::Get()) ->set_delegate(nullptr); Browser::Get()->RemoveObserver(this); content::GpuDataManager::GetInstance()->RemoveObserver(this); @@ -573,7 +574,7 @@ void App::OnWindowAllClosed() { } void App::OnQuit() { - int exitCode = AtomBrowserMainParts::Get()->GetExitCode(); + int exitCode = ElectronBrowserMainParts::Get()->GetExitCode(); Emit("quit", exitCode); if (process_singleton_) { @@ -786,7 +787,7 @@ void App::RenderProcessReady(content::RenderProcessHost* host) { // `WebContents` instances, but this was implicitly happening before in // `RenderProcessPreferences`, so this is at least more explicit... content::WebContents* web_contents = - AtomBrowserClient::Get()->GetWebContentsFromProcessID(host->GetID()); + ElectronBrowserClient::Get()->GetWebContentsFromProcessID(host->GetID()); if (web_contents) WebContents::FromOrCreate(v8::Isolate::GetCurrent(), web_contents); } @@ -991,7 +992,8 @@ bool App::Relaunch(gin_helper::Arguments* js_args) { } if (!override_argv) { - const relauncher::StringVector& argv = electron::AtomCommandLine::argv(); + const relauncher::StringVector& argv = + electron::ElectronCommandLine::argv(); return relauncher::RelaunchApp(argv); } @@ -1065,7 +1067,7 @@ Browser::LoginItemSettings App::GetLoginItemSettings( #if defined(USE_NSS_CERTS) void App::ImportCertificate(const base::DictionaryValue& options, net::CompletionRepeatingCallback callback) { - auto browser_context = AtomBrowserContext::From("", false); + auto browser_context = ElectronBrowserContext::From("", false); if (!certificate_manager_model_) { auto copy = base::DictionaryValue::From( base::Value::ToUniquePtrValue(options.Clone())); @@ -1164,7 +1166,7 @@ v8::Local App::GetFileIcon(const base::FilePath& path, icon_size = GetIconSizeByString(icon_size_string); } - auto* icon_manager = AtomBrowserMainParts::Get()->GetIconManager(); + auto* icon_manager = ElectronBrowserMainParts::Get()->GetIconManager(); gfx::Image* icon = icon_manager->LookupIconFromFilepath(normalized_path, icon_size); if (icon) { @@ -1314,28 +1316,28 @@ void App::EnableSandbox(gin_helper::ErrorThrower thrower) { } void App::SetUserAgentFallback(const std::string& user_agent) { - AtomBrowserClient::Get()->SetUserAgent(user_agent); + ElectronBrowserClient::Get()->SetUserAgent(user_agent); } std::string App::GetUserAgentFallback() { - return AtomBrowserClient::Get()->GetUserAgent(); + return ElectronBrowserClient::Get()->GetUserAgent(); } void App::SetBrowserClientCanUseCustomSiteInstance(bool should_disable) { - AtomBrowserClient::Get()->SetCanUseCustomSiteInstance(should_disable); + ElectronBrowserClient::Get()->SetCanUseCustomSiteInstance(should_disable); } bool App::CanBrowserClientUseCustomSiteInstance() { - return AtomBrowserClient::Get()->CanUseCustomSiteInstance(); + return ElectronBrowserClient::Get()->CanUseCustomSiteInstance(); } #if defined(OS_MACOSX) bool App::MoveToApplicationsFolder(gin_helper::ErrorThrower thrower, gin::Arguments* args) { - return AtomBundleMover::Move(thrower, args); + return ElectronBundleMover::Move(thrower, args); } bool App::IsInApplicationsFolder() { - return AtomBundleMover::IsCurrentAppInApplicationsFolder(); + return ElectronBundleMover::IsCurrentAppInApplicationsFolder(); } int DockBounce(gin_helper::Arguments* args) { diff --git a/shell/browser/api/atom_api_app.h b/shell/browser/api/electron_api_app.h similarity index 97% rename from shell/browser/api/atom_api_app.h rename to shell/browser/api/electron_api_app.h index 0db7728b7b4..44bf2f8fb22 100644 --- a/shell/browser/api/atom_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_APP_H_ -#define SHELL_BROWSER_API_ATOM_API_APP_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_APP_H_ +#define SHELL_BROWSER_API_ELECTRON_API_APP_H_ #include #include @@ -22,9 +22,9 @@ #include "net/base/completion_repeating_callback.h" #include "net/ssl/client_cert_identity.h" #include "shell/browser/api/process_metric.h" -#include "shell/browser/atom_browser_client.h" #include "shell/browser/browser.h" #include "shell/browser/browser_observer.h" +#include "shell/browser/electron_browser_client.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/event_emitter.h" @@ -46,7 +46,7 @@ enum class JumpListResult : int; namespace api { -class App : public AtomBrowserClient::Delegate, +class App : public ElectronBrowserClient::Delegate, public gin_helper::EventEmitter, public BrowserObserver, public content::GpuDataManagerObserver, @@ -244,4 +244,4 @@ class App : public AtomBrowserClient::Delegate, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_APP_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_APP_H_ diff --git a/shell/browser/api/atom_api_app_mac.mm b/shell/browser/api/electron_api_app_mac.mm similarity index 92% rename from shell/browser/api/atom_api_app_mac.mm rename to shell/browser/api/electron_api_app_mac.mm index 385a91bea40..f8595513cf9 100644 --- a/shell/browser/api/atom_api_app_mac.mm +++ b/shell/browser/api/electron_api_app_mac.mm @@ -3,8 +3,8 @@ // found in the LICENSE file. #include "base/path_service.h" -#include "shell/browser/api/atom_api_app.h" -#include "shell/browser/atom_paths.h" +#include "shell/browser/api/electron_api_app.h" +#include "shell/browser/electron_paths.h" #import diff --git a/shell/browser/api/atom_api_app_mas.mm b/shell/browser/api/electron_api_app_mas.mm similarity index 97% rename from shell/browser/api/atom_api_app_mas.mm rename to shell/browser/api/electron_api_app_mas.mm index 4ed28d37142..e3951ba792e 100644 --- a/shell/browser/api/atom_api_app_mas.mm +++ b/shell/browser/api/electron_api_app_mas.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_app.h" +#include "shell/browser/api/electron_api_app.h" #include diff --git a/shell/browser/api/atom_api_auto_updater.cc b/shell/browser/api/electron_api_auto_updater.cc similarity index 98% rename from shell/browser/api/atom_api_auto_updater.cc rename to shell/browser/api/electron_api_auto_updater.cc index 0d0f78759a3..6b82edc2de9 100644 --- a/shell/browser/api/atom_api_auto_updater.cc +++ b/shell/browser/api/electron_api_auto_updater.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_auto_updater.h" +#include "shell/browser/api/electron_api_auto_updater.h" #include "base/time/time.h" #include "shell/browser/browser.h" diff --git a/shell/browser/api/atom_api_auto_updater.h b/shell/browser/api/electron_api_auto_updater.h similarity index 90% rename from shell/browser/api/atom_api_auto_updater.h rename to shell/browser/api/electron_api_auto_updater.h index 3e69fe385ef..7205fbf7753 100644 --- a/shell/browser/api/atom_api_auto_updater.h +++ b/shell/browser/api/electron_api_auto_updater.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_AUTO_UPDATER_H_ -#define SHELL_BROWSER_API_ATOM_API_AUTO_UPDATER_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_AUTO_UPDATER_H_ +#define SHELL_BROWSER_API_ELECTRON_API_AUTO_UPDATER_H_ #include @@ -57,4 +57,4 @@ class AutoUpdater : public gin_helper::EventEmitter, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_AUTO_UPDATER_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_AUTO_UPDATER_H_ diff --git a/shell/browser/api/atom_api_browser_view.cc b/shell/browser/api/electron_api_browser_view.cc similarity index 97% rename from shell/browser/api/atom_api_browser_view.cc rename to shell/browser/api/electron_api_browser_view.cc index 3515da393a4..e6a70b4684a 100644 --- a/shell/browser/api/atom_api_browser_view.cc +++ b/shell/browser/api/electron_api_browser_view.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_browser_view.h" +#include "shell/browser/api/electron_api_browser_view.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/browser.h" #include "shell/browser/native_browser_view.h" #include "shell/common/color_util.h" diff --git a/shell/browser/api/atom_api_browser_view.h b/shell/browser/api/electron_api_browser_view.h similarity index 91% rename from shell/browser/api/atom_api_browser_view.h rename to shell/browser/api/electron_api_browser_view.h index 9dae4c86bbb..72ea427456b 100644 --- a/shell/browser/api/atom_api_browser_view.h +++ b/shell/browser/api/electron_api_browser_view.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_BROWSER_VIEW_H_ -#define SHELL_BROWSER_API_ATOM_API_BROWSER_VIEW_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_BROWSER_VIEW_H_ +#define SHELL_BROWSER_API_ELECTRON_API_BROWSER_VIEW_H_ #include #include @@ -70,4 +70,4 @@ class BrowserView : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_BROWSER_VIEW_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_BROWSER_VIEW_H_ diff --git a/shell/browser/api/atom_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc similarity index 99% rename from shell/browser/api/atom_api_browser_window.cc rename to shell/browser/api/electron_api_browser_window.cc index cc2b94600ad..47928436d69 100644 --- a/shell/browser/api/atom_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_browser_window.h" +#include "shell/browser/api/electron_api_browser_window.h" #include diff --git a/shell/browser/api/atom_api_browser_window.h b/shell/browser/api/electron_api_browser_window.h similarity index 93% rename from shell/browser/api/atom_api_browser_window.h rename to shell/browser/api/electron_api_browser_window.h index b3ef05ec491..acc7a5ca65b 100644 --- a/shell/browser/api/atom_api_browser_window.h +++ b/shell/browser/api/electron_api_browser_window.h @@ -2,16 +2,16 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_BROWSER_WINDOW_H_ -#define SHELL_BROWSER_API_ATOM_API_BROWSER_WINDOW_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_BROWSER_WINDOW_H_ +#define SHELL_BROWSER_API_ELECTRON_API_BROWSER_WINDOW_H_ #include #include #include #include "base/cancelable_callback.h" -#include "shell/browser/api/atom_api_top_level_window.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_top_level_window.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/common/gin_helper/error_thrower.h" namespace electron { @@ -129,4 +129,4 @@ class BrowserWindow : public TopLevelWindow, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_BROWSER_WINDOW_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_BROWSER_WINDOW_H_ diff --git a/shell/browser/api/atom_api_browser_window_mac.mm b/shell/browser/api/electron_api_browser_window_mac.mm similarity index 98% rename from shell/browser/api/atom_api_browser_window_mac.mm rename to shell/browser/api/electron_api_browser_window_mac.mm index 378cb5d6cd8..f1c245dad8e 100644 --- a/shell/browser/api/atom_api_browser_window_mac.mm +++ b/shell/browser/api/electron_api_browser_window_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_browser_window.h" +#include "shell/browser/api/electron_api_browser_window.h" #include #include diff --git a/shell/browser/api/atom_api_browser_window_views.cc b/shell/browser/api/electron_api_browser_window_views.cc similarity index 90% rename from shell/browser/api/atom_api_browser_window_views.cc rename to shell/browser/api/electron_api_browser_window_views.cc index be5bbecf293..8da8a18fa30 100644 --- a/shell/browser/api/atom_api_browser_window_views.cc +++ b/shell/browser/api/electron_api_browser_window_views.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_browser_window.h" +#include "shell/browser/api/electron_api_browser_window.h" #include "shell/browser/native_window_views.h" diff --git a/shell/browser/api/atom_api_content_tracing.cc b/shell/browser/api/electron_api_content_tracing.cc similarity index 100% rename from shell/browser/api/atom_api_content_tracing.cc rename to shell/browser/api/electron_api_content_tracing.cc diff --git a/shell/browser/api/atom_api_cookies.cc b/shell/browser/api/electron_api_cookies.cc similarity index 97% rename from shell/browser/api/atom_api_cookies.cc rename to shell/browser/api/electron_api_cookies.cc index 15d96515ab7..31515b6c730 100644 --- a/shell/browser/api/atom_api_cookies.cc +++ b/shell/browser/api/electron_api_cookies.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_cookies.h" +#include "shell/browser/api/electron_api_cookies.h" #include #include @@ -18,8 +18,8 @@ #include "net/cookies/canonical_cookie.h" #include "net/cookies/cookie_store.h" #include "net/cookies/cookie_util.h" -#include "shell/browser/atom_browser_context.h" #include "shell/browser/cookie_change_notifier.h" +#include "shell/browser/electron_browser_context.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" @@ -173,7 +173,7 @@ std::string InclusionStatusToString( } // namespace -Cookies::Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context) +Cookies::Cookies(v8::Isolate* isolate, ElectronBrowserContext* browser_context) : browser_context_(browser_context) { Init(isolate); cookie_change_subscription_ = @@ -322,7 +322,7 @@ void Cookies::OnCookieChanged(const net::CookieChangeInfo& change) { // static gin::Handle Cookies::Create(v8::Isolate* isolate, - AtomBrowserContext* browser_context) { + ElectronBrowserContext* browser_context) { return gin::CreateHandle(isolate, new Cookies(isolate, browser_context)); } diff --git a/shell/browser/api/atom_api_cookies.h b/shell/browser/api/electron_api_cookies.h similarity index 79% rename from shell/browser/api/atom_api_cookies.h rename to shell/browser/api/electron_api_cookies.h index 9455d42ebfc..6689585a18d 100644 --- a/shell/browser/api/atom_api_cookies.h +++ b/shell/browser/api/electron_api_cookies.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_COOKIES_H_ -#define SHELL_BROWSER_API_ATOM_API_COOKIES_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_COOKIES_H_ +#define SHELL_BROWSER_API_ELECTRON_API_COOKIES_H_ #include #include @@ -29,21 +29,21 @@ class URLRequestContextGetter; namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; namespace api { class Cookies : public gin_helper::TrackableObject { public: static gin::Handle Create(v8::Isolate* isolate, - AtomBrowserContext* browser_context); + ElectronBrowserContext* browser_context); // gin_helper::TrackableObject: static void BuildPrototype(v8::Isolate* isolate, v8::Local prototype); protected: - Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context); + Cookies(v8::Isolate* isolate, ElectronBrowserContext* browser_context); ~Cookies() override; v8::Local Get(const gin_helper::Dictionary& filter); @@ -58,7 +58,7 @@ class Cookies : public gin_helper::TrackableObject { std::unique_ptr::Subscription> cookie_change_subscription_; - scoped_refptr browser_context_; + scoped_refptr browser_context_; DISALLOW_COPY_AND_ASSIGN(Cookies); }; @@ -67,4 +67,4 @@ class Cookies : public gin_helper::TrackableObject { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_COOKIES_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_COOKIES_H_ diff --git a/shell/browser/api/atom_api_data_pipe_holder.cc b/shell/browser/api/electron_api_data_pipe_holder.cc similarity index 98% rename from shell/browser/api/atom_api_data_pipe_holder.cc rename to shell/browser/api/electron_api_data_pipe_holder.cc index bcca4cf2130..176b8872044 100644 --- a/shell/browser/api/atom_api_data_pipe_holder.cc +++ b/shell/browser/api/electron_api_data_pipe_holder.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_data_pipe_holder.h" +#include "shell/browser/api/electron_api_data_pipe_holder.h" #include #include diff --git a/shell/browser/api/atom_api_data_pipe_holder.h b/shell/browser/api/electron_api_data_pipe_holder.h similarity index 88% rename from shell/browser/api/atom_api_data_pipe_holder.h rename to shell/browser/api/electron_api_data_pipe_holder.h index 877753ca84a..0991f659d4e 100644 --- a/shell/browser/api/atom_api_data_pipe_holder.h +++ b/shell/browser/api/electron_api_data_pipe_holder.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_DATA_PIPE_HOLDER_H_ -#define SHELL_BROWSER_API_ATOM_API_DATA_PIPE_HOLDER_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_DATA_PIPE_HOLDER_H_ +#define SHELL_BROWSER_API_ELECTRON_API_DATA_PIPE_HOLDER_H_ #include @@ -51,4 +51,4 @@ class DataPipeHolder : public gin::Wrappable { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_DATA_PIPE_HOLDER_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_DATA_PIPE_HOLDER_H_ diff --git a/shell/browser/api/atom_api_debugger.cc b/shell/browser/api/electron_api_debugger.cc similarity index 99% rename from shell/browser/api/atom_api_debugger.cc rename to shell/browser/api/electron_api_debugger.cc index b1b2b96ccf5..c029c891b56 100644 --- a/shell/browser/api/atom_api_debugger.cc +++ b/shell/browser/api/electron_api_debugger.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_debugger.h" +#include "shell/browser/api/electron_api_debugger.h" #include #include diff --git a/shell/browser/api/atom_api_debugger.h b/shell/browser/api/electron_api_debugger.h similarity index 93% rename from shell/browser/api/atom_api_debugger.h rename to shell/browser/api/electron_api_debugger.h index 73564dcc7f0..ca6550bd244 100644 --- a/shell/browser/api/atom_api_debugger.h +++ b/shell/browser/api/electron_api_debugger.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_DEBUGGER_H_ -#define SHELL_BROWSER_API_ATOM_API_DEBUGGER_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_DEBUGGER_H_ +#define SHELL_BROWSER_API_ELECTRON_API_DEBUGGER_H_ #include #include @@ -72,4 +72,4 @@ class Debugger : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_DEBUGGER_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_DEBUGGER_H_ diff --git a/shell/browser/api/atom_api_desktop_capturer.cc b/shell/browser/api/electron_api_desktop_capturer.cc similarity index 98% rename from shell/browser/api/atom_api_desktop_capturer.cc rename to shell/browser/api/electron_api_desktop_capturer.cc index 75cebde0a12..6e6021b7d9a 100644 --- a/shell/browser/api/atom_api_desktop_capturer.cc +++ b/shell/browser/api/electron_api_desktop_capturer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_desktop_capturer.h" +#include "shell/browser/api/electron_api_desktop_capturer.h" #include #include @@ -14,7 +14,7 @@ #include "chrome/browser/media/webrtc/desktop_media_list.h" #include "chrome/browser/media/webrtc/window_icon_util.h" #include "content/public/browser/desktop_capture.h" -#include "shell/common/api/atom_api_native_image.h" +#include "shell/common/api/electron_api_native_image.h" #include "shell/common/gin_converters/gfx_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" diff --git a/shell/browser/api/atom_api_desktop_capturer.h b/shell/browser/api/electron_api_desktop_capturer.h similarity index 92% rename from shell/browser/api/atom_api_desktop_capturer.h rename to shell/browser/api/electron_api_desktop_capturer.h index 8a8fec0f643..53b5f128ee1 100644 --- a/shell/browser/api/atom_api_desktop_capturer.h +++ b/shell/browser/api/electron_api_desktop_capturer.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_DESKTOP_CAPTURER_H_ -#define SHELL_BROWSER_API_ATOM_API_DESKTOP_CAPTURER_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_DESKTOP_CAPTURER_H_ +#define SHELL_BROWSER_API_ELECTRON_API_DESKTOP_CAPTURER_H_ #include #include @@ -76,4 +76,4 @@ class DesktopCapturer : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_DESKTOP_CAPTURER_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_DESKTOP_CAPTURER_H_ diff --git a/shell/browser/api/atom_api_dialog.cc b/shell/browser/api/electron_api_dialog.cc similarity index 100% rename from shell/browser/api/atom_api_dialog.cc rename to shell/browser/api/electron_api_dialog.cc diff --git a/shell/browser/api/atom_api_download_item.cc b/shell/browser/api/electron_api_download_item.cc similarity index 98% rename from shell/browser/api/atom_api_download_item.cc rename to shell/browser/api/electron_api_download_item.cc index b72e095ff6b..fb006eae640 100644 --- a/shell/browser/api/atom_api_download_item.cc +++ b/shell/browser/api/electron_api_download_item.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_download_item.h" +#include "shell/browser/api/electron_api_download_item.h" #include #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "net/base/filename_util.h" -#include "shell/browser/atom_browser_main_parts.h" +#include "shell/browser/electron_browser_main_parts.h" #include "shell/common/gin_converters/file_dialog_converter.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_converters/gurl_converter.h" diff --git a/shell/browser/api/atom_api_download_item.h b/shell/browser/api/electron_api_download_item.h similarity index 92% rename from shell/browser/api/atom_api_download_item.h rename to shell/browser/api/electron_api_download_item.h index 33fbf97ac20..42f7f672ef0 100644 --- a/shell/browser/api/atom_api_download_item.h +++ b/shell/browser/api/electron_api_download_item.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_DOWNLOAD_ITEM_H_ -#define SHELL_BROWSER_API_ATOM_API_DOWNLOAD_ITEM_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_DOWNLOAD_ITEM_H_ +#define SHELL_BROWSER_API_ELECTRON_API_DOWNLOAD_ITEM_H_ #include #include @@ -71,4 +71,4 @@ class DownloadItem : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_DOWNLOAD_ITEM_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_DOWNLOAD_ITEM_H_ diff --git a/shell/browser/api/atom_api_event.cc b/shell/browser/api/electron_api_event.cc similarity index 100% rename from shell/browser/api/atom_api_event.cc rename to shell/browser/api/electron_api_event.cc diff --git a/shell/browser/api/atom_api_global_shortcut.cc b/shell/browser/api/electron_api_global_shortcut.cc similarity index 97% rename from shell/browser/api/atom_api_global_shortcut.cc rename to shell/browser/api/electron_api_global_shortcut.cc index 9a225849645..ed99fa729cd 100644 --- a/shell/browser/api/atom_api_global_shortcut.cc +++ b/shell/browser/api/electron_api_global_shortcut.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_global_shortcut.h" +#include "shell/browser/api/electron_api_global_shortcut.h" #include #include #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" -#include "shell/browser/api/atom_api_system_preferences.h" +#include "shell/browser/api/electron_api_system_preferences.h" #include "shell/common/gin_converters/accelerator_converter.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/browser/api/atom_api_global_shortcut.h b/shell/browser/api/electron_api_global_shortcut.h similarity index 90% rename from shell/browser/api/atom_api_global_shortcut.h rename to shell/browser/api/electron_api_global_shortcut.h index d614227211a..c1f9051b76e 100644 --- a/shell/browser/api/atom_api_global_shortcut.h +++ b/shell/browser/api/electron_api_global_shortcut.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_GLOBAL_SHORTCUT_H_ -#define SHELL_BROWSER_API_ATOM_API_GLOBAL_SHORTCUT_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_GLOBAL_SHORTCUT_H_ +#define SHELL_BROWSER_API_ELECTRON_API_GLOBAL_SHORTCUT_H_ #include #include @@ -55,4 +55,4 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_GLOBAL_SHORTCUT_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_GLOBAL_SHORTCUT_H_ diff --git a/shell/browser/api/atom_api_in_app_purchase.cc b/shell/browser/api/electron_api_in_app_purchase.cc similarity index 98% rename from shell/browser/api/atom_api_in_app_purchase.cc rename to shell/browser/api/electron_api_in_app_purchase.cc index c5634940774..0f9850442a4 100644 --- a/shell/browser/api/atom_api_in_app_purchase.cc +++ b/shell/browser/api/electron_api_in_app_purchase.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_in_app_purchase.h" +#include "shell/browser/api/electron_api_in_app_purchase.h" #include #include diff --git a/shell/browser/api/atom_api_in_app_purchase.h b/shell/browser/api/electron_api_in_app_purchase.h similarity index 89% rename from shell/browser/api/atom_api_in_app_purchase.h rename to shell/browser/api/electron_api_in_app_purchase.h index 72f109e1341..21b833c4415 100644 --- a/shell/browser/api/atom_api_in_app_purchase.h +++ b/shell/browser/api/electron_api_in_app_purchase.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_IN_APP_PURCHASE_H_ -#define SHELL_BROWSER_API_ATOM_API_IN_APP_PURCHASE_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_IN_APP_PURCHASE_H_ +#define SHELL_BROWSER_API_ELECTRON_API_IN_APP_PURCHASE_H_ #include #include @@ -49,4 +49,4 @@ class InAppPurchase : public gin_helper::EventEmitter, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_IN_APP_PURCHASE_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_IN_APP_PURCHASE_H_ diff --git a/shell/browser/api/atom_api_menu.cc b/shell/browser/api/electron_api_menu.cc similarity index 98% rename from shell/browser/api/atom_api_menu.cc rename to shell/browser/api/electron_api_menu.cc index 75bb8848bbb..a2f2da9a101 100644 --- a/shell/browser/api/atom_api_menu.cc +++ b/shell/browser/api/electron_api_menu.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_menu.h" +#include "shell/browser/api/electron_api_menu.h" #include #include @@ -28,7 +28,7 @@ namespace electron { namespace api { -Menu::Menu(gin::Arguments* args) : model_(new AtomMenuModel(this)) { +Menu::Menu(gin::Arguments* args) : model_(new ElectronMenuModel(this)) { InitWithArgs(args); model_->AddObserver(this); } diff --git a/shell/browser/api/atom_api_menu.h b/shell/browser/api/electron_api_menu.h similarity index 89% rename from shell/browser/api/atom_api_menu.h rename to shell/browser/api/electron_api_menu.h index 46df0260324..b617267a4c6 100644 --- a/shell/browser/api/atom_api_menu.h +++ b/shell/browser/api/electron_api_menu.h @@ -2,16 +2,16 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_MENU_H_ -#define SHELL_BROWSER_API_ATOM_API_MENU_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_MENU_H_ +#define SHELL_BROWSER_API_ELECTRON_API_MENU_H_ #include #include #include "base/callback.h" #include "gin/arguments.h" -#include "shell/browser/api/atom_api_top_level_window.h" -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/api/electron_api_top_level_window.h" +#include "shell/browser/ui/electron_menu_model.h" #include "shell/common/gin_helper/trackable_object.h" namespace electron { @@ -19,8 +19,8 @@ namespace electron { namespace api { class Menu : public gin_helper::TrackableObject, - public AtomMenuModel::Delegate, - public AtomMenuModel::Observer { + public ElectronMenuModel::Delegate, + public ElectronMenuModel::Observer { public: static gin_helper::WrappableBase* New(gin::Arguments* args); @@ -35,7 +35,7 @@ class Menu : public gin_helper::TrackableObject, static void SendActionToFirstResponder(const std::string& action); #endif - AtomMenuModel* model() const { return model_.get(); } + ElectronMenuModel* model() const { return model_.get(); } protected: explicit Menu(gin::Arguments* args); @@ -64,7 +64,7 @@ class Menu : public gin_helper::TrackableObject, base::OnceClosure callback) = 0; virtual void ClosePopupAt(int32_t window_id) = 0; - std::unique_ptr model_; + std::unique_ptr model_; Menu* parent_ = nullptr; // Observable: @@ -130,10 +130,10 @@ class Menu : public gin_helper::TrackableObject, namespace gin { template <> -struct Converter { +struct Converter { static bool FromV8(v8::Isolate* isolate, v8::Local val, - electron::AtomMenuModel** out) { + electron::ElectronMenuModel** out) { // null would be tranfered to NULL. if (val->IsNull()) { *out = nullptr; @@ -150,4 +150,4 @@ struct Converter { } // namespace gin -#endif // SHELL_BROWSER_API_ATOM_API_MENU_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_MENU_H_ diff --git a/shell/browser/api/atom_api_menu_mac.h b/shell/browser/api/electron_api_menu_mac.h similarity index 73% rename from shell/browser/api/atom_api_menu_mac.h rename to shell/browser/api/electron_api_menu_mac.h index a3aee744597..3b3c066c562 100644 --- a/shell/browser/api/atom_api_menu_mac.h +++ b/shell/browser/api/electron_api_menu_mac.h @@ -2,15 +2,15 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_MENU_MAC_H_ -#define SHELL_BROWSER_API_ATOM_API_MENU_MAC_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_MENU_MAC_H_ +#define SHELL_BROWSER_API_ELECTRON_API_MENU_MAC_H_ -#include "shell/browser/api/atom_api_menu.h" +#include "shell/browser/api/electron_api_menu.h" #include #include -#import "shell/browser/ui/cocoa/atom_menu_controller.h" +#import "shell/browser/ui/cocoa/electron_menu_controller.h" using base::scoped_nsobject; @@ -42,10 +42,10 @@ class MenuMac : public Menu { void OnClosed(int32_t window_id, base::OnceClosure callback); - scoped_nsobject menu_controller_; + scoped_nsobject menu_controller_; // window ID -> open context menu - std::map> popup_controllers_; + std::map> popup_controllers_; base::WeakPtrFactory weak_factory_; @@ -56,4 +56,4 @@ class MenuMac : public Menu { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_MENU_MAC_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_MENU_MAC_H_ diff --git a/shell/browser/api/atom_api_menu_mac.mm b/shell/browser/api/electron_api_menu_mac.mm similarity index 93% rename from shell/browser/api/atom_api_menu_mac.mm rename to shell/browser/api/electron_api_menu_mac.mm index 9d0d1eba992..580f60c4c6c 100644 --- a/shell/browser/api/atom_api_menu_mac.mm +++ b/shell/browser/api/electron_api_menu_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#import "shell/browser/api/atom_api_menu_mac.h" +#import "shell/browser/api/electron_api_menu_mac.h" #include #include @@ -67,9 +67,9 @@ void MenuMac::PopupOnUI(const base::WeakPtr& native_window, base::OnceClosure close_callback = base::BindOnce(&MenuMac::OnClosed, weak_factory_.GetWeakPtr(), window_id, std::move(callback)); - popup_controllers_[window_id] = base::scoped_nsobject( - [[AtomMenuController alloc] initWithModel:model() - useDefaultAccelerator:NO]); + popup_controllers_[window_id] = base::scoped_nsobject( + [[ElectronMenuController alloc] initWithModel:model() + useDefaultAccelerator:NO]); NSMenu* menu = [popup_controllers_[window_id] menu]; NSView* view = [nswindow contentView]; @@ -150,9 +150,9 @@ void MenuMac::OnClosed(int32_t window_id, base::OnceClosure callback) { // static void Menu::SetApplicationMenu(Menu* base_menu) { MenuMac* menu = static_cast(base_menu); - base::scoped_nsobject menu_controller( - [[AtomMenuController alloc] initWithModel:menu->model_.get() - useDefaultAccelerator:YES]); + base::scoped_nsobject menu_controller( + [[ElectronMenuController alloc] initWithModel:menu->model_.get() + useDefaultAccelerator:YES]); NSRunLoop* currentRunLoop = [NSRunLoop currentRunLoop]; [currentRunLoop cancelPerformSelector:@selector(setMainMenu:) diff --git a/shell/browser/api/atom_api_menu_views.cc b/shell/browser/api/electron_api_menu_views.cc similarity index 98% rename from shell/browser/api/atom_api_menu_views.cc rename to shell/browser/api/electron_api_menu_views.cc index 83098d99a29..4594382651a 100644 --- a/shell/browser/api/atom_api_menu_views.cc +++ b/shell/browser/api/electron_api_menu_views.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_menu_views.h" +#include "shell/browser/api/electron_api_menu_views.h" #include #include diff --git a/shell/browser/api/atom_api_menu_views.h b/shell/browser/api/electron_api_menu_views.h similarity index 82% rename from shell/browser/api/atom_api_menu_views.h rename to shell/browser/api/electron_api_menu_views.h index e32bc8850b2..d7aeb3c9c46 100644 --- a/shell/browser/api/atom_api_menu_views.h +++ b/shell/browser/api/electron_api_menu_views.h @@ -2,14 +2,14 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_MENU_VIEWS_H_ -#define SHELL_BROWSER_API_ATOM_API_MENU_VIEWS_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_MENU_VIEWS_H_ +#define SHELL_BROWSER_API_ELECTRON_API_MENU_VIEWS_H_ #include #include #include "base/memory/weak_ptr.h" -#include "shell/browser/api/atom_api_menu.h" +#include "shell/browser/api/electron_api_menu.h" #include "ui/display/screen.h" #include "ui/views/controls/menu/menu_runner.h" @@ -45,4 +45,4 @@ class MenuViews : public Menu { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_MENU_VIEWS_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_MENU_VIEWS_H_ diff --git a/shell/browser/api/atom_api_native_theme.cc b/shell/browser/api/electron_api_native_theme.cc similarity index 98% rename from shell/browser/api/atom_api_native_theme.cc rename to shell/browser/api/electron_api_native_theme.cc index 114edcf25bb..b12997a0f0b 100644 --- a/shell/browser/api/atom_api_native_theme.cc +++ b/shell/browser/api/electron_api_native_theme.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_native_theme.h" +#include "shell/browser/api/electron_api_native_theme.h" #include diff --git a/shell/browser/api/atom_api_native_theme.h b/shell/browser/api/electron_api_native_theme.h similarity index 91% rename from shell/browser/api/atom_api_native_theme.h rename to shell/browser/api/electron_api_native_theme.h index 632e651fa50..8f82f86f575 100644 --- a/shell/browser/api/atom_api_native_theme.h +++ b/shell/browser/api/electron_api_native_theme.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_ -#define SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_NATIVE_THEME_H_ +#define SHELL_BROWSER_API_ELECTRON_API_NATIVE_THEME_H_ #include "shell/common/gin_helper/event_emitter.h" #include "ui/native_theme/native_theme.h" @@ -62,4 +62,4 @@ struct Converter { } // namespace gin -#endif // SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_NATIVE_THEME_H_ diff --git a/shell/browser/api/atom_api_native_theme_mac.mm b/shell/browser/api/electron_api_native_theme_mac.mm similarity index 90% rename from shell/browser/api/atom_api_native_theme_mac.mm rename to shell/browser/api/electron_api_native_theme_mac.mm index 04e25a2ef4a..2dab1ea61ae 100644 --- a/shell/browser/api/atom_api_native_theme_mac.mm +++ b/shell/browser/api/electron_api_native_theme_mac.mm @@ -2,10 +2,10 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_native_theme.h" +#include "shell/browser/api/electron_api_native_theme.h" #include "base/mac/sdk_forward_declarations.h" -#include "shell/browser/mac/atom_application.h" +#include "shell/browser/mac/electron_application.h" namespace electron { diff --git a/shell/browser/api/atom_api_net.cc b/shell/browser/api/electron_api_net.cc similarity index 95% rename from shell/browser/api/atom_api_net.cc rename to shell/browser/api/electron_api_net.cc index d3b4dbe0b33..77e045aa011 100644 --- a/shell/browser/api/atom_api_net.cc +++ b/shell/browser/api/electron_api_net.cc @@ -2,13 +2,13 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_net.h" +#include "shell/browser/api/electron_api_net.h" #include #include "gin/handle.h" #include "services/network/public/cpp/features.h" -#include "shell/browser/api/atom_api_url_loader.h" +#include "shell/browser/api/electron_api_url_loader.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" diff --git a/shell/browser/api/atom_api_net.h b/shell/browser/api/electron_api_net.h similarity index 82% rename from shell/browser/api/atom_api_net.h rename to shell/browser/api/electron_api_net.h index 0c2c04a0219..82e09eb8f90 100644 --- a/shell/browser/api/atom_api_net.h +++ b/shell/browser/api/electron_api_net.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_NET_H_ -#define SHELL_BROWSER_API_ATOM_API_NET_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_NET_H_ +#define SHELL_BROWSER_API_ELECTRON_API_NET_H_ #include "shell/common/gin_helper/wrappable.h" @@ -32,4 +32,4 @@ class Net : public gin_helper::Wrappable { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_NET_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_NET_H_ diff --git a/shell/browser/api/atom_api_net_log.cc b/shell/browser/api/electron_api_net_log.cc similarity index 96% rename from shell/browser/api/atom_api_net_log.cc rename to shell/browser/api/electron_api_net_log.cc index f073dcedf94..5cb58b9cc23 100644 --- a/shell/browser/api/atom_api_net_log.cc +++ b/shell/browser/api/electron_api_net_log.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_net_log.h" +#include "shell/browser/api/electron_api_net_log.h" #include @@ -11,7 +11,7 @@ #include "components/net_log/chrome_net_log.h" #include "content/public/browser/storage_partition.h" #include "electron/electron_version.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" #include "shell/browser/net/system_network_context_manager.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_helper/dictionary.h" @@ -75,7 +75,7 @@ void ResolvePromiseWithNetError(gin_helper::Promise promise, namespace api { -NetLog::NetLog(v8::Isolate* isolate, AtomBrowserContext* browser_context) +NetLog::NetLog(v8::Isolate* isolate, ElectronBrowserContext* browser_context) : browser_context_(browser_context), weak_ptr_factory_(this) { Init(isolate); file_task_runner_ = CreateFileTaskRunner(); @@ -213,7 +213,7 @@ v8::Local NetLog::StopLogging(gin_helper::Arguments* args) { // static gin::Handle NetLog::Create(v8::Isolate* isolate, - AtomBrowserContext* browser_context) { + ElectronBrowserContext* browser_context) { return gin::CreateHandle(isolate, new NetLog(isolate, browser_context)); } diff --git a/shell/browser/api/atom_api_net_log.h b/shell/browser/api/electron_api_net_log.h similarity index 81% rename from shell/browser/api/atom_api_net_log.h rename to shell/browser/api/electron_api_net_log.h index b70db5cc887..d70b4d3aeab 100644 --- a/shell/browser/api/atom_api_net_log.h +++ b/shell/browser/api/electron_api_net_log.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_NET_LOG_H_ -#define SHELL_BROWSER_API_ATOM_API_NET_LOG_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_NET_LOG_H_ +#define SHELL_BROWSER_API_ELECTRON_API_NET_LOG_H_ #include #include @@ -19,14 +19,14 @@ namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; namespace api { class NetLog : public gin_helper::TrackableObject { public: static gin::Handle Create(v8::Isolate* isolate, - AtomBrowserContext* browser_context); + ElectronBrowserContext* browser_context); static void BuildPrototype(v8::Isolate* isolate, v8::Local prototype); @@ -37,7 +37,8 @@ class NetLog : public gin_helper::TrackableObject { bool IsCurrentlyLogging() const; protected: - explicit NetLog(v8::Isolate* isolate, AtomBrowserContext* browser_context); + explicit NetLog(v8::Isolate* isolate, + ElectronBrowserContext* browser_context); ~NetLog() override; void OnConnectionError(); @@ -49,7 +50,7 @@ class NetLog : public gin_helper::TrackableObject { void NetLogStarted(int32_t error); private: - AtomBrowserContext* browser_context_; + ElectronBrowserContext* browser_context_; network::mojom::NetLogExporterPtr net_log_exporter_; @@ -66,4 +67,4 @@ class NetLog : public gin_helper::TrackableObject { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_NET_LOG_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_NET_LOG_H_ diff --git a/shell/browser/api/atom_api_notification.cc b/shell/browser/api/electron_api_notification.cc similarity index 96% rename from shell/browser/api/atom_api_notification.cc rename to shell/browser/api/electron_api_notification.cc index 82ac97fdce2..7a734712983 100644 --- a/shell/browser/api/atom_api_notification.cc +++ b/shell/browser/api/electron_api_notification.cc @@ -2,13 +2,13 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_notification.h" +#include "shell/browser/api/electron_api_notification.h" #include "base/guid.h" #include "base/strings/utf_string_conversions.h" -#include "shell/browser/api/atom_api_menu.h" -#include "shell/browser/atom_browser_client.h" +#include "shell/browser/api/electron_api_menu.h" #include "shell/browser/browser.h" +#include "shell/browser/electron_browser_client.h" #include "shell/common/gin_converters/image_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" @@ -51,7 +51,7 @@ namespace api { Notification::Notification(gin::Arguments* args) { InitWithArgs(args); - presenter_ = static_cast(AtomBrowserClient::Get()) + presenter_ = static_cast(ElectronBrowserClient::Get()) ->GetNotificationPresenter(); gin::Dictionary opts(nullptr); @@ -236,7 +236,7 @@ void Notification::Show() { } bool Notification::IsSupported() { - return !!static_cast(AtomBrowserClient::Get()) + return !!static_cast(ElectronBrowserClient::Get()) ->GetNotificationPresenter(); } diff --git a/shell/browser/api/atom_api_notification.h b/shell/browser/api/electron_api_notification.h similarity index 94% rename from shell/browser/api/atom_api_notification.h rename to shell/browser/api/electron_api_notification.h index badd9e896c4..d903ff050c9 100644 --- a/shell/browser/api/atom_api_notification.h +++ b/shell/browser/api/electron_api_notification.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_NOTIFICATION_H_ -#define SHELL_BROWSER_API_ATOM_API_NOTIFICATION_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_NOTIFICATION_H_ +#define SHELL_BROWSER_API_ELECTRON_API_NOTIFICATION_H_ #include #include @@ -103,4 +103,4 @@ class Notification : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_NOTIFICATION_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_NOTIFICATION_H_ diff --git a/shell/browser/api/atom_api_power_monitor.cc b/shell/browser/api/electron_api_power_monitor.cc similarity index 98% rename from shell/browser/api/atom_api_power_monitor.cc rename to shell/browser/api/electron_api_power_monitor.cc index 642e879a959..aff350b321e 100644 --- a/shell/browser/api/atom_api_power_monitor.cc +++ b/shell/browser/api/electron_api_power_monitor.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_power_monitor.h" +#include "shell/browser/api/electron_api_power_monitor.h" #include "base/power_monitor/power_monitor.h" #include "base/power_monitor/power_monitor_device_source.h" diff --git a/shell/browser/api/atom_api_power_monitor.h b/shell/browser/api/electron_api_power_monitor.h similarity index 92% rename from shell/browser/api/atom_api_power_monitor.h rename to shell/browser/api/electron_api_power_monitor.h index 762fc153a0a..3bc31487b71 100644 --- a/shell/browser/api/atom_api_power_monitor.h +++ b/shell/browser/api/electron_api_power_monitor.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_POWER_MONITOR_H_ -#define SHELL_BROWSER_API_ATOM_API_POWER_MONITOR_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_POWER_MONITOR_H_ +#define SHELL_BROWSER_API_ELECTRON_API_POWER_MONITOR_H_ #include "base/compiler_specific.h" #include "shell/browser/lib/power_observer.h" @@ -77,4 +77,4 @@ class PowerMonitor : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_POWER_MONITOR_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_POWER_MONITOR_H_ diff --git a/shell/browser/api/atom_api_power_monitor_mac.mm b/shell/browser/api/electron_api_power_monitor_mac.mm similarity index 96% rename from shell/browser/api/atom_api_power_monitor_mac.mm rename to shell/browser/api/electron_api_power_monitor_mac.mm index e34f68efad9..7bad4928564 100644 --- a/shell/browser/api/atom_api_power_monitor_mac.mm +++ b/shell/browser/api/electron_api_power_monitor_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_power_monitor.h" +#include "shell/browser/api/electron_api_power_monitor.h" #include diff --git a/shell/browser/api/atom_api_power_monitor_win.cc b/shell/browser/api/electron_api_power_monitor_win.cc similarity index 97% rename from shell/browser/api/atom_api_power_monitor_win.cc rename to shell/browser/api/electron_api_power_monitor_win.cc index 15d914bd7eb..52c71d7207b 100644 --- a/shell/browser/api/atom_api_power_monitor_win.cc +++ b/shell/browser/api/electron_api_power_monitor_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_power_monitor.h" +#include "shell/browser/api/electron_api_power_monitor.h" #include #include diff --git a/shell/browser/api/atom_api_power_save_blocker.cc b/shell/browser/api/electron_api_power_save_blocker.cc similarity index 98% rename from shell/browser/api/atom_api_power_save_blocker.cc rename to shell/browser/api/electron_api_power_save_blocker.cc index b3c8f468494..703f8a870ec 100644 --- a/shell/browser/api/atom_api_power_save_blocker.cc +++ b/shell/browser/api/electron_api_power_save_blocker.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_power_save_blocker.h" +#include "shell/browser/api/electron_api_power_save_blocker.h" #include diff --git a/shell/browser/api/atom_api_power_save_blocker.h b/shell/browser/api/electron_api_power_save_blocker.h similarity index 88% rename from shell/browser/api/atom_api_power_save_blocker.h rename to shell/browser/api/electron_api_power_save_blocker.h index cb1e7344a6a..2a5ad80afe9 100644 --- a/shell/browser/api/atom_api_power_save_blocker.h +++ b/shell/browser/api/electron_api_power_save_blocker.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_POWER_SAVE_BLOCKER_H_ -#define SHELL_BROWSER_API_ATOM_API_POWER_SAVE_BLOCKER_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_POWER_SAVE_BLOCKER_H_ +#define SHELL_BROWSER_API_ELECTRON_API_POWER_SAVE_BLOCKER_H_ #include #include @@ -59,4 +59,4 @@ class PowerSaveBlocker : public gin::Wrappable { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_POWER_SAVE_BLOCKER_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_POWER_SAVE_BLOCKER_H_ diff --git a/shell/browser/api/atom_api_protocol.cc b/shell/browser/api/electron_api_protocol.cc similarity index 96% rename from shell/browser/api/atom_api_protocol.cc rename to shell/browser/api/electron_api_protocol.cc index 17342225192..aca1d16653f 100644 --- a/shell/browser/api/atom_api_protocol.cc +++ b/shell/browser/api/electron_api_protocol.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_protocol.h" +#include "shell/browser/api/electron_api_protocol.h" #include #include @@ -10,8 +10,8 @@ #include "base/stl_util.h" #include "content/public/browser/child_process_security_policy.h" -#include "shell/browser/atom_browser_context.h" #include "shell/browser/browser.h" +#include "shell/browser/electron_browser_context.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/net_converter.h" #include "shell/common/gin_helper/dictionary.h" @@ -160,7 +160,8 @@ std::string ErrorCodeToString(ProtocolError error) { } // namespace -Protocol::Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context) { +Protocol::Protocol(v8::Isolate* isolate, + ElectronBrowserContext* browser_context) { Init(isolate); AttachAsUserData(browser_context); } @@ -170,7 +171,7 @@ Protocol::~Protocol() = default; void Protocol::RegisterURLLoaderFactories( content::ContentBrowserClient::NonNetworkURLLoaderFactoryMap* factories) { for (const auto& it : handlers_) { - factories->emplace(it.first, std::make_unique( + factories->emplace(it.first, std::make_unique( it.second.first, it.second.second)); } } @@ -253,8 +254,9 @@ void Protocol::HandleOptionalCallback(gin::Arguments* args, } // static -gin::Handle Protocol::Create(v8::Isolate* isolate, - AtomBrowserContext* browser_context) { +gin::Handle Protocol::Create( + v8::Isolate* isolate, + ElectronBrowserContext* browser_context) { return gin::CreateHandle(isolate, new Protocol(isolate, browser_context)); } diff --git a/shell/browser/api/atom_api_protocol.h b/shell/browser/api/electron_api_protocol.h similarity index 86% rename from shell/browser/api/atom_api_protocol.h rename to shell/browser/api/electron_api_protocol.h index 0fd7c5d0e5f..f52288bf43a 100644 --- a/shell/browser/api/atom_api_protocol.h +++ b/shell/browser/api/electron_api_protocol.h @@ -2,21 +2,21 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_PROTOCOL_H_ -#define SHELL_BROWSER_API_ATOM_API_PROTOCOL_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_PROTOCOL_H_ +#define SHELL_BROWSER_API_ELECTRON_API_PROTOCOL_H_ #include #include #include "content/public/browser/content_browser_client.h" #include "gin/handle.h" -#include "shell/browser/net/atom_url_loader_factory.h" +#include "shell/browser/net/electron_url_loader_factory.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/trackable_object.h" namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; namespace api { @@ -38,19 +38,19 @@ enum class ProtocolError { class Protocol : public gin_helper::TrackableObject { public: static gin::Handle Create(v8::Isolate* isolate, - AtomBrowserContext* browser_context); + ElectronBrowserContext* browser_context); static void BuildPrototype(v8::Isolate* isolate, v8::Local prototype); - // Used by AtomBrowserClient for creating URLLoaderFactory. + // Used by ElectronBrowserClient for creating URLLoaderFactory. void RegisterURLLoaderFactories( content::ContentBrowserClient::NonNetworkURLLoaderFactoryMap* factories); const HandlersMap& intercept_handlers() const { return intercept_handlers_; } private: - Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context); + Protocol(v8::Isolate* isolate, ElectronBrowserContext* browser_context); ~Protocol() override; // Callback types. @@ -99,4 +99,4 @@ class Protocol : public gin_helper::TrackableObject { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_PROTOCOL_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_PROTOCOL_H_ diff --git a/shell/browser/api/atom_api_screen.cc b/shell/browser/api/electron_api_screen.cc similarity index 99% rename from shell/browser/api/atom_api_screen.cc rename to shell/browser/api/electron_api_screen.cc index 8ce966d74e5..f5bdd254518 100644 --- a/shell/browser/api/atom_api_screen.cc +++ b/shell/browser/api/electron_api_screen.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_screen.h" +#include "shell/browser/api/electron_api_screen.h" #include #include diff --git a/shell/browser/api/atom_api_screen.h b/shell/browser/api/electron_api_screen.h similarity index 91% rename from shell/browser/api/atom_api_screen.h rename to shell/browser/api/electron_api_screen.h index fe6a7e540dd..56700c1c667 100644 --- a/shell/browser/api/atom_api_screen.h +++ b/shell/browser/api/electron_api_screen.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_SCREEN_H_ -#define SHELL_BROWSER_API_ATOM_API_SCREEN_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_SCREEN_H_ +#define SHELL_BROWSER_API_ELECTRON_API_SCREEN_H_ #include @@ -56,4 +56,4 @@ class Screen : public gin_helper::EventEmitter, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_SCREEN_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_SCREEN_H_ diff --git a/shell/browser/api/atom_api_session.cc b/shell/browser/api/electron_api_session.cc similarity index 95% rename from shell/browser/api/atom_api_session.cc rename to shell/browser/api/electron_api_session.cc index 877e5e6dbd8..4ef1a141c6f 100644 --- a/shell/browser/api/atom_api_session.cc +++ b/shell/browser/api/electron_api_session.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_session.h" +#include "shell/browser/api/electron_api_session.h" #include #include @@ -40,16 +40,16 @@ #include "net/http/http_cache.h" #include "services/network/network_service.h" #include "services/network/public/cpp/features.h" -#include "shell/browser/api/atom_api_cookies.h" -#include "shell/browser/api/atom_api_data_pipe_holder.h" -#include "shell/browser/api/atom_api_download_item.h" -#include "shell/browser/api/atom_api_net_log.h" -#include "shell/browser/api/atom_api_protocol.h" -#include "shell/browser/api/atom_api_web_request.h" -#include "shell/browser/atom_browser_context.h" -#include "shell/browser/atom_browser_main_parts.h" -#include "shell/browser/atom_permission_manager.h" +#include "shell/browser/api/electron_api_cookies.h" +#include "shell/browser/api/electron_api_data_pipe_holder.h" +#include "shell/browser/api/electron_api_download_item.h" +#include "shell/browser/api/electron_api_net_log.h" +#include "shell/browser/api/electron_api_protocol.h" +#include "shell/browser/api/electron_api_web_request.h" #include "shell/browser/browser.h" +#include "shell/browser/electron_browser_context.h" +#include "shell/browser/electron_browser_main_parts.h" +#include "shell/browser/electron_permission_manager.h" #include "shell/browser/media/media_device_id_salt.h" #include "shell/browser/net/cert_verifier_client.h" #include "shell/browser/session_preferences.h" @@ -228,7 +228,7 @@ void DestroyGlobalHandle(v8::Isolate* isolate, } // namespace -Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context) +Session::Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context) : network_emulation_token_(base::UnguessableToken::Create()), browser_context_(browser_context) { // Observe DownloadManager to get download notifications. @@ -454,23 +454,23 @@ void Session::SetCertVerifyProc(v8::Local val, void Session::SetPermissionRequestHandler(v8::Local val, gin_helper::Arguments* args) { - auto* permission_manager = static_cast( + auto* permission_manager = static_cast( browser_context()->GetPermissionControllerDelegate()); if (val->IsNull()) { permission_manager->SetPermissionRequestHandler( - AtomPermissionManager::RequestHandler()); + ElectronPermissionManager::RequestHandler()); return; } - auto handler = std::make_unique(); + auto handler = std::make_unique(); if (!gin::ConvertFromV8(args->isolate(), val, handler.get())) { args->ThrowError("Must pass null or function"); return; } permission_manager->SetPermissionRequestHandler(base::BindRepeating( - [](AtomPermissionManager::RequestHandler* handler, + [](ElectronPermissionManager::RequestHandler* handler, content::WebContents* web_contents, content::PermissionType permission_type, - AtomPermissionManager::StatusCallback callback, + ElectronPermissionManager::StatusCallback callback, const base::Value& details) { handler->Run(web_contents, permission_type, base::AdaptCallbackForRepeating(std::move(callback)), @@ -481,12 +481,12 @@ void Session::SetPermissionRequestHandler(v8::Local val, void Session::SetPermissionCheckHandler(v8::Local val, gin_helper::Arguments* args) { - AtomPermissionManager::CheckHandler handler; + ElectronPermissionManager::CheckHandler handler; if (!(val->IsNull() || gin::ConvertFromV8(args->isolate(), val, &handler))) { args->ThrowError("Must pass null or function"); return; } - auto* permission_manager = static_cast( + auto* permission_manager = static_cast( browser_context()->GetPermissionControllerDelegate()); permission_manager->SetPermissionCheckHandler(handler); } @@ -695,7 +695,7 @@ v8::Local Session::NetLog(v8::Isolate* isolate) { } static void StartPreconnectOnUI( - scoped_refptr browser_context, + scoped_refptr browser_context, const GURL& url, int num_sockets_to_preconnect) { std::vector requests = { @@ -782,8 +782,9 @@ bool Session::AddWordToSpellCheckerDictionary(const std::string& word) { #endif // static -gin::Handle Session::CreateFrom(v8::Isolate* isolate, - AtomBrowserContext* browser_context) { +gin::Handle Session::CreateFrom( + v8::Isolate* isolate, + ElectronBrowserContext* browser_context) { auto* existing = TrackableObject::FromWrappedClass(isolate, browser_context); if (existing) return gin::CreateHandle(isolate, static_cast(existing)); @@ -803,16 +804,18 @@ gin::Handle Session::CreateFrom(v8::Isolate* isolate, gin::Handle Session::FromPartition(v8::Isolate* isolate, const std::string& partition, base::DictionaryValue options) { - scoped_refptr browser_context; + scoped_refptr browser_context; if (partition.empty()) { - browser_context = AtomBrowserContext::From("", false, std::move(options)); + browser_context = + ElectronBrowserContext::From("", false, std::move(options)); } else if (base::StartsWith(partition, kPersistPrefix, base::CompareCase::SENSITIVE)) { std::string name = partition.substr(8); - browser_context = AtomBrowserContext::From(name, false, std::move(options)); + browser_context = + ElectronBrowserContext::From(name, false, std::move(options)); } else { browser_context = - AtomBrowserContext::From(partition, true, std::move(options)); + ElectronBrowserContext::From(partition, true, std::move(options)); } return CreateFrom(isolate, browser_context.get()); } diff --git a/shell/browser/api/atom_api_session.h b/shell/browser/api/electron_api_session.h similarity index 89% rename from shell/browser/api/atom_api_session.h rename to shell/browser/api/electron_api_session.h index e2914b23286..c162e474fd5 100644 --- a/shell/browser/api/atom_api_session.h +++ b/shell/browser/api/electron_api_session.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_SESSION_H_ -#define SHELL_BROWSER_API_ATOM_API_SESSION_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_SESSION_H_ +#define SHELL_BROWSER_API_ELECTRON_API_SESSION_H_ #include #include @@ -32,7 +32,7 @@ class ProxyConfig; namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; namespace api { @@ -40,8 +40,9 @@ class Session : public gin_helper::TrackableObject, public content::DownloadManager::Observer { public: // Gets or creates Session from the |browser_context|. - static gin::Handle CreateFrom(v8::Isolate* isolate, - AtomBrowserContext* browser_context); + static gin::Handle CreateFrom( + v8::Isolate* isolate, + ElectronBrowserContext* browser_context); // Gets the Session of |partition|. static gin::Handle FromPartition( @@ -49,7 +50,9 @@ class Session : public gin_helper::TrackableObject, const std::string& partition, base::DictionaryValue options = base::DictionaryValue()); - AtomBrowserContext* browser_context() const { return browser_context_.get(); } + ElectronBrowserContext* browser_context() const { + return browser_context_.get(); + } // gin_helper::TrackableObject: static void BuildPrototype(v8::Isolate* isolate, @@ -103,7 +106,7 @@ class Session : public gin_helper::TrackableObject, #endif protected: - Session(v8::Isolate* isolate, AtomBrowserContext* browser_context); + Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context); ~Session() override; // content::DownloadManager::Observer: @@ -122,7 +125,7 @@ class Session : public gin_helper::TrackableObject, // The client id to enable the network throttler. base::UnguessableToken network_emulation_token_; - scoped_refptr browser_context_; + scoped_refptr browser_context_; DISALLOW_COPY_AND_ASSIGN(Session); }; @@ -131,4 +134,4 @@ class Session : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_SESSION_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_SESSION_H_ diff --git a/shell/browser/api/atom_api_system_preferences.cc b/shell/browser/api/electron_api_system_preferences.cc similarity index 98% rename from shell/browser/api/atom_api_system_preferences.cc rename to shell/browser/api/electron_api_system_preferences.cc index ddf946928c0..372c91db8b2 100644 --- a/shell/browser/api/atom_api_system_preferences.cc +++ b/shell/browser/api/electron_api_system_preferences.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_system_preferences.h" +#include "shell/browser/api/electron_api_system_preferences.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/value_converter.h" diff --git a/shell/browser/api/atom_api_system_preferences.h b/shell/browser/api/electron_api_system_preferences.h similarity index 96% rename from shell/browser/api/atom_api_system_preferences.h rename to shell/browser/api/electron_api_system_preferences.h index 5b24ba7d64c..0b465226b80 100644 --- a/shell/browser/api/atom_api_system_preferences.h +++ b/shell/browser/api/electron_api_system_preferences.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_ -#define SHELL_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_SYSTEM_PREFERENCES_H_ +#define SHELL_BROWSER_API_ELECTRON_API_SYSTEM_PREFERENCES_H_ #include #include @@ -165,4 +165,4 @@ class SystemPreferences : public gin_helper::EventEmitter } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_SYSTEM_PREFERENCES_H_ diff --git a/shell/browser/api/atom_api_system_preferences_mac.mm b/shell/browser/api/electron_api_system_preferences_mac.mm similarity index 99% rename from shell/browser/api/atom_api_system_preferences_mac.mm rename to shell/browser/api/electron_api_system_preferences_mac.mm index d4be5ce3ded..29e8aea2f94 100644 --- a/shell/browser/api/atom_api_system_preferences_mac.mm +++ b/shell/browser/api/electron_api_system_preferences_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_system_preferences.h" +#include "shell/browser/api/electron_api_system_preferences.h" #include #include @@ -23,8 +23,8 @@ #include "base/values.h" #include "chrome/browser/media/webrtc/system_media_capture_permissions_mac.h" #include "net/base/mac/url_conversions.h" -#include "shell/browser/mac/atom_application.h" #include "shell/browser/mac/dict_util.h" +#include "shell/browser/mac/electron_application.h" #include "shell/browser/ui/cocoa/NSColor+Hex.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/value_converter.h" diff --git a/shell/browser/api/atom_api_system_preferences_win.cc b/shell/browser/api/electron_api_system_preferences_win.cc similarity index 99% rename from shell/browser/api/atom_api_system_preferences_win.cc rename to shell/browser/api/electron_api_system_preferences_win.cc index 5a991a701c8..4ab67b9e460 100644 --- a/shell/browser/api/atom_api_system_preferences_win.cc +++ b/shell/browser/api/electron_api_system_preferences_win.cc @@ -5,7 +5,7 @@ #include #include -#include "shell/browser/api/atom_api_system_preferences.h" +#include "shell/browser/api/electron_api_system_preferences.h" #include "base/win/wrapped_window_proc.h" #include "shell/common/color_util.h" diff --git a/shell/browser/api/atom_api_top_level_window.cc b/shell/browser/api/electron_api_top_level_window.cc similarity index 99% rename from shell/browser/api/atom_api_top_level_window.cc rename to shell/browser/api/electron_api_top_level_window.cc index b9bf8dfb5c3..4c56504213e 100644 --- a/shell/browser/api/atom_api_top_level_window.cc +++ b/shell/browser/api/electron_api_top_level_window.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_top_level_window.h" +#include "shell/browser/api/electron_api_top_level_window.h" #include #include @@ -10,10 +10,10 @@ #include "electron/buildflags/buildflags.h" #include "gin/dictionary.h" -#include "shell/browser/api/atom_api_browser_view.h" -#include "shell/browser/api/atom_api_menu.h" -#include "shell/browser/api/atom_api_view.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_browser_view.h" +#include "shell/browser/api/electron_api_menu.h" +#include "shell/browser/api/electron_api_view.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/common/color_util.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/file_path_converter.h" diff --git a/shell/browser/api/atom_api_top_level_window.h b/shell/browser/api/electron_api_top_level_window.h similarity index 97% rename from shell/browser/api/atom_api_top_level_window.h rename to shell/browser/api/electron_api_top_level_window.h index 7e69e5ff5a6..33076162015 100644 --- a/shell/browser/api/atom_api_top_level_window.h +++ b/shell/browser/api/electron_api_top_level_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_TOP_LEVEL_WINDOW_H_ -#define SHELL_BROWSER_API_ATOM_API_TOP_LEVEL_WINDOW_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_TOP_LEVEL_WINDOW_H_ +#define SHELL_BROWSER_API_ELECTRON_API_TOP_LEVEL_WINDOW_H_ #include #include @@ -16,7 +16,7 @@ #include "gin/handle.h" #include "shell/browser/native_window.h" #include "shell/browser/native_window_observer.h" -#include "shell/common/api/atom_api_native_image.h" +#include "shell/common/api/electron_api_native_image.h" #include "shell/common/gin_helper/trackable_object.h" namespace electron { @@ -266,4 +266,4 @@ class TopLevelWindow : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_TOP_LEVEL_WINDOW_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_TOP_LEVEL_WINDOW_H_ diff --git a/shell/browser/api/atom_api_tray.cc b/shell/browser/api/electron_api_tray.cc similarity index 98% rename from shell/browser/api/atom_api_tray.cc rename to shell/browser/api/electron_api_tray.cc index 3b49b0c5904..0ca838fb4bf 100644 --- a/shell/browser/api/atom_api_tray.cc +++ b/shell/browser/api/electron_api_tray.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_tray.h" +#include "shell/browser/api/electron_api_tray.h" #include #include "base/threading/thread_task_runner_handle.h" -#include "shell/browser/api/atom_api_menu.h" +#include "shell/browser/api/electron_api_menu.h" #include "shell/browser/browser.h" -#include "shell/common/api/atom_api_native_image.h" +#include "shell/common/api/electron_api_native_image.h" #include "shell/common/gin_converters/gfx_converter.h" #include "shell/common/gin_converters/guid_converter.h" #include "shell/common/gin_converters/image_converter.h" diff --git a/shell/browser/api/atom_api_tray.h b/shell/browser/api/electron_api_tray.h similarity index 95% rename from shell/browser/api/atom_api_tray.h rename to shell/browser/api/electron_api_tray.h index 16258ee331f..0f48301ee50 100644 --- a/shell/browser/api/atom_api_tray.h +++ b/shell/browser/api/electron_api_tray.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_TRAY_H_ -#define SHELL_BROWSER_API_ATOM_API_TRAY_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_TRAY_H_ +#define SHELL_BROWSER_API_ELECTRON_API_TRAY_H_ #include #include @@ -98,4 +98,4 @@ class Tray : public gin_helper::TrackableObject, public TrayIconObserver { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_TRAY_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_TRAY_H_ diff --git a/shell/browser/api/atom_api_url_loader.cc b/shell/browser/api/electron_api_url_loader.cc similarity index 99% rename from shell/browser/api/atom_api_url_loader.cc rename to shell/browser/api/electron_api_url_loader.cc index d813c8a25f1..6ba760b1120 100644 --- a/shell/browser/api/atom_api_url_loader.cc +++ b/shell/browser/api/electron_api_url_loader.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_url_loader.h" +#include "shell/browser/api/electron_api_url_loader.h" #include #include @@ -20,8 +20,8 @@ #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/chunked_data_pipe_getter.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" -#include "shell/browser/api/atom_api_session.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/api/electron_api_session.h" +#include "shell/browser/electron_browser_context.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/net_converter.h" diff --git a/shell/browser/api/atom_api_url_loader.h b/shell/browser/api/electron_api_url_loader.h similarity index 94% rename from shell/browser/api/atom_api_url_loader.h rename to shell/browser/api/electron_api_url_loader.h index 15ce4b4456c..6cffcd91c61 100644 --- a/shell/browser/api/atom_api_url_loader.h +++ b/shell/browser/api/electron_api_url_loader.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_URL_LOADER_H_ -#define SHELL_BROWSER_API_ATOM_API_URL_LOADER_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_URL_LOADER_H_ +#define SHELL_BROWSER_API_ELECTRON_API_URL_LOADER_H_ #include #include @@ -90,4 +90,4 @@ class SimpleURLLoaderWrapper } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_URL_LOADER_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_URL_LOADER_H_ diff --git a/shell/browser/api/atom_api_view.cc b/shell/browser/api/electron_api_view.cc similarity index 98% rename from shell/browser/api/atom_api_view.cc rename to shell/browser/api/electron_api_view.cc index 068dc2b59f6..832b55292e6 100644 --- a/shell/browser/api/atom_api_view.cc +++ b/shell/browser/api/electron_api_view.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_view.h" +#include "shell/browser/api/electron_api_view.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" diff --git a/shell/browser/api/atom_api_view.h b/shell/browser/api/electron_api_view.h similarity index 88% rename from shell/browser/api/atom_api_view.h rename to shell/browser/api/electron_api_view.h index 0244e64ee67..cdb14a07bf6 100644 --- a/shell/browser/api/atom_api_view.h +++ b/shell/browser/api/electron_api_view.h @@ -2,15 +2,15 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_VIEW_H_ -#define SHELL_BROWSER_API_ATOM_API_VIEW_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_VIEW_H_ +#define SHELL_BROWSER_API_ELECTRON_API_VIEW_H_ #include #include #include "electron/buildflags/buildflags.h" #include "gin/handle.h" -#include "shell/browser/api/views/atom_api_layout_manager.h" +#include "shell/browser/api/views/electron_api_layout_manager.h" #include "ui/views/view.h" namespace electron { @@ -71,4 +71,4 @@ struct Converter { } // namespace gin -#endif // SHELL_BROWSER_API_ATOM_API_VIEW_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_VIEW_H_ diff --git a/shell/browser/api/atom_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc similarity index 98% rename from shell/browser/api/atom_api_web_contents.cc rename to shell/browser/api/electron_api_web_contents.cc index 6d54c36e7d8..afc39b682ac 100644 --- a/shell/browser/api/atom_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include #include @@ -47,17 +47,17 @@ #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/system/platform_handle.h" #include "ppapi/buildflags/buildflags.h" -#include "shell/browser/api/atom_api_browser_window.h" -#include "shell/browser/api/atom_api_debugger.h" -#include "shell/browser/api/atom_api_session.h" -#include "shell/browser/atom_autofill_driver_factory.h" -#include "shell/browser/atom_browser_client.h" -#include "shell/browser/atom_browser_context.h" -#include "shell/browser/atom_browser_main_parts.h" -#include "shell/browser/atom_javascript_dialog_manager.h" -#include "shell/browser/atom_navigation_throttle.h" +#include "shell/browser/api/electron_api_browser_window.h" +#include "shell/browser/api/electron_api_debugger.h" +#include "shell/browser/api/electron_api_session.h" #include "shell/browser/browser.h" #include "shell/browser/child_web_contents_tracker.h" +#include "shell/browser/electron_autofill_driver_factory.h" +#include "shell/browser/electron_browser_client.h" +#include "shell/browser/electron_browser_context.h" +#include "shell/browser/electron_browser_main_parts.h" +#include "shell/browser/electron_javascript_dialog_manager.h" +#include "shell/browser/electron_navigation_throttle.h" #include "shell/browser/lib/bluetooth_chooser.h" #include "shell/browser/native_window.h" #include "shell/browser/session_preferences.h" @@ -68,7 +68,7 @@ #include "shell/browser/web_contents_preferences.h" #include "shell/browser/web_contents_zoom_controller.h" #include "shell/browser/web_view_guest_delegate.h" -#include "shell/common/api/atom_api_native_image.h" +#include "shell/common/api/electron_api_native_image.h" #include "shell/common/color_util.h" #include "shell/common/gin_converters/blink_converter.h" #include "shell/common/gin_converters/callback_converter.h" @@ -882,7 +882,7 @@ std::unique_ptr WebContents::RunBluetoothChooser( content::JavaScriptDialogManager* WebContents::GetJavaScriptDialogManager( content::WebContents* source) { if (!dialog_manager_) - dialog_manager_ = std::make_unique(this); + dialog_manager_ = std::make_unique(this); return dialog_manager_.get(); } @@ -1500,17 +1500,17 @@ void WebContents::Stop() { } void WebContents::GoBack() { - electron::AtomBrowserClient::SuppressRendererProcessRestartForOnce(); + electron::ElectronBrowserClient::SuppressRendererProcessRestartForOnce(); web_contents()->GetController().GoBack(); } void WebContents::GoForward() { - electron::AtomBrowserClient::SuppressRendererProcessRestartForOnce(); + electron::ElectronBrowserClient::SuppressRendererProcessRestartForOnce(); web_contents()->GetController().GoForward(); } void WebContents::GoToOffset(int offset) { - electron::AtomBrowserClient::SuppressRendererProcessRestartForOnce(); + electron::ElectronBrowserClient::SuppressRendererProcessRestartForOnce(); web_contents()->GetController().GoToOffset(offset); } @@ -2687,8 +2687,9 @@ void WebContents::BuildPrototype(v8::Isolate* isolate, .SetProperty("debugger", &WebContents::Debugger); } -AtomBrowserContext* WebContents::GetBrowserContext() const { - return static_cast(web_contents()->GetBrowserContext()); +ElectronBrowserContext* WebContents::GetBrowserContext() const { + return static_cast( + web_contents()->GetBrowserContext()); } // static diff --git a/shell/browser/api/atom_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h similarity index 98% rename from shell/browser/api/atom_api_web_contents.h rename to shell/browser/api/electron_api_web_contents.h index 311722030c9..a4ff3ee4335 100644 --- a/shell/browser/api/atom_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_WEB_CONTENTS_H_ -#define SHELL_BROWSER_API_ATOM_API_WEB_CONTENTS_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_H_ +#define SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_H_ #include #include @@ -60,8 +60,8 @@ class ResourceRequestBody; namespace electron { -class AtomBrowserContext; -class AtomJavaScriptDialogManager; +class ElectronBrowserContext; +class ElectronJavaScriptDialogManager; class InspectableWebContents; class WebContentsZoomController; class WebViewGuestDelegate; @@ -497,7 +497,7 @@ class WebContents : public gin_helper::TrackableObject, void DevToolsClosed() override; private: - AtomBrowserContext* GetBrowserContext() const; + ElectronBrowserContext* GetBrowserContext() const; // Binds the given request for the ElectronBrowser API. When the // RenderFrameHost is destroyed, all related bindings will be removed. @@ -556,7 +556,7 @@ class WebContents : public gin_helper::TrackableObject, v8::Global devtools_web_contents_; v8::Global debugger_; - std::unique_ptr dialog_manager_; + std::unique_ptr dialog_manager_; std::unique_ptr guest_delegate_; std::unique_ptr frame_subscriber_; @@ -603,4 +603,4 @@ class WebContents : public gin_helper::TrackableObject, } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_WEB_CONTENTS_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_H_ diff --git a/shell/browser/api/atom_api_web_contents_impl.cc b/shell/browser/api/electron_api_web_contents_impl.cc similarity index 97% rename from shell/browser/api/atom_api_web_contents_impl.cc rename to shell/browser/api/electron_api_web_contents_impl.cc index 2bb2175b8bb..dac25517b5d 100644 --- a/shell/browser/api/atom_api_web_contents_impl.cc +++ b/shell/browser/api/electron_api_web_contents_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "content/browser/frame_host/frame_tree.h" // nogncheck #include "content/browser/frame_host/frame_tree_node.h" // nogncheck diff --git a/shell/browser/api/atom_api_web_contents_mac.mm b/shell/browser/api/electron_api_web_contents_mac.mm similarity index 93% rename from shell/browser/api/atom_api_web_contents_mac.mm rename to shell/browser/api/electron_api_web_contents_mac.mm index a0fd14a000e..ea70eed08d5 100644 --- a/shell/browser/api/atom_api_web_contents_mac.mm +++ b/shell/browser/api/electron_api_web_contents_mac.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "content/public/browser/render_widget_host_view.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #import diff --git a/shell/browser/api/atom_api_web_contents_view.cc b/shell/browser/api/electron_api_web_contents_view.cc similarity index 97% rename from shell/browser/api/atom_api_web_contents_view.cc rename to shell/browser/api/electron_api_web_contents_view.cc index 7f5127b6dd6..b5e8fcfb3e5 100644 --- a/shell/browser/api/atom_api_web_contents_view.cc +++ b/shell/browser/api/electron_api_web_contents_view.cc @@ -2,10 +2,10 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_web_contents_view.h" +#include "shell/browser/api/electron_api_web_contents_view.h" #include "content/public/browser/web_contents_user_data.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/browser.h" #include "shell/browser/ui/inspectable_web_contents_view.h" #include "shell/common/gin_helper/constructor.h" diff --git a/shell/browser/api/atom_api_web_contents_view.h b/shell/browser/api/electron_api_web_contents_view.h similarity index 82% rename from shell/browser/api/atom_api_web_contents_view.h rename to shell/browser/api/electron_api_web_contents_view.h index f9a9fa4c100..ad43630eb1c 100644 --- a/shell/browser/api/atom_api_web_contents_view.h +++ b/shell/browser/api/electron_api_web_contents_view.h @@ -2,11 +2,11 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_WEB_CONTENTS_VIEW_H_ -#define SHELL_BROWSER_API_ATOM_API_WEB_CONTENTS_VIEW_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_VIEW_H_ +#define SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_VIEW_H_ #include "content/public/browser/web_contents_observer.h" -#include "shell/browser/api/atom_api_view.h" +#include "shell/browser/api/electron_api_view.h" namespace electron { @@ -45,4 +45,4 @@ class WebContentsView : public View, public content::WebContentsObserver { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_WEB_CONTENTS_VIEW_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_VIEW_H_ diff --git a/shell/browser/api/atom_api_web_request.cc b/shell/browser/api/electron_api_web_request.cc similarity index 98% rename from shell/browser/api/atom_api_web_request.cc rename to shell/browser/api/electron_api_web_request.cc index 0d162f15f1b..71b5a031bde 100644 --- a/shell/browser/api/atom_api_web_request.cc +++ b/shell/browser/api/electron_api_web_request.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/atom_api_web_request.h" +#include "shell/browser/api/electron_api_web_request.h" #include #include @@ -13,9 +13,9 @@ #include "gin/converter.h" #include "gin/dictionary.h" #include "gin/object_template_builder.h" -#include "shell/browser/api/atom_api_session.h" -#include "shell/browser/api/atom_api_web_contents.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/api/electron_api_session.h" +#include "shell/browser/api/electron_api_web_contents.h" +#include "shell/browser/electron_browser_context.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/net_converter.h" @@ -479,8 +479,8 @@ gin::Handle WebRequest::FromOrCreate( if (handle.IsEmpty()) { // Make sure the |Session| object has the |webRequest| property created. v8::Local web_request = - Session::CreateFrom(isolate, - static_cast(browser_context)) + Session::CreateFrom( + isolate, static_cast(browser_context)) ->WebRequest(isolate); gin::ConvertFromV8(isolate, web_request, &handle); } diff --git a/shell/browser/api/atom_api_web_request.h b/shell/browser/api/electron_api_web_request.h similarity index 97% rename from shell/browser/api/atom_api_web_request.h rename to shell/browser/api/electron_api_web_request.h index 38feefe1766..a277c158d06 100644 --- a/shell/browser/api/atom_api_web_request.h +++ b/shell/browser/api/electron_api_web_request.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_ATOM_API_WEB_REQUEST_H_ -#define SHELL_BROWSER_API_ATOM_API_WEB_REQUEST_H_ +#ifndef SHELL_BROWSER_API_ELECTRON_API_WEB_REQUEST_H_ +#define SHELL_BROWSER_API_ELECTRON_API_WEB_REQUEST_H_ #include #include @@ -155,4 +155,4 @@ class WebRequest : public gin::Wrappable, public WebRequestAPI { } // namespace electron -#endif // SHELL_BROWSER_API_ATOM_API_WEB_REQUEST_H_ +#endif // SHELL_BROWSER_API_ELECTRON_API_WEB_REQUEST_H_ diff --git a/shell/browser/api/atom_api_web_view_manager.cc b/shell/browser/api/electron_api_web_view_manager.cc similarity index 100% rename from shell/browser/api/atom_api_web_view_manager.cc rename to shell/browser/api/electron_api_web_view_manager.cc diff --git a/shell/browser/api/save_page_handler.cc b/shell/browser/api/save_page_handler.cc index b41e8cc6a5f..617aa1f8cca 100644 --- a/shell/browser/api/save_page_handler.cc +++ b/shell/browser/api/save_page_handler.cc @@ -10,7 +10,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "content/public/browser/web_contents.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" namespace electron { diff --git a/shell/browser/api/views/atom_api_box_layout.cc b/shell/browser/api/views/electron_api_box_layout.cc similarity index 95% rename from shell/browser/api/views/atom_api_box_layout.cc rename to shell/browser/api/views/electron_api_box_layout.cc index 91b75698cf4..f4d52e9a5a6 100644 --- a/shell/browser/api/views/atom_api_box_layout.cc +++ b/shell/browser/api/views/electron_api_box_layout.cc @@ -2,11 +2,11 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/views/atom_api_box_layout.h" +#include "shell/browser/api/views/electron_api_box_layout.h" #include -#include "shell/browser/api/atom_api_view.h" +#include "shell/browser/api/electron_api_view.h" #include "shell/common/gin_helper/constructor.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/node_includes.h" diff --git a/shell/browser/api/views/atom_api_box_layout.h b/shell/browser/api/views/electron_api_box_layout.h similarity index 76% rename from shell/browser/api/views/atom_api_box_layout.h rename to shell/browser/api/views/electron_api_box_layout.h index 9f84a8360cd..74fd50ca8d1 100644 --- a/shell/browser/api/views/atom_api_box_layout.h +++ b/shell/browser/api/views/electron_api_box_layout.h @@ -2,11 +2,11 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_BOX_LAYOUT_H_ -#define SHELL_BROWSER_API_VIEWS_ATOM_API_BOX_LAYOUT_H_ +#ifndef SHELL_BROWSER_API_VIEWS_ELECTRON_API_BOX_LAYOUT_H_ +#define SHELL_BROWSER_API_VIEWS_ELECTRON_API_BOX_LAYOUT_H_ #include "gin/handle.h" -#include "shell/browser/api/views/atom_api_layout_manager.h" +#include "shell/browser/api/views/electron_api_layout_manager.h" #include "ui/views/layout/box_layout.h" namespace electron { @@ -38,4 +38,4 @@ class BoxLayout : public LayoutManager { } // namespace electron -#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_BOX_LAYOUT_H_ +#endif // SHELL_BROWSER_API_VIEWS_ELECTRON_API_BOX_LAYOUT_H_ diff --git a/shell/browser/api/views/atom_api_button.cc b/shell/browser/api/views/electron_api_button.cc similarity index 96% rename from shell/browser/api/views/atom_api_button.cc rename to shell/browser/api/views/electron_api_button.cc index e146d44e094..ddfdddbc428 100644 --- a/shell/browser/api/views/atom_api_button.cc +++ b/shell/browser/api/views/electron_api_button.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/views/atom_api_button.h" +#include "shell/browser/api/views/electron_api_button.h" #include "shell/common/gin_helper/constructor.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/browser/api/views/atom_api_button.h b/shell/browser/api/views/electron_api_button.h similarity index 80% rename from shell/browser/api/views/atom_api_button.h rename to shell/browser/api/views/electron_api_button.h index 374e1a9a293..68f43d75412 100644 --- a/shell/browser/api/views/atom_api_button.h +++ b/shell/browser/api/views/electron_api_button.h @@ -2,11 +2,11 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_ -#define SHELL_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_ +#ifndef SHELL_BROWSER_API_VIEWS_ELECTRON_API_BUTTON_H_ +#define SHELL_BROWSER_API_VIEWS_ELECTRON_API_BUTTON_H_ #include "gin/handle.h" -#include "shell/browser/api/atom_api_view.h" +#include "shell/browser/api/electron_api_view.h" #include "ui/views/controls/button/button.h" namespace electron { @@ -37,4 +37,4 @@ class Button : public View, public views::ButtonListener { } // namespace electron -#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_ +#endif // SHELL_BROWSER_API_VIEWS_ELECTRON_API_BUTTON_H_ diff --git a/shell/browser/api/views/atom_api_label_button.cc b/shell/browser/api/views/electron_api_label_button.cc similarity index 97% rename from shell/browser/api/views/atom_api_label_button.cc rename to shell/browser/api/views/electron_api_label_button.cc index f05ce02cc85..f5f79a25a67 100644 --- a/shell/browser/api/views/atom_api_label_button.cc +++ b/shell/browser/api/views/electron_api_label_button.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/views/atom_api_label_button.h" +#include "shell/browser/api/views/electron_api_label_button.h" #include "base/strings/utf_string_conversions.h" #include "shell/common/gin_helper/constructor.h" diff --git a/shell/browser/api/views/atom_api_label_button.h b/shell/browser/api/views/electron_api_label_button.h similarity index 81% rename from shell/browser/api/views/atom_api_label_button.h rename to shell/browser/api/views/electron_api_label_button.h index cb9ec87507b..7cfe96e0096 100644 --- a/shell/browser/api/views/atom_api_label_button.h +++ b/shell/browser/api/views/electron_api_label_button.h @@ -2,12 +2,12 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_LABEL_BUTTON_H_ -#define SHELL_BROWSER_API_VIEWS_ATOM_API_LABEL_BUTTON_H_ +#ifndef SHELL_BROWSER_API_VIEWS_ELECTRON_API_LABEL_BUTTON_H_ +#define SHELL_BROWSER_API_VIEWS_ELECTRON_API_LABEL_BUTTON_H_ #include -#include "shell/browser/api/views/atom_api_button.h" +#include "shell/browser/api/views/electron_api_button.h" #include "ui/views/controls/button/label_button.h" namespace electron { @@ -44,4 +44,4 @@ class LabelButton : public Button { } // namespace electron -#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_LABEL_BUTTON_H_ +#endif // SHELL_BROWSER_API_VIEWS_ELECTRON_API_LABEL_BUTTON_H_ diff --git a/shell/browser/api/views/atom_api_layout_manager.cc b/shell/browser/api/views/electron_api_layout_manager.cc similarity index 96% rename from shell/browser/api/views/atom_api_layout_manager.cc rename to shell/browser/api/views/electron_api_layout_manager.cc index ab177cccdb7..cb3d349e3d8 100644 --- a/shell/browser/api/views/atom_api_layout_manager.cc +++ b/shell/browser/api/views/electron_api_layout_manager.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/views/atom_api_layout_manager.h" +#include "shell/browser/api/views/electron_api_layout_manager.h" #include "shell/common/gin_helper/constructor.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/browser/api/views/atom_api_layout_manager.h b/shell/browser/api/views/electron_api_layout_manager.h similarity index 84% rename from shell/browser/api/views/atom_api_layout_manager.h rename to shell/browser/api/views/electron_api_layout_manager.h index 6fdec77064b..361272fef7b 100644 --- a/shell/browser/api/views/atom_api_layout_manager.h +++ b/shell/browser/api/views/electron_api_layout_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_LAYOUT_MANAGER_H_ -#define SHELL_BROWSER_API_VIEWS_ATOM_API_LAYOUT_MANAGER_H_ +#ifndef SHELL_BROWSER_API_VIEWS_ELECTRON_API_LAYOUT_MANAGER_H_ +#define SHELL_BROWSER_API_VIEWS_ELECTRON_API_LAYOUT_MANAGER_H_ #include @@ -41,4 +41,4 @@ class LayoutManager : public gin_helper::TrackableObject { } // namespace electron -#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_LAYOUT_MANAGER_H_ +#endif // SHELL_BROWSER_API_VIEWS_ELECTRON_API_LAYOUT_MANAGER_H_ diff --git a/shell/browser/api/views/atom_api_md_text_button.cc b/shell/browser/api/views/electron_api_md_text_button.cc similarity index 96% rename from shell/browser/api/views/atom_api_md_text_button.cc rename to shell/browser/api/views/electron_api_md_text_button.cc index 8c0ef48044a..67574ec10b7 100644 --- a/shell/browser/api/views/atom_api_md_text_button.cc +++ b/shell/browser/api/views/electron_api_md_text_button.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/views/atom_api_md_text_button.h" +#include "shell/browser/api/views/electron_api_md_text_button.h" #include "base/strings/utf_string_conversions.h" #include "shell/common/gin_helper/constructor.h" diff --git a/shell/browser/api/views/atom_api_md_text_button.h b/shell/browser/api/views/electron_api_md_text_button.h similarity index 77% rename from shell/browser/api/views/atom_api_md_text_button.h rename to shell/browser/api/views/electron_api_md_text_button.h index bd1a923451d..ec94c68fc3d 100644 --- a/shell/browser/api/views/atom_api_md_text_button.h +++ b/shell/browser/api/views/electron_api_md_text_button.h @@ -2,12 +2,12 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_MD_TEXT_BUTTON_H_ -#define SHELL_BROWSER_API_VIEWS_ATOM_API_MD_TEXT_BUTTON_H_ +#ifndef SHELL_BROWSER_API_VIEWS_ELECTRON_API_MD_TEXT_BUTTON_H_ +#define SHELL_BROWSER_API_VIEWS_ELECTRON_API_MD_TEXT_BUTTON_H_ #include -#include "shell/browser/api/views/atom_api_label_button.h" +#include "shell/browser/api/views/electron_api_label_button.h" #include "ui/views/controls/button/md_text_button.h" namespace electron { @@ -38,4 +38,4 @@ class MdTextButton : public LabelButton { } // namespace electron -#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_MD_TEXT_BUTTON_H_ +#endif // SHELL_BROWSER_API_VIEWS_ELECTRON_API_MD_TEXT_BUTTON_H_ diff --git a/shell/browser/api/views/atom_api_resize_area.cc b/shell/browser/api/views/electron_api_resize_area.cc similarity index 96% rename from shell/browser/api/views/atom_api_resize_area.cc rename to shell/browser/api/views/electron_api_resize_area.cc index a4409733a2d..8c553b1bdc4 100644 --- a/shell/browser/api/views/atom_api_resize_area.cc +++ b/shell/browser/api/views/electron_api_resize_area.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/views/atom_api_resize_area.h" +#include "shell/browser/api/views/electron_api_resize_area.h" #include "shell/common/gin_helper/constructor.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/browser/api/views/atom_api_resize_area.h b/shell/browser/api/views/electron_api_resize_area.h similarity index 79% rename from shell/browser/api/views/atom_api_resize_area.h rename to shell/browser/api/views/electron_api_resize_area.h index cc938b57072..7ebb67d48f2 100644 --- a/shell/browser/api/views/atom_api_resize_area.h +++ b/shell/browser/api/views/electron_api_resize_area.h @@ -2,11 +2,11 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_RESIZE_AREA_H_ -#define SHELL_BROWSER_API_VIEWS_ATOM_API_RESIZE_AREA_H_ +#ifndef SHELL_BROWSER_API_VIEWS_ELECTRON_API_RESIZE_AREA_H_ +#define SHELL_BROWSER_API_VIEWS_ELECTRON_API_RESIZE_AREA_H_ #include "gin/handle.h" -#include "shell/browser/api/atom_api_view.h" +#include "shell/browser/api/electron_api_view.h" #include "ui/views/controls/resize_area.h" #include "ui/views/controls/resize_area_delegate.h" @@ -40,4 +40,4 @@ class ResizeArea : public View, protected views::ResizeAreaDelegate { } // namespace electron -#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_RESIZE_AREA_H_ +#endif // SHELL_BROWSER_API_VIEWS_ELECTRON_API_RESIZE_AREA_H_ diff --git a/shell/browser/api/views/atom_api_text_field.cc b/shell/browser/api/views/electron_api_text_field.cc similarity index 96% rename from shell/browser/api/views/atom_api_text_field.cc rename to shell/browser/api/views/electron_api_text_field.cc index 5f43860c291..41daf9f0153 100644 --- a/shell/browser/api/views/atom_api_text_field.cc +++ b/shell/browser/api/views/electron_api_text_field.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/api/views/atom_api_text_field.h" +#include "shell/browser/api/views/electron_api_text_field.h" #include "shell/common/gin_helper/constructor.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/browser/api/views/atom_api_text_field.h b/shell/browser/api/views/electron_api_text_field.h similarity index 78% rename from shell/browser/api/views/atom_api_text_field.h rename to shell/browser/api/views/electron_api_text_field.h index 280c22fcbc9..f23430e8155 100644 --- a/shell/browser/api/views/atom_api_text_field.h +++ b/shell/browser/api/views/electron_api_text_field.h @@ -2,11 +2,11 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_API_VIEWS_ATOM_API_TEXT_FIELD_H_ -#define SHELL_BROWSER_API_VIEWS_ATOM_API_TEXT_FIELD_H_ +#ifndef SHELL_BROWSER_API_VIEWS_ELECTRON_API_TEXT_FIELD_H_ +#define SHELL_BROWSER_API_VIEWS_ELECTRON_API_TEXT_FIELD_H_ #include "gin/handle.h" -#include "shell/browser/api/atom_api_view.h" +#include "shell/browser/api/electron_api_view.h" #include "ui/views/controls/textfield/textfield.h" namespace electron { @@ -39,4 +39,4 @@ class TextField : public View { } // namespace electron -#endif // SHELL_BROWSER_API_VIEWS_ATOM_API_TEXT_FIELD_H_ +#endif // SHELL_BROWSER_API_VIEWS_ELECTRON_API_TEXT_FIELD_H_ diff --git a/shell/browser/atom_navigation_throttle.h b/shell/browser/atom_navigation_throttle.h deleted file mode 100644 index ca67a8cd25d..00000000000 --- a/shell/browser/atom_navigation_throttle.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2018 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#ifndef SHELL_BROWSER_ATOM_NAVIGATION_THROTTLE_H_ -#define SHELL_BROWSER_ATOM_NAVIGATION_THROTTLE_H_ - -#include "content/public/browser/navigation_throttle.h" - -namespace electron { - -class AtomNavigationThrottle : public content::NavigationThrottle { - public: - explicit AtomNavigationThrottle(content::NavigationHandle* handle); - ~AtomNavigationThrottle() override; - - AtomNavigationThrottle::ThrottleCheckResult WillRedirectRequest() override; - - const char* GetNameForLogging() override; - - private: - DISALLOW_COPY_AND_ASSIGN(AtomNavigationThrottle); -}; - -} // namespace electron - -#endif // SHELL_BROWSER_ATOM_NAVIGATION_THROTTLE_H_ diff --git a/shell/browser/atom_speech_recognition_manager_delegate.cc b/shell/browser/atom_speech_recognition_manager_delegate.cc deleted file mode 100644 index 403cdda6c67..00000000000 --- a/shell/browser/atom_speech_recognition_manager_delegate.cc +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2014 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#include "shell/browser/atom_speech_recognition_manager_delegate.h" - -#include -#include - -#include "base/callback.h" - -namespace electron { - -AtomSpeechRecognitionManagerDelegate::AtomSpeechRecognitionManagerDelegate() = - default; - -AtomSpeechRecognitionManagerDelegate::~AtomSpeechRecognitionManagerDelegate() = - default; - -void AtomSpeechRecognitionManagerDelegate::OnRecognitionStart(int session_id) {} - -void AtomSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {} - -void AtomSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete( - int session_id) {} - -void AtomSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) {} - -void AtomSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) {} - -void AtomSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {} - -void AtomSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {} - -void AtomSpeechRecognitionManagerDelegate::OnRecognitionResults( - int session_id, - const std::vector& results) {} - -void AtomSpeechRecognitionManagerDelegate::OnRecognitionError( - int session_id, - const blink::mojom::SpeechRecognitionError& error) {} - -void AtomSpeechRecognitionManagerDelegate::OnAudioLevelsChange( - int session_id, - float volume, - float noise_volume) {} - -void AtomSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( - int session_id, - base::OnceCallback callback) { - std::move(callback).Run(true, true); -} - -content::SpeechRecognitionEventListener* -AtomSpeechRecognitionManagerDelegate::GetEventListener() { - return this; -} - -bool AtomSpeechRecognitionManagerDelegate::FilterProfanities( - int render_process_id) { - return false; -} - -} // namespace electron diff --git a/shell/browser/browser.cc b/shell/browser/browser.cc index fcc3c73e2c0..85304819b55 100644 --- a/shell/browser/browser.cc +++ b/shell/browser/browser.cc @@ -15,9 +15,9 @@ #include "base/run_loop.h" #include "base/threading/thread_restrictions.h" #include "base/threading/thread_task_runner_handle.h" -#include "shell/browser/atom_browser_main_parts.h" -#include "shell/browser/atom_paths.h" #include "shell/browser/browser_observer.h" +#include "shell/browser/electron_browser_main_parts.h" +#include "shell/browser/electron_paths.h" #include "shell/browser/login_handler.h" #include "shell/browser/native_window.h" #include "shell/browser/window_list.h" @@ -56,7 +56,7 @@ Browser::~Browser() { // static Browser* Browser::Get() { - return AtomBrowserMainParts::Get()->browser(); + return ElectronBrowserMainParts::Get()->browser(); } void Browser::Quit() { @@ -77,7 +77,7 @@ void Browser::Exit(gin_helper::Arguments* args) { int code = 0; args->GetNext(&code); - if (!AtomBrowserMainParts::Get()->SetExitCode(code)) { + if (!ElectronBrowserMainParts::Get()->SetExitCode(code)) { // Message loop is not ready, quit directly. exit(code); } else { diff --git a/shell/browser/browser.h b/shell/browser/browser.h index e07c37031b1..1ea9c10ef6a 100644 --- a/shell/browser/browser.h +++ b/shell/browser/browser.h @@ -37,7 +37,7 @@ class Arguments; namespace electron { -class AtomMenuModel; +class ElectronMenuModel; // This class is used for control application-wide operations. class Browser : public WindowListObserver { @@ -184,7 +184,7 @@ class Browser : public WindowListObserver { bool DockIsVisible(); // Set docks' menu. - void DockSetMenu(AtomMenuModel* model); + void DockSetMenu(ElectronMenuModel* model); // Set docks' icon. void DockSetIcon(const gfx::Image& image); diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index d7721e75cb8..ba8341430c7 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -14,9 +14,9 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/sys_string_conversions.h" #include "net/base/mac/url_conversions.h" -#include "shell/browser/mac/atom_application.h" -#include "shell/browser/mac/atom_application_delegate.h" #include "shell/browser/mac/dict_util.h" +#include "shell/browser/mac/electron_application.h" +#include "shell/browser/mac/electron_application_delegate.h" #include "shell/browser/native_window.h" #include "shell/browser/window_list.h" #include "shell/common/application_info.h" @@ -29,19 +29,20 @@ namespace electron { void Browser::SetShutdownHandler(base::Callback handler) { - [[AtomApplication sharedApplication] setShutdownHandler:std::move(handler)]; + [[ElectronApplication sharedApplication] + setShutdownHandler:std::move(handler)]; } void Browser::Focus() { - [[AtomApplication sharedApplication] activateIgnoringOtherApps:NO]; + [[ElectronApplication sharedApplication] activateIgnoringOtherApps:NO]; } void Browser::Hide() { - [[AtomApplication sharedApplication] hide:nil]; + [[ElectronApplication sharedApplication] hide:nil]; } void Browser::Show() { - [[AtomApplication sharedApplication] unhide:nil]; + [[ElectronApplication sharedApplication] unhide:nil]; } void Browser::AddRecentDocument(const base::FilePath& path) { @@ -162,7 +163,7 @@ void Browser::SetUserActivity(const std::string& type, std::string url_string; args->GetNext(&url_string); - [[AtomApplication sharedApplication] + [[ElectronApplication sharedApplication] setCurrentActivity:base::SysUTF8ToNSString(type) withUserInfo:DictionaryValueToNSDictionary(user_info) withWebpageURL:net::NSURLWithGURL(GURL(url_string))]; @@ -170,21 +171,21 @@ void Browser::SetUserActivity(const std::string& type, std::string Browser::GetCurrentActivityType() { NSUserActivity* userActivity = - [[AtomApplication sharedApplication] getCurrentActivity]; + [[ElectronApplication sharedApplication] getCurrentActivity]; return base::SysNSStringToUTF8(userActivity.activityType); } void Browser::InvalidateCurrentActivity() { - [[AtomApplication sharedApplication] invalidateCurrentActivity]; + [[ElectronApplication sharedApplication] invalidateCurrentActivity]; } void Browser::ResignCurrentActivity() { - [[AtomApplication sharedApplication] resignCurrentActivity]; + [[ElectronApplication sharedApplication] resignCurrentActivity]; } void Browser::UpdateCurrentActivity(const std::string& type, base::DictionaryValue user_info) { - [[AtomApplication sharedApplication] + [[ElectronApplication sharedApplication] updateCurrentActivity:base::SysUTF8ToNSString(type) withUserInfo:DictionaryValueToNSDictionary(user_info)]; } @@ -290,16 +291,17 @@ std::string Browser::GetExecutableFileProductName() const { } int Browser::DockBounce(BounceType type) { - return [[AtomApplication sharedApplication] + return [[ElectronApplication sharedApplication] requestUserAttention:static_cast(type)]; } void Browser::DockCancelBounce(int request_id) { - [[AtomApplication sharedApplication] cancelUserAttentionRequest:request_id]; + [[ElectronApplication sharedApplication] + cancelUserAttentionRequest:request_id]; } void Browser::DockSetBadgeText(const std::string& label) { - NSDockTile* tile = [[AtomApplication sharedApplication] dockTile]; + NSDockTile* tile = [[ElectronApplication sharedApplication] dockTile]; [tile setBadgeLabel:base::SysUTF8ToNSString(label)]; } @@ -310,7 +312,7 @@ void Browser::DockDownloadFinished(const std::string& filePath) { } std::string Browser::DockGetBadgeText() { - NSDockTile* tile = [[AtomApplication sharedApplication] dockTile]; + NSDockTile* tile = [[ElectronApplication sharedApplication] dockTile]; return base::SysNSStringToUTF8([tile badgeLabel]); } @@ -362,14 +364,14 @@ v8::Local Browser::DockShow(v8::Isolate* isolate) { return handle; } -void Browser::DockSetMenu(AtomMenuModel* model) { - AtomApplicationDelegate* delegate = - (AtomApplicationDelegate*)[NSApp delegate]; +void Browser::DockSetMenu(ElectronMenuModel* model) { + ElectronApplicationDelegate* delegate = + (ElectronApplicationDelegate*)[NSApp delegate]; [delegate setApplicationDockMenu:model]; } void Browser::DockSetIcon(const gfx::Image& image) { - [[AtomApplication sharedApplication] + [[ElectronApplication sharedApplication] setApplicationIconImage:image.AsNSImage()]; } @@ -392,7 +394,7 @@ void Browser::ShowAboutPanel() { options = [NSDictionary dictionaryWithDictionary:mutable_options]; } - [[AtomApplication sharedApplication] + [[ElectronApplication sharedApplication] orderFrontStandardAboutPanelWithOptions:options]; } @@ -409,7 +411,7 @@ void Browser::SetAboutPanelOptions(base::DictionaryValue options) { } void Browser::ShowEmojiPanel() { - [[AtomApplication sharedApplication] orderFrontCharacterPalette:nil]; + [[ElectronApplication sharedApplication] orderFrontCharacterPalette:nil]; } bool Browser::IsEmojiPanelSupported() { diff --git a/shell/browser/common_web_contents_delegate.cc b/shell/browser/common_web_contents_delegate.cc index 5dfe8220901..7dc462e43a9 100644 --- a/shell/browser/common_web_contents_delegate.cc +++ b/shell/browser/common_web_contents_delegate.cc @@ -31,13 +31,13 @@ #include "content/public/browser/security_style_explanation.h" #include "content/public/browser/security_style_explanations.h" #include "printing/buildflags/buildflags.h" -#include "shell/browser/atom_browser_client.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_client.h" +#include "shell/browser/electron_browser_context.h" #include "shell/browser/native_window.h" #include "shell/browser/ui/file_dialog.h" #include "shell/browser/web_contents_preferences.h" #include "shell/browser/web_dialog_helper.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #include "shell/common/options_switches.h" #include "storage/browser/file_system/isolated_context.h" @@ -153,7 +153,7 @@ void AppendToFile(const base::FilePath& path, const std::string& content) { PrefService* GetPrefService(content::WebContents* web_contents) { auto* context = web_contents->GetBrowserContext(); - return static_cast(context)->prefs(); + return static_cast(context)->prefs(); } std::map GetAddedFileSystemPaths( @@ -191,7 +191,7 @@ CommonWebContentsDelegate::~CommonWebContentsDelegate() = default; void CommonWebContentsDelegate::InitWithWebContents( content::WebContents* web_contents, - AtomBrowserContext* browser_context, + ElectronBrowserContext* browser_context, bool is_guest) { browser_context_ = browser_context; web_contents->SetDelegate(this); @@ -252,7 +252,7 @@ void CommonWebContentsDelegate::ResetManagedWebContents(bool async) { base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask( FROM_HERE, base::BindOnce( - [](scoped_refptr browser_context, + [](scoped_refptr browser_context, std::unique_ptr web_contents) { web_contents.reset(); }, diff --git a/shell/browser/common_web_contents_delegate.h b/shell/browser/common_web_contents_delegate.h index 32f30118aa8..456e86274e1 100644 --- a/shell/browser/common_web_contents_delegate.h +++ b/shell/browser/common_web_contents_delegate.h @@ -24,7 +24,7 @@ class SequencedTaskRunner; namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; class NativeWindow; class WebDialogHelper; @@ -42,7 +42,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate, // Creates a InspectableWebContents object and takes onwership of // |web_contents|. void InitWithWebContents(content::WebContents* web_contents, - AtomBrowserContext* browser_context, + ElectronBrowserContext* browser_context, bool is_guest); // Set the window as owner window. @@ -173,7 +173,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate, scoped_refptr devtools_file_system_indexer_; // Make sure BrowserContext is alwasys destroyed after WebContents. - scoped_refptr browser_context_; + scoped_refptr browser_context_; // The stored InspectableWebContents object. // Notice that web_contents_ must be placed after dialog_manager_, so we can diff --git a/shell/browser/common_web_contents_delegate_views.cc b/shell/browser/common_web_contents_delegate_views.cc index 7c6bc9e26d1..45c785684d4 100644 --- a/shell/browser/common_web_contents_delegate_views.cc +++ b/shell/browser/common_web_contents_delegate_views.cc @@ -6,7 +6,7 @@ #include "base/strings/string_util.h" #include "content/public/browser/native_web_keyboard_event.h" -#include "shell/browser/api/atom_api_web_contents_view.h" +#include "shell/browser/api/electron_api_web_contents_view.h" #include "shell/browser/native_window_views.h" #include "shell/browser/web_contents_preferences.h" #include "ui/events/keycodes/keyboard_codes.h" diff --git a/shell/browser/cookie_change_notifier.cc b/shell/browser/cookie_change_notifier.cc index a74d120f9d7..84404e3e79b 100644 --- a/shell/browser/cookie_change_notifier.cc +++ b/shell/browser/cookie_change_notifier.cc @@ -10,13 +10,14 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" #include "net/cookies/canonical_cookie.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" using content::BrowserThread; namespace electron { -CookieChangeNotifier::CookieChangeNotifier(AtomBrowserContext* browser_context) +CookieChangeNotifier::CookieChangeNotifier( + ElectronBrowserContext* browser_context) : browser_context_(browser_context), receiver_(this) { StartListening(); } diff --git a/shell/browser/cookie_change_notifier.h b/shell/browser/cookie_change_notifier.h index 58a976fcf7b..14edc9fe8e2 100644 --- a/shell/browser/cookie_change_notifier.h +++ b/shell/browser/cookie_change_notifier.h @@ -15,12 +15,12 @@ namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; // Sends cookie-change notifications on the UI thread. class CookieChangeNotifier : public network::mojom::CookieChangeListener { public: - explicit CookieChangeNotifier(AtomBrowserContext* browser_context); + explicit CookieChangeNotifier(ElectronBrowserContext* browser_context); ~CookieChangeNotifier() override; // Register callbacks that needs to notified on any cookie store changes. @@ -36,7 +36,7 @@ class CookieChangeNotifier : public network::mojom::CookieChangeListener { // network::mojom::CookieChangeListener implementation. void OnCookieChange(const net::CookieChangeInfo& change) override; - AtomBrowserContext* browser_context_; + ElectronBrowserContext* browser_context_; base::CallbackList cookie_change_sub_list_; diff --git a/shell/browser/atom_autofill_driver.cc b/shell/browser/electron_autofill_driver.cc similarity index 92% rename from shell/browser/atom_autofill_driver.cc rename to shell/browser/electron_autofill_driver.cc index c3ca0ac8d31..4567816ee3d 100644 --- a/shell/browser/atom_autofill_driver.cc +++ b/shell/browser/electron_autofill_driver.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_autofill_driver.h" +#include "shell/browser/electron_autofill_driver.h" #include #include #include "content/public/browser/render_widget_host_view.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/native_window.h" namespace electron { diff --git a/shell/browser/atom_autofill_driver.h b/shell/browser/electron_autofill_driver.h similarity index 84% rename from shell/browser/atom_autofill_driver.h rename to shell/browser/electron_autofill_driver.h index b30521491d6..8cf68b68bfd 100644 --- a/shell/browser/atom_autofill_driver.h +++ b/shell/browser/electron_autofill_driver.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_AUTOFILL_DRIVER_H_ -#define SHELL_BROWSER_ATOM_AUTOFILL_DRIVER_H_ +#ifndef SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_ +#define SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_ #include #include @@ -41,4 +41,4 @@ class AutofillDriver : public mojom::ElectronAutofillDriver { } // namespace electron -#endif // SHELL_BROWSER_ATOM_AUTOFILL_DRIVER_H_ +#endif // SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_ diff --git a/shell/browser/atom_autofill_driver_factory.cc b/shell/browser/electron_autofill_driver_factory.cc similarity index 93% rename from shell/browser/atom_autofill_driver_factory.cc rename to shell/browser/electron_autofill_driver_factory.cc index efe0596c944..4e95cfb4278 100644 --- a/shell/browser/atom_autofill_driver_factory.cc +++ b/shell/browser/electron_autofill_driver_factory.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_autofill_driver_factory.h" +#include "shell/browser/electron_autofill_driver_factory.h" #include #include @@ -13,7 +13,7 @@ #include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" -#include "shell/browser/atom_autofill_driver.h" +#include "shell/browser/electron_autofill_driver.h" namespace electron { diff --git a/shell/browser/atom_autofill_driver_factory.h b/shell/browser/electron_autofill_driver_factory.h similarity index 87% rename from shell/browser/atom_autofill_driver_factory.h rename to shell/browser/electron_autofill_driver_factory.h index bcf0b4a29ca..23784fc9ec1 100644 --- a/shell/browser/atom_autofill_driver_factory.h +++ b/shell/browser/electron_autofill_driver_factory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_AUTOFILL_DRIVER_FACTORY_H_ -#define SHELL_BROWSER_ATOM_AUTOFILL_DRIVER_FACTORY_H_ +#ifndef SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_FACTORY_H_ +#define SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_FACTORY_H_ #include #include @@ -54,4 +54,4 @@ class AutofillDriverFactory } // namespace electron -#endif // SHELL_BROWSER_ATOM_AUTOFILL_DRIVER_FACTORY_H_ +#endif // SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_FACTORY_H_ diff --git a/shell/browser/atom_browser_client.cc b/shell/browser/electron_browser_client.cc similarity index 86% rename from shell/browser/atom_browser_client.cc rename to shell/browser/electron_browser_client.cc index e7f1cc3a5fb..5453bd08848 100644 --- a/shell/browser/atom_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_browser_client.h" +#include "shell/browser/electron_browser_client.h" #if defined(OS_WIN) #include @@ -56,19 +56,19 @@ #include "services/network/public/cpp/resource_request_body.h" #include "services/service_manager/public/cpp/binder_map.h" #include "shell/app/manifests.h" -#include "shell/browser/api/atom_api_app.h" -#include "shell/browser/api/atom_api_protocol.h" -#include "shell/browser/api/atom_api_session.h" -#include "shell/browser/api/atom_api_web_contents.h" -#include "shell/browser/api/atom_api_web_request.h" -#include "shell/browser/atom_autofill_driver_factory.h" -#include "shell/browser/atom_browser_context.h" -#include "shell/browser/atom_browser_main_parts.h" -#include "shell/browser/atom_navigation_throttle.h" -#include "shell/browser/atom_paths.h" -#include "shell/browser/atom_quota_permission_context.h" -#include "shell/browser/atom_speech_recognition_manager_delegate.h" +#include "shell/browser/api/electron_api_app.h" +#include "shell/browser/api/electron_api_protocol.h" +#include "shell/browser/api/electron_api_session.h" +#include "shell/browser/api/electron_api_web_contents.h" +#include "shell/browser/api/electron_api_web_request.h" #include "shell/browser/child_web_contents_tracker.h" +#include "shell/browser/electron_autofill_driver_factory.h" +#include "shell/browser/electron_browser_context.h" +#include "shell/browser/electron_browser_main_parts.h" +#include "shell/browser/electron_navigation_throttle.h" +#include "shell/browser/electron_paths.h" +#include "shell/browser/electron_quota_permission_context.h" +#include "shell/browser/electron_speech_recognition_manager_delegate.h" #include "shell/browser/font_defaults.h" #include "shell/browser/media/media_capture_devices_dispatcher.h" #include "shell/browser/native_window.h" @@ -162,7 +162,7 @@ bool IsSameWebSite(content::BrowserContext* browser_context, site_instance->GetSiteURL()); } -AtomBrowserClient* g_browser_client = nullptr; +ElectronBrowserClient* g_browser_client = nullptr; base::LazyInstance::DestructorAtExit g_io_thread_application_locale = LAZY_INSTANCE_INITIALIZER; @@ -189,16 +189,16 @@ const base::FilePath::StringPieceType kPathDelimiter = FILE_PATH_LITERAL(":"); } // namespace // static -void AtomBrowserClient::SuppressRendererProcessRestartForOnce() { +void ElectronBrowserClient::SuppressRendererProcessRestartForOnce() { g_suppress_renderer_process_restart = true; } -AtomBrowserClient* AtomBrowserClient::Get() { +ElectronBrowserClient* ElectronBrowserClient::Get() { return g_browser_client; } // static -void AtomBrowserClient::SetApplicationLocale(const std::string& locale) { +void ElectronBrowserClient::SetApplicationLocale(const std::string& locale) { if (!BrowserThread::IsThreadInitialized(BrowserThread::IO) || !base::PostTask( FROM_HERE, {BrowserThread::IO}, @@ -208,17 +208,17 @@ void AtomBrowserClient::SetApplicationLocale(const std::string& locale) { *g_application_locale = locale; } -AtomBrowserClient::AtomBrowserClient() { +ElectronBrowserClient::ElectronBrowserClient() { DCHECK(!g_browser_client); g_browser_client = this; } -AtomBrowserClient::~AtomBrowserClient() { +ElectronBrowserClient::~ElectronBrowserClient() { DCHECK(g_browser_client); g_browser_client = nullptr; } -content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID( +content::WebContents* ElectronBrowserClient::GetWebContentsFromProcessID( int process_id) { // If the process is a pending process, we should use the web contents // for the frame host passed into RegisterPendingProcess. @@ -231,7 +231,7 @@ content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID( return WebContentsPreferences::GetWebContentsFromProcessID(process_id); } -bool AtomBrowserClient::ShouldForceNewSiteInstance( +bool ElectronBrowserClient::ShouldForceNewSiteInstance( content::RenderFrameHost* current_rfh, content::RenderFrameHost* speculative_rfh, content::BrowserContext* browser_context, @@ -276,7 +276,7 @@ bool AtomBrowserClient::ShouldForceNewSiteInstance( return !IsSameWebSite(browser_context, current_instance, url); } -bool AtomBrowserClient::NavigationWasRedirectedCrossSite( +bool ElectronBrowserClient::NavigationWasRedirectedCrossSite( content::BrowserContext* browser_context, content::SiteInstance* current_instance, content::SiteInstance* speculative_instance, @@ -295,36 +295,36 @@ bool AtomBrowserClient::NavigationWasRedirectedCrossSite( return navigation_was_redirected; } -void AtomBrowserClient::AddProcessPreferences( +void ElectronBrowserClient::AddProcessPreferences( int process_id, - AtomBrowserClient::ProcessPreferences prefs) { + ElectronBrowserClient::ProcessPreferences prefs) { process_preferences_[process_id] = prefs; } -void AtomBrowserClient::RemoveProcessPreferences(int process_id) { +void ElectronBrowserClient::RemoveProcessPreferences(int process_id) { process_preferences_.erase(process_id); } -bool AtomBrowserClient::IsProcessObserved(int process_id) const { +bool ElectronBrowserClient::IsProcessObserved(int process_id) const { return process_preferences_.find(process_id) != process_preferences_.end(); } -bool AtomBrowserClient::IsRendererSandboxed(int process_id) const { +bool ElectronBrowserClient::IsRendererSandboxed(int process_id) const { auto it = process_preferences_.find(process_id); return it != process_preferences_.end() && it->second.sandbox; } -bool AtomBrowserClient::RendererUsesNativeWindowOpen(int process_id) const { +bool ElectronBrowserClient::RendererUsesNativeWindowOpen(int process_id) const { auto it = process_preferences_.find(process_id); return it != process_preferences_.end() && it->second.native_window_open; } -bool AtomBrowserClient::RendererDisablesPopups(int process_id) const { +bool ElectronBrowserClient::RendererDisablesPopups(int process_id) const { auto it = process_preferences_.find(process_id); return it != process_preferences_.end() && it->second.disable_popups; } -std::string AtomBrowserClient::GetAffinityPreference( +std::string ElectronBrowserClient::GetAffinityPreference( content::RenderFrameHost* rfh) const { auto* web_contents = content::WebContents::FromRenderFrameHost(rfh); auto* web_preferences = WebContentsPreferences::From(web_contents); @@ -338,7 +338,7 @@ std::string AtomBrowserClient::GetAffinityPreference( return affinity; } -content::SiteInstance* AtomBrowserClient::GetSiteInstanceFromAffinity( +content::SiteInstance* ElectronBrowserClient::GetSiteInstanceFromAffinity( content::BrowserContext* browser_context, const GURL& url, content::RenderFrameHost* rfh) const { @@ -355,7 +355,7 @@ content::SiteInstance* AtomBrowserClient::GetSiteInstanceFromAffinity( return nullptr; } -void AtomBrowserClient::ConsiderSiteInstanceForAffinity( +void ElectronBrowserClient::ConsiderSiteInstanceForAffinity( content::RenderFrameHost* rfh, content::SiteInstance* site_instance) { std::string affinity = GetAffinityPreference(rfh); @@ -364,11 +364,11 @@ void AtomBrowserClient::ConsiderSiteInstanceForAffinity( } } -bool AtomBrowserClient::IsRendererSubFrame(int process_id) const { +bool ElectronBrowserClient::IsRendererSubFrame(int process_id) const { return base::Contains(renderer_is_subframe_, process_id); } -void AtomBrowserClient::RenderProcessWillLaunch( +void ElectronBrowserClient::RenderProcessWillLaunch( content::RenderProcessHost* host) { // When a render process is crashed, it might be reused. int process_id = host->GetID(); @@ -406,11 +406,12 @@ void AtomBrowserClient::RenderProcessWillLaunch( } content::SpeechRecognitionManagerDelegate* -AtomBrowserClient::CreateSpeechRecognitionManagerDelegate() { - return new AtomSpeechRecognitionManagerDelegate; +ElectronBrowserClient::CreateSpeechRecognitionManagerDelegate() { + return new ElectronSpeechRecognitionManagerDelegate; } -content::TtsControllerDelegate* AtomBrowserClient::GetTtsControllerDelegate() { +content::TtsControllerDelegate* +ElectronBrowserClient::GetTtsControllerDelegate() { #if BUILDFLAG(ENABLE_TTS) return TtsControllerDelegateImpl::GetInstance(); #else @@ -418,8 +419,9 @@ content::TtsControllerDelegate* AtomBrowserClient::GetTtsControllerDelegate() { #endif } -void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host, - content::WebPreferences* prefs) { +void ElectronBrowserClient::OverrideWebkitPrefs( + content::RenderViewHost* host, + content::WebPreferences* prefs) { prefs->javascript_enabled = true; prefs->web_security_enabled = true; prefs->plugins_enabled = true; @@ -450,16 +452,16 @@ void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host, web_preferences->OverrideWebkitPrefs(prefs); } -void AtomBrowserClient::SetCanUseCustomSiteInstance(bool should_disable) { +void ElectronBrowserClient::SetCanUseCustomSiteInstance(bool should_disable) { disable_process_restart_tricks_ = should_disable; } -bool AtomBrowserClient::CanUseCustomSiteInstance() { +bool ElectronBrowserClient::CanUseCustomSiteInstance() { return disable_process_restart_tricks_; } content::ContentBrowserClient::SiteInstanceForNavigationType -AtomBrowserClient::ShouldOverrideSiteInstanceForNavigation( +ElectronBrowserClient::ShouldOverrideSiteInstanceForNavigation( content::RenderFrameHost* current_rfh, content::RenderFrameHost* speculative_rfh, content::BrowserContext* browser_context, @@ -509,7 +511,7 @@ AtomBrowserClient::ShouldOverrideSiteInstanceForNavigation( return SiteInstanceForNavigationType::FORCE_CANDIDATE_OR_NEW; } -void AtomBrowserClient::RegisterPendingSiteInstance( +void ElectronBrowserClient::RegisterPendingSiteInstance( content::RenderFrameHost* rfh, content::SiteInstance* pending_site_instance) { // Do we have an affinity site to manage? @@ -526,7 +528,7 @@ void AtomBrowserClient::RegisterPendingSiteInstance( renderer_is_subframe_.erase(pending_process->GetID()); } -void AtomBrowserClient::AppendExtraCommandLineSwitches( +void ElectronBrowserClient::AppendExtraCommandLineSwitches( base::CommandLine* command_line, int process_id) { // Make sure we're about to launch a known executable @@ -608,7 +610,8 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches( } } -void AtomBrowserClient::DidCreatePpapiPlugin(content::BrowserPpapiHost* host) { +void ElectronBrowserClient::DidCreatePpapiPlugin( + content::BrowserPpapiHost* host) { #if BUILDFLAG(ENABLE_PEPPER_FLASH) host->GetPpapiHost()->AddHostFactoryFilter( base::WrapUnique(new ChromeBrowserPepperHostFactory(host))); @@ -616,7 +619,7 @@ void AtomBrowserClient::DidCreatePpapiPlugin(content::BrowserPpapiHost* host) { } // attempt to get api key from env -std::string AtomBrowserClient::GetGeolocationApiKey() { +std::string ElectronBrowserClient::GetGeolocationApiKey() { std::unique_ptr env(base::Environment::Create()); std::string api_key; env->GetVar("GOOGLE_API_KEY", &api_key); @@ -624,12 +627,12 @@ std::string AtomBrowserClient::GetGeolocationApiKey() { } scoped_refptr -AtomBrowserClient::CreateQuotaPermissionContext() { - return new AtomQuotaPermissionContext; +ElectronBrowserClient::CreateQuotaPermissionContext() { + return new ElectronQuotaPermissionContext; } content::GeneratedCodeCacheSettings -AtomBrowserClient::GetGeneratedCodeCacheSettings( +ElectronBrowserClient::GetGeneratedCodeCacheSettings( content::BrowserContext* context) { // TODO(deepak1556): Use platform cache directory. base::FilePath cache_path = context->GetPath(); @@ -639,7 +642,7 @@ AtomBrowserClient::GetGeneratedCodeCacheSettings( return content::GeneratedCodeCacheSettings(true, 0, cache_path); } -void AtomBrowserClient::AllowCertificateError( +void ElectronBrowserClient::AllowCertificateError( content::WebContents* web_contents, int cert_error, const net::SSLInfo& ssl_info, @@ -654,7 +657,7 @@ void AtomBrowserClient::AllowCertificateError( } } -base::OnceClosure AtomBrowserClient::SelectClientCertificate( +base::OnceClosure ElectronBrowserClient::SelectClientCertificate( content::WebContents* web_contents, net::SSLCertRequestInfo* cert_request_info, net::ClientCertIdentityList client_certs, @@ -667,7 +670,7 @@ base::OnceClosure AtomBrowserClient::SelectClientCertificate( return base::OnceClosure(); } -bool AtomBrowserClient::CanCreateWindow( +bool ElectronBrowserClient::CanCreateWindow( content::RenderFrameHost* opener, const GURL& opener_url, const GURL& opener_top_level_frame_url, @@ -711,13 +714,13 @@ bool AtomBrowserClient::CanCreateWindow( #if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE) std::unique_ptr -AtomBrowserClient::CreateWindowForPictureInPicture( +ElectronBrowserClient::CreateWindowForPictureInPicture( content::PictureInPictureWindowController* controller) { return content::OverlayWindow::Create(controller); } #endif -void AtomBrowserClient::GetAdditionalAllowedSchemesForFileSystem( +void ElectronBrowserClient::GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_schemes) { auto schemes_list = api::GetStandardSchemes(); if (!schemes_list.empty()) @@ -726,16 +729,16 @@ void AtomBrowserClient::GetAdditionalAllowedSchemesForFileSystem( additional_schemes->push_back(content::kChromeDevToolsScheme); } -void AtomBrowserClient::GetAdditionalWebUISchemes( +void ElectronBrowserClient::GetAdditionalWebUISchemes( std::vector* additional_schemes) { additional_schemes->push_back(content::kChromeDevToolsScheme); } -void AtomBrowserClient::SiteInstanceGotProcess( +void ElectronBrowserClient::SiteInstanceGotProcess( content::SiteInstance* site_instance) { #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) auto* browser_context = - static_cast(site_instance->GetBrowserContext()); + static_cast(site_instance->GetBrowserContext()); extensions::ExtensionRegistry* registry = extensions::ExtensionRegistry::Get(browser_context); const extensions::Extension* extension = @@ -757,7 +760,7 @@ void AtomBrowserClient::SiteInstanceGotProcess( #endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) } -void AtomBrowserClient::SiteInstanceDeleting( +void ElectronBrowserClient::SiteInstanceDeleting( content::SiteInstance* site_instance) { // We are storing weak_ptr, is it fundamental to maintain the map up-to-date // when an instance is destroyed. @@ -775,7 +778,7 @@ void AtomBrowserClient::SiteInstanceDeleting( return; auto* browser_context = - static_cast(site_instance->GetBrowserContext()); + static_cast(site_instance->GetBrowserContext()); // If this isn't an extension renderer there's nothing to do. extensions::ExtensionRegistry* registry = extensions::ExtensionRegistry::Get(browser_context); @@ -798,7 +801,8 @@ void AtomBrowserClient::SiteInstanceDeleting( #endif } -std::unique_ptr AtomBrowserClient::CreateClientCertStore( +std::unique_ptr +ElectronBrowserClient::CreateClientCertStore( content::BrowserContext* browser_context) { #if defined(USE_NSS_CERTS) return std::make_unique( @@ -813,7 +817,7 @@ std::unique_ptr AtomBrowserClient::CreateClientCertStore( } std::unique_ptr -AtomBrowserClient::OverrideSystemLocationProvider() { +ElectronBrowserClient::OverrideSystemLocationProvider() { #if BUILDFLAG(OVERRIDE_LOCATION_PROVIDER) return std::make_unique(); #else @@ -822,7 +826,7 @@ AtomBrowserClient::OverrideSystemLocationProvider() { } mojo::Remote -AtomBrowserClient::CreateNetworkContext( +ElectronBrowserClient::CreateNetworkContext( content::BrowserContext* browser_context, bool /*in_memory*/, const base::FilePath& /*relative_partition_path*/) { @@ -831,26 +835,27 @@ AtomBrowserClient::CreateNetworkContext( ->CreateNetworkContext(); } -network::mojom::NetworkContext* AtomBrowserClient::GetSystemNetworkContext() { +network::mojom::NetworkContext* +ElectronBrowserClient::GetSystemNetworkContext() { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(g_browser_process->system_network_context_manager()); return g_browser_process->system_network_context_manager()->GetContext(); } base::Optional -AtomBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { +ElectronBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { if (name == content::mojom::kBrowserServiceName) return GetElectronContentBrowserOverlayManifest(); return base::nullopt; } std::unique_ptr -AtomBrowserClient::CreateBrowserMainParts( +ElectronBrowserClient::CreateBrowserMainParts( const content::MainFunctionParams& params) { - return std::make_unique(params); + return std::make_unique(params); } -void AtomBrowserClient::WebNotificationAllowed( +void ElectronBrowserClient::WebNotificationAllowed( int render_process_id, base::OnceCallback callback) { content::WebContents* web_contents = @@ -869,7 +874,7 @@ void AtomBrowserClient::WebNotificationAllowed( base::BindOnce(std::move(callback), web_contents->IsAudioMuted())); } -void AtomBrowserClient::RenderProcessHostDestroyed( +void ElectronBrowserClient::RenderProcessHostDestroyed( content::RenderProcessHost* host) { int process_id = host->GetID(); pending_processes_.erase(process_id); @@ -877,7 +882,8 @@ void AtomBrowserClient::RenderProcessHostDestroyed( RemoveProcessPreferences(process_id); } -void AtomBrowserClient::RenderProcessReady(content::RenderProcessHost* host) { +void ElectronBrowserClient::RenderProcessReady( + content::RenderProcessHost* host) { render_process_host_pids_[host->GetID()] = base::GetProcId(host->GetProcess().Handle()); if (delegate_) { @@ -885,7 +891,7 @@ void AtomBrowserClient::RenderProcessReady(content::RenderProcessHost* host) { } } -void AtomBrowserClient::RenderProcessExited( +void ElectronBrowserClient::RenderProcessExited( content::RenderProcessHost* host, const content::ChildProcessTerminationInfo& info) { auto host_pid = render_process_host_pids_.find(host->GetID()); @@ -924,7 +930,7 @@ void HandleExternalProtocolInUI( has_user_gesture, url); } -bool AtomBrowserClient::HandleExternalProtocol( +bool ElectronBrowserClient::HandleExternalProtocol( const GURL& url, content::WebContents::OnceGetter web_contents_getter, int child_id, @@ -942,10 +948,10 @@ bool AtomBrowserClient::HandleExternalProtocol( } std::vector> -AtomBrowserClient::CreateThrottlesForNavigation( +ElectronBrowserClient::CreateThrottlesForNavigation( content::NavigationHandle* handle) { std::vector> throttles; - throttles.push_back(std::make_unique(handle)); + throttles.push_back(std::make_unique(handle)); #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) throttles.push_back( @@ -955,16 +961,16 @@ AtomBrowserClient::CreateThrottlesForNavigation( return throttles; } -content::MediaObserver* AtomBrowserClient::GetMediaObserver() { +content::MediaObserver* ElectronBrowserClient::GetMediaObserver() { return MediaCaptureDevicesDispatcher::GetInstance(); } content::DevToolsManagerDelegate* -AtomBrowserClient::GetDevToolsManagerDelegate() { +ElectronBrowserClient::GetDevToolsManagerDelegate() { return new DevToolsManagerDelegate; } -NotificationPresenter* AtomBrowserClient::GetNotificationPresenter() { +NotificationPresenter* ElectronBrowserClient::GetNotificationPresenter() { if (!notification_presenter_) { notification_presenter_.reset(NotificationPresenter::Create()); } @@ -972,7 +978,7 @@ NotificationPresenter* AtomBrowserClient::GetNotificationPresenter() { } content::PlatformNotificationService* -AtomBrowserClient::GetPlatformNotificationService( +ElectronBrowserClient::GetPlatformNotificationService( content::BrowserContext* browser_context) { if (!notification_service_) { notification_service_ = std::make_unique(this); @@ -980,7 +986,7 @@ AtomBrowserClient::GetPlatformNotificationService( return notification_service_.get(); } -base::FilePath AtomBrowserClient::GetDefaultDownloadDirectory() { +base::FilePath ElectronBrowserClient::GetDefaultDownloadDirectory() { // ~/Downloads base::FilePath path; if (base::PathService::Get(base::DIR_HOME, &path)) @@ -990,13 +996,13 @@ base::FilePath AtomBrowserClient::GetDefaultDownloadDirectory() { } scoped_refptr -AtomBrowserClient::GetSystemSharedURLLoaderFactory() { +ElectronBrowserClient::GetSystemSharedURLLoaderFactory() { if (!g_browser_process) return nullptr; return g_browser_process->shared_url_loader_factory(); } -void AtomBrowserClient::OnNetworkServiceCreated( +void ElectronBrowserClient::OnNetworkServiceCreated( network::mojom::NetworkService* network_service) { if (!g_browser_process) return; @@ -1006,7 +1012,7 @@ void AtomBrowserClient::OnNetworkServiceCreated( } std::vector -AtomBrowserClient::GetNetworkContextsParentDirectory() { +ElectronBrowserClient::GetNetworkContextsParentDirectory() { base::FilePath user_data_dir; base::PathService::Get(DIR_USER_DATA, &user_data_dir); DCHECK(!user_data_dir.empty()); @@ -1014,21 +1020,21 @@ AtomBrowserClient::GetNetworkContextsParentDirectory() { return {user_data_dir}; } -std::string AtomBrowserClient::GetProduct() { +std::string ElectronBrowserClient::GetProduct() { return "Chrome/" CHROME_VERSION_STRING; } -std::string AtomBrowserClient::GetUserAgent() { +std::string ElectronBrowserClient::GetUserAgent() { if (user_agent_override_.empty()) return GetApplicationUserAgent(); return user_agent_override_; } -void AtomBrowserClient::SetUserAgent(const std::string& user_agent) { +void ElectronBrowserClient::SetUserAgent(const std::string& user_agent) { user_agent_override_ = user_agent; } -void AtomBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( +void ElectronBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( int frame_tree_node_id, NonNetworkURLLoaderFactoryMap* factories) { content::WebContents* web_contents = @@ -1046,7 +1052,7 @@ void AtomBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( protocol->RegisterURLLoaderFactories(factories); } -void AtomBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( +void ElectronBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( int render_process_id, int render_frame_id, NonNetworkURLLoaderFactoryMap* factories) { @@ -1070,7 +1076,7 @@ void AtomBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( } } -bool AtomBrowserClient::WillCreateURLLoaderFactory( +bool ElectronBrowserClient::WillCreateURLLoaderFactory( content::BrowserContext* browser_context, content::RenderFrameHost* frame_host, int render_process_id, @@ -1122,7 +1128,7 @@ bool AtomBrowserClient::WillCreateURLLoaderFactory( return true; } -void AtomBrowserClient::OverrideURLLoaderFactoryParams( +void ElectronBrowserClient::OverrideURLLoaderFactoryParams( content::BrowserContext* browser_context, const url::Origin& origin, bool is_for_isolated_world, @@ -1140,8 +1146,8 @@ void AtomBrowserClient::OverrideURLLoaderFactoryParams( } #if defined(OS_WIN) -bool AtomBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy, - RendererSpawnFlags flags) { +bool ElectronBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy, + RendererSpawnFlags flags) { // Allow crashpad to communicate via named pipe. sandbox::ResultCode result = policy->AddRule( sandbox::TargetPolicy::SUBSYS_FILES, @@ -1152,7 +1158,7 @@ bool AtomBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy, } #endif // defined(OS_WIN) -bool AtomBrowserClient::BindAssociatedReceiverFromFrame( +bool ElectronBrowserClient::BindAssociatedReceiverFromFrame( content::RenderFrameHost* render_frame_host, const std::string& interface_name, mojo::ScopedInterfaceEndpointHandle* handle) { @@ -1166,25 +1172,25 @@ bool AtomBrowserClient::BindAssociatedReceiverFromFrame( return false; } -std::string AtomBrowserClient::GetApplicationLocale() { +std::string ElectronBrowserClient::GetApplicationLocale() { if (BrowserThread::CurrentlyOn(BrowserThread::IO)) return g_io_thread_application_locale.Get(); return *g_application_locale; } -base::FilePath AtomBrowserClient::GetFontLookupTableCacheDir() { +base::FilePath ElectronBrowserClient::GetFontLookupTableCacheDir() { base::FilePath user_data_dir; base::PathService::Get(DIR_USER_DATA, &user_data_dir); DCHECK(!user_data_dir.empty()); return user_data_dir.Append(FILE_PATH_LITERAL("FontLookupTableCache")); } -bool AtomBrowserClient::ShouldEnableStrictSiteIsolation() { +bool ElectronBrowserClient::ShouldEnableStrictSiteIsolation() { // Enable site isolation. It is off by default in Chromium <= 69. return true; } -void AtomBrowserClient::BindHostReceiverForRenderer( +void ElectronBrowserClient::BindHostReceiverForRenderer( content::RenderProcessHost* render_process_host, mojo::GenericPendingReceiver receiver) { #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) @@ -1196,14 +1202,15 @@ void AtomBrowserClient::BindHostReceiverForRenderer( #endif } -void AtomBrowserClient::RegisterBrowserInterfaceBindersForFrame( +void ElectronBrowserClient::RegisterBrowserInterfaceBindersForFrame( content::RenderFrameHost* render_frame_host, service_manager::BinderMapWithContext* map) { map->Add( base::BindRepeating(&BindNetworkHintsHandler)); } -std::unique_ptr AtomBrowserClient::CreateLoginDelegate( +std::unique_ptr +ElectronBrowserClient::CreateLoginDelegate( const net::AuthChallengeInfo& auth_info, content::WebContents* web_contents, const content::GlobalRequestID& request_id, diff --git a/shell/browser/atom_browser_client.h b/shell/browser/electron_browser_client.h similarity index 96% rename from shell/browser/atom_browser_client.h rename to shell/browser/electron_browser_client.h index 28ef9a9c02b..e3a557ef1ae 100644 --- a/shell/browser/atom_browser_client.h +++ b/shell/browser/electron_browser_client.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_BROWSER_CLIENT_H_ -#define SHELL_BROWSER_ATOM_BROWSER_CLIENT_H_ +#ifndef SHELL_BROWSER_ELECTRON_BROWSER_CLIENT_H_ +#define SHELL_BROWSER_ELECTRON_BROWSER_CLIENT_H_ #include #include @@ -33,14 +33,14 @@ namespace electron { class NotificationPresenter; class PlatformNotificationService; -class AtomBrowserClient : public content::ContentBrowserClient, - public content::RenderProcessHostObserver { +class ElectronBrowserClient : public content::ContentBrowserClient, + public content::RenderProcessHostObserver { public: - static AtomBrowserClient* Get(); + static ElectronBrowserClient* Get(); static void SetApplicationLocale(const std::string& locale); - AtomBrowserClient(); - ~AtomBrowserClient() override; + ElectronBrowserClient(); + ~ElectronBrowserClient() override; using Delegate = content::ContentBrowserClient; void set_delegate(Delegate* delegate) { delegate_ = delegate; } @@ -286,9 +286,9 @@ class AtomBrowserClient : public content::ContentBrowserClient, bool disable_process_restart_tricks_ = false; - DISALLOW_COPY_AND_ASSIGN(AtomBrowserClient); + DISALLOW_COPY_AND_ASSIGN(ElectronBrowserClient); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_BROWSER_CLIENT_H_ +#endif // SHELL_BROWSER_ELECTRON_BROWSER_CLIENT_H_ diff --git a/shell/browser/atom_browser_context.cc b/shell/browser/electron_browser_context.cc similarity index 82% rename from shell/browser/atom_browser_context.cc rename to shell/browser/electron_browser_context.cc index f411bebb416..6a4991798ea 100644 --- a/shell/browser/atom_browser_context.cc +++ b/shell/browser/electron_browser_context.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" #include @@ -33,13 +33,13 @@ #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/wrapper_shared_url_loader_factory.h" #include "services/network/public/mojom/network_context.mojom.h" -#include "shell/browser/api/atom_api_url_loader.h" -#include "shell/browser/atom_browser_client.h" -#include "shell/browser/atom_browser_main_parts.h" -#include "shell/browser/atom_download_manager_delegate.h" -#include "shell/browser/atom_paths.h" -#include "shell/browser/atom_permission_manager.h" +#include "shell/browser/api/electron_api_url_loader.h" #include "shell/browser/cookie_change_notifier.h" +#include "shell/browser/electron_browser_client.h" +#include "shell/browser/electron_browser_main_parts.h" +#include "shell/browser/electron_download_manager_delegate.h" +#include "shell/browser/electron_paths.h" +#include "shell/browser/electron_permission_manager.h" #include "shell/browser/net/resolve_proxy_helper.h" #include "shell/browser/pref_store_delegate.h" #include "shell/browser/special_storage_policy.h" @@ -90,18 +90,19 @@ std::string MakePartitionName(const std::string& input) { } // namespace // static -AtomBrowserContext::BrowserContextMap AtomBrowserContext::browser_context_map_; +ElectronBrowserContext::BrowserContextMap + ElectronBrowserContext::browser_context_map_; -AtomBrowserContext::AtomBrowserContext(const std::string& partition, - bool in_memory, - base::DictionaryValue options) - : base::RefCountedDeleteOnSequence( +ElectronBrowserContext::ElectronBrowserContext(const std::string& partition, + bool in_memory, + base::DictionaryValue options) + : base::RefCountedDeleteOnSequence( base::ThreadTaskRunnerHandle::Get()), in_memory_pref_store_(nullptr), storage_policy_(new SpecialStoragePolicy), in_memory_(in_memory), weak_factory_(this) { - user_agent_ = AtomBrowserClient::Get()->GetUserAgent(); + user_agent_ = ElectronBrowserClient::Get()->GetUserAgent(); // Read options. base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -143,7 +144,7 @@ AtomBrowserContext::AtomBrowserContext(const std::string& partition, #endif } -AtomBrowserContext::~AtomBrowserContext() { +ElectronBrowserContext::~ElectronBrowserContext() { DCHECK_CURRENTLY_ON(BrowserThread::UI); NotifyWillBeDestroyed(this); // Notify any keyed services of browser context destruction. @@ -155,7 +156,7 @@ AtomBrowserContext::~AtomBrowserContext() { std::move(resource_context_)); } -void AtomBrowserContext::InitPrefs() { +void ElectronBrowserContext::InitPrefs() { auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences")); base::ThreadRestrictions::ScopedAllowIO allow_io; PrefServiceFactory prefs_factory; @@ -225,40 +226,40 @@ void AtomBrowserContext::InitPrefs() { #endif } -void AtomBrowserContext::SetUserAgent(const std::string& user_agent) { +void ElectronBrowserContext::SetUserAgent(const std::string& user_agent) { user_agent_ = user_agent; } -base::FilePath AtomBrowserContext::GetPath() { +base::FilePath ElectronBrowserContext::GetPath() { return path_; } -bool AtomBrowserContext::IsOffTheRecord() { +bool ElectronBrowserContext::IsOffTheRecord() { return in_memory_; } -bool AtomBrowserContext::CanUseHttpCache() const { +bool ElectronBrowserContext::CanUseHttpCache() const { return use_cache_; } -int AtomBrowserContext::GetMaxCacheSize() const { +int ElectronBrowserContext::GetMaxCacheSize() const { return max_cache_size_; } -content::ResourceContext* AtomBrowserContext::GetResourceContext() { +content::ResourceContext* ElectronBrowserContext::GetResourceContext() { if (!resource_context_) resource_context_ = std::make_unique(); return resource_context_.get(); } -std::string AtomBrowserContext::GetMediaDeviceIDSalt() { +std::string ElectronBrowserContext::GetMediaDeviceIDSalt() { if (!media_device_id_salt_.get()) media_device_id_salt_ = std::make_unique(prefs_.get()); return media_device_id_salt_->GetSalt(); } std::unique_ptr -AtomBrowserContext::CreateZoomLevelDelegate( +ElectronBrowserContext::CreateZoomLevelDelegate( const base::FilePath& partition_path) { if (!IsOffTheRecord()) { return std::make_unique(prefs(), partition_path); @@ -267,37 +268,38 @@ AtomBrowserContext::CreateZoomLevelDelegate( } content::DownloadManagerDelegate* -AtomBrowserContext::GetDownloadManagerDelegate() { +ElectronBrowserContext::GetDownloadManagerDelegate() { if (!download_manager_delegate_.get()) { auto* download_manager = content::BrowserContext::GetDownloadManager(this); download_manager_delegate_ = - std::make_unique(download_manager); + std::make_unique(download_manager); } return download_manager_delegate_.get(); } -content::BrowserPluginGuestManager* AtomBrowserContext::GetGuestManager() { +content::BrowserPluginGuestManager* ElectronBrowserContext::GetGuestManager() { if (!guest_manager_) guest_manager_ = std::make_unique(); return guest_manager_.get(); } content::PermissionControllerDelegate* -AtomBrowserContext::GetPermissionControllerDelegate() { +ElectronBrowserContext::GetPermissionControllerDelegate() { if (!permission_manager_.get()) - permission_manager_ = std::make_unique(); + permission_manager_ = std::make_unique(); return permission_manager_.get(); } -storage::SpecialStoragePolicy* AtomBrowserContext::GetSpecialStoragePolicy() { +storage::SpecialStoragePolicy* +ElectronBrowserContext::GetSpecialStoragePolicy() { return storage_policy_.get(); } -std::string AtomBrowserContext::GetUserAgent() const { +std::string ElectronBrowserContext::GetUserAgent() const { return user_agent_; } -predictors::PreconnectManager* AtomBrowserContext::GetPreconnectManager() { +predictors::PreconnectManager* ElectronBrowserContext::GetPreconnectManager() { if (!preconnect_manager_.get()) { preconnect_manager_ = std::make_unique(nullptr, this); @@ -306,7 +308,7 @@ predictors::PreconnectManager* AtomBrowserContext::GetPreconnectManager() { } scoped_refptr -AtomBrowserContext::GetURLLoaderFactory() { +ElectronBrowserContext::GetURLLoaderFactory() { if (url_loader_factory_) return url_loader_factory_; @@ -317,7 +319,7 @@ AtomBrowserContext::GetURLLoaderFactory() { // Consult the embedder. mojo::PendingRemote header_client; - static_cast(AtomBrowserClient::Get()) + static_cast(ElectronBrowserClient::Get()) ->WillCreateURLLoaderFactory( this, nullptr, -1, content::ContentBrowserClient::URLLoaderFactoryType::kNavigation, @@ -372,47 +374,49 @@ class AuthResponder : public network::mojom::TrustedAuthClient { } }; -void AtomBrowserContext::OnLoaderCreated( +void ElectronBrowserContext::OnLoaderCreated( int32_t request_id, mojo::PendingReceiver auth_client) { mojo::MakeSelfOwnedReceiver(std::make_unique(), std::move(auth_client)); } -content::PushMessagingService* AtomBrowserContext::GetPushMessagingService() { +content::PushMessagingService* +ElectronBrowserContext::GetPushMessagingService() { return nullptr; } -content::SSLHostStateDelegate* AtomBrowserContext::GetSSLHostStateDelegate() { +content::SSLHostStateDelegate* +ElectronBrowserContext::GetSSLHostStateDelegate() { return nullptr; } content::BackgroundFetchDelegate* -AtomBrowserContext::GetBackgroundFetchDelegate() { +ElectronBrowserContext::GetBackgroundFetchDelegate() { return nullptr; } content::BackgroundSyncController* -AtomBrowserContext::GetBackgroundSyncController() { +ElectronBrowserContext::GetBackgroundSyncController() { return nullptr; } content::BrowsingDataRemoverDelegate* -AtomBrowserContext::GetBrowsingDataRemoverDelegate() { +ElectronBrowserContext::GetBrowsingDataRemoverDelegate() { return nullptr; } content::ClientHintsControllerDelegate* -AtomBrowserContext::GetClientHintsControllerDelegate() { +ElectronBrowserContext::GetClientHintsControllerDelegate() { return nullptr; } content::StorageNotificationService* -AtomBrowserContext::GetStorageNotificationService() { +ElectronBrowserContext::GetStorageNotificationService() { return nullptr; } -void AtomBrowserContext::SetCorsOriginAccessListForOrigin( +void ElectronBrowserContext::SetCorsOriginAccessListForOrigin( const url::Origin& source_origin, std::vector allow_patterns, std::vector block_patterns, @@ -422,7 +426,7 @@ void AtomBrowserContext::SetCorsOriginAccessListForOrigin( base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, std::move(closure)); } -ResolveProxyHelper* AtomBrowserContext::GetResolveProxyHelper() { +ResolveProxyHelper* ElectronBrowserContext::GetResolveProxyHelper() { if (!resolve_proxy_helper_) { resolve_proxy_helper_ = base::MakeRefCounted(this); } @@ -430,19 +434,19 @@ ResolveProxyHelper* AtomBrowserContext::GetResolveProxyHelper() { } // static -scoped_refptr AtomBrowserContext::From( +scoped_refptr ElectronBrowserContext::From( const std::string& partition, bool in_memory, base::DictionaryValue options) { PartitionKey key(partition, in_memory); auto* browser_context = browser_context_map_[key].get(); if (browser_context) - return scoped_refptr(browser_context); + return scoped_refptr(browser_context); auto* new_context = - new AtomBrowserContext(partition, in_memory, std::move(options)); + new ElectronBrowserContext(partition, in_memory, std::move(options)); browser_context_map_[key] = new_context->GetWeakPtr(); - return scoped_refptr(new_context); + return scoped_refptr(new_context); } } // namespace electron diff --git a/shell/browser/atom_browser_context.h b/shell/browser/electron_browser_context.h similarity index 84% rename from shell/browser/atom_browser_context.h rename to shell/browser/electron_browser_context.h index 00fcc8ca3d9..4c4b98be1a0 100644 --- a/shell/browser/atom_browser_context.h +++ b/shell/browser/electron_browser_context.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_BROWSER_CONTEXT_H_ -#define SHELL_BROWSER_ATOM_BROWSER_CONTEXT_H_ +#ifndef SHELL_BROWSER_ELECTRON_BROWSER_CONTEXT_H_ +#define SHELL_BROWSER_ELECTRON_BROWSER_CONTEXT_H_ #include #include @@ -41,16 +41,16 @@ class ElectronExtensionSystem; namespace electron { -class AtomBrowserContext; -class AtomDownloadManagerDelegate; -class AtomPermissionManager; +class ElectronBrowserContext; +class ElectronDownloadManagerDelegate; +class ElectronPermissionManager; class CookieChangeNotifier; class ResolveProxyHelper; class SpecialStoragePolicy; class WebViewManager; -class AtomBrowserContext - : public base::RefCountedDeleteOnSequence, +class ElectronBrowserContext + : public base::RefCountedDeleteOnSequence, public content::BrowserContext, public network::mojom::TrustedURLLoaderAuthClient { public: @@ -73,12 +73,12 @@ class AtomBrowserContext } }; using BrowserContextMap = - std::map>; + std::map>; // Get or create the BrowserContext according to its |partition| and // |in_memory|. The |options| will be passed to constructor when there is no // existing BrowserContext. - static scoped_refptr From( + static scoped_refptr From( const std::string& partition, bool in_memory, base::DictionaryValue options = base::DictionaryValue()); @@ -137,7 +137,7 @@ class AtomBrowserContext ValueMapPrefStore* in_memory_pref_store() const { return in_memory_pref_store_; } - base::WeakPtr GetWeakPtr() { + base::WeakPtr GetWeakPtr() { return weak_factory_.GetWeakPtr(); } @@ -148,14 +148,14 @@ class AtomBrowserContext #endif protected: - AtomBrowserContext(const std::string& partition, - bool in_memory, - base::DictionaryValue options); - ~AtomBrowserContext() override; + ElectronBrowserContext(const std::string& partition, + bool in_memory, + base::DictionaryValue options); + ~ElectronBrowserContext() override; private: - friend class base::RefCountedDeleteOnSequence; - friend class base::DeleteHelper; + friend class base::RefCountedDeleteOnSequence; + friend class base::DeleteHelper; void OnLoaderCreated(int32_t request_id, mojo::PendingReceiver @@ -171,9 +171,9 @@ class AtomBrowserContext std::unique_ptr resource_context_; std::unique_ptr cookie_change_notifier_; std::unique_ptr prefs_; - std::unique_ptr download_manager_delegate_; + std::unique_ptr download_manager_delegate_; std::unique_ptr guest_manager_; - std::unique_ptr permission_manager_; + std::unique_ptr permission_manager_; std::unique_ptr media_device_id_salt_; scoped_refptr resolve_proxy_helper_; scoped_refptr storage_policy_; @@ -199,11 +199,11 @@ class AtomBrowserContext scoped_refptr url_loader_factory_; mojo::Receiver auth_client_{this}; - base::WeakPtrFactory weak_factory_; + base::WeakPtrFactory weak_factory_; - DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext); + DISALLOW_COPY_AND_ASSIGN(ElectronBrowserContext); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_BROWSER_CONTEXT_H_ +#endif // SHELL_BROWSER_ELECTRON_BROWSER_CONTEXT_H_ diff --git a/shell/browser/atom_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc similarity index 89% rename from shell/browser/atom_browser_main_parts.cc rename to shell/browser/electron_browser_main_parts.cc index de974faaafc..a4784968bdd 100644 --- a/shell/browser/atom_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_browser_main_parts.h" +#include "shell/browser/electron_browser_main_parts.h" #include @@ -31,14 +31,14 @@ #include "media/base/localized_strings.h" #include "services/network/public/cpp/features.h" #include "services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler.h" -#include "shell/app/atom_main_delegate.h" -#include "shell/browser/api/atom_api_app.h" -#include "shell/browser/atom_browser_client.h" -#include "shell/browser/atom_browser_context.h" -#include "shell/browser/atom_paths.h" -#include "shell/browser/atom_web_ui_controller_factory.h" +#include "shell/app/electron_main_delegate.h" +#include "shell/browser/api/electron_api_app.h" #include "shell/browser/browser.h" #include "shell/browser/browser_process_impl.h" +#include "shell/browser/electron_browser_client.h" +#include "shell/browser/electron_browser_context.h" +#include "shell/browser/electron_paths.h" +#include "shell/browser/electron_web_ui_controller_factory.h" #include "shell/browser/feature_list.h" #include "shell/browser/javascript_environment.h" #include "shell/browser/media/media_capture_devices_dispatcher.h" @@ -85,7 +85,7 @@ #if defined(OS_MACOSX) #include "shell/browser/ui/cocoa/views_delegate_mac.h" #else -#include "shell/browser/ui/views/atom_views_delegate.h" +#include "shell/browser/ui/views/electron_views_delegate.h" #endif #if defined(OS_LINUX) @@ -213,20 +213,20 @@ int X11EmptyIOErrorHandler(Display* d) { } // namespace // static -AtomBrowserMainParts* AtomBrowserMainParts::self_ = nullptr; +ElectronBrowserMainParts* ElectronBrowserMainParts::self_ = nullptr; -AtomBrowserMainParts::AtomBrowserMainParts( +ElectronBrowserMainParts::ElectronBrowserMainParts( const content::MainFunctionParams& params) : fake_browser_process_(new BrowserProcessImpl), browser_(new Browser), node_bindings_( NodeBindings::Create(NodeBindings::BrowserEnvironment::BROWSER)), electron_bindings_(new ElectronBindings(uv_default_loop())) { - DCHECK(!self_) << "Cannot have two AtomBrowserMainParts"; + DCHECK(!self_) << "Cannot have two ElectronBrowserMainParts"; self_ = this; } -AtomBrowserMainParts::~AtomBrowserMainParts() { +ElectronBrowserMainParts::~ElectronBrowserMainParts() { asar::ClearArchives(); // Leak the JavascriptEnvironment on exit. // This is to work around the bug that V8 would be waiting for background @@ -240,12 +240,12 @@ AtomBrowserMainParts::~AtomBrowserMainParts() { } // static -AtomBrowserMainParts* AtomBrowserMainParts::Get() { +ElectronBrowserMainParts* ElectronBrowserMainParts::Get() { DCHECK(self_); return self_; } -bool AtomBrowserMainParts::SetExitCode(int code) { +bool ElectronBrowserMainParts::SetExitCode(int code) { if (!exit_code_) return false; @@ -253,11 +253,11 @@ bool AtomBrowserMainParts::SetExitCode(int code) { return true; } -int AtomBrowserMainParts::GetExitCode() { +int ElectronBrowserMainParts::GetExitCode() { return exit_code_ != nullptr ? *exit_code_ : 0; } -void AtomBrowserMainParts::RegisterDestructionCallback( +void ElectronBrowserMainParts::RegisterDestructionCallback( base::OnceClosure callback) { // The destructors should be called in reversed order, so dependencies between // JavaScript objects can be correctly resolved. @@ -265,7 +265,7 @@ void AtomBrowserMainParts::RegisterDestructionCallback( destructors_.insert(destructors_.begin(), std::move(callback)); } -int AtomBrowserMainParts::PreEarlyInitialization() { +int ElectronBrowserMainParts::PreEarlyInitialization() { field_trial_list_ = std::make_unique(nullptr); #if defined(USE_X11) views::LinuxUI::SetInstance(BuildGtkUi()); @@ -284,7 +284,7 @@ int AtomBrowserMainParts::PreEarlyInitialization() { return service_manager::RESULT_CODE_NORMAL_EXIT; } -void AtomBrowserMainParts::PostEarlyInitialization() { +void ElectronBrowserMainParts::PostEarlyInitialization() { // A workaround was previously needed because there was no ThreadTaskRunner // set. If this check is failing we may need to re-add that workaround DCHECK(base::ThreadTaskRunnerHandle::IsSet()); @@ -354,7 +354,7 @@ void AtomBrowserMainParts::PostEarlyInitialization() { fake_browser_process_->PostEarlyInitialization(); } -int AtomBrowserMainParts::PreCreateThreads() { +int ElectronBrowserMainParts::PreCreateThreads() { #if defined(USE_AURA) display::Screen* screen = views::CreateDesktopScreen(); display::Screen::SetScreenInstance(screen); @@ -368,7 +368,7 @@ int AtomBrowserMainParts::PreCreateThreads() { // Initialize the app locale. fake_browser_process_->SetApplicationLocale( - AtomBrowserClient::Get()->GetApplicationLocale()); + ElectronBrowserClient::Get()->GetApplicationLocale()); // Force MediaCaptureDevicesDispatcher to be created on UI thread. MediaCaptureDevicesDispatcher::GetInstance(); @@ -385,13 +385,13 @@ int AtomBrowserMainParts::PreCreateThreads() { return 0; } -void AtomBrowserMainParts::PostCreateThreads() { +void ElectronBrowserMainParts::PostCreateThreads() { base::PostTask( FROM_HERE, {content::BrowserThread::IO}, base::BindOnce(&tracing::TracingSamplerProfiler::CreateOnChildThread)); } -void AtomBrowserMainParts::PostDestroyThreads() { +void ElectronBrowserMainParts::PostDestroyThreads() { #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) extensions_browser_client_.reset(); extensions::ExtensionsBrowserClient::Set(nullptr); @@ -403,7 +403,7 @@ void AtomBrowserMainParts::PostDestroyThreads() { fake_browser_process_->PostDestroyThreads(); } -void AtomBrowserMainParts::ToolkitInitialized() { +void ElectronBrowserMainParts::ToolkitInitialized() { ui::MaterialDesignController::Initialize(); #if defined(USE_AURA) && defined(USE_X11) @@ -430,7 +430,7 @@ void AtomBrowserMainParts::ToolkitInitialized() { #endif } -void AtomBrowserMainParts::PreMainMessageLoopRun() { +void ElectronBrowserMainParts::PreMainMessageLoopRun() { // Run user's main script before most things get initialized, so we can have // a chance to setup everything. node_bindings_->PrepareMessageLoop(); @@ -463,7 +463,7 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() { base::Unretained(js_env_->isolate()))); content::WebUIControllerFactory::RegisterFactory( - AtomWebUIControllerFactory::GetInstance()); + ElectronWebUIControllerFactory::GetInstance()); // --remote-debugging-port auto* command_line = base::CommandLine::ForCurrentProcess(); @@ -471,7 +471,7 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() { DevToolsManagerDelegate::StartHttpHandler(); #if !defined(OS_MACOSX) - // The corresponding call in macOS is in AtomApplicationDelegate. + // The corresponding call in macOS is in ElectronApplicationDelegate. Browser::Get()->WillFinishLaunching(); Browser::Get()->DidFinishLaunching(base::DictionaryValue()); #endif @@ -480,18 +480,18 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() { Browser::Get()->PreMainMessageLoopRun(); } -bool AtomBrowserMainParts::MainMessageLoopRun(int* result_code) { +bool ElectronBrowserMainParts::MainMessageLoopRun(int* result_code) { js_env_->OnMessageLoopCreated(); exit_code_ = result_code; return content::BrowserMainParts::MainMessageLoopRun(result_code); } -void AtomBrowserMainParts::PreDefaultMainMessageLoopRun( +void ElectronBrowserMainParts::PreDefaultMainMessageLoopRun( base::OnceClosure quit_closure) { Browser::Get()->SetMainMessageLoopQuitClosure(std::move(quit_closure)); } -void AtomBrowserMainParts::PostMainMessageLoopStart() { +void ElectronBrowserMainParts::PostMainMessageLoopStart() { #if defined(USE_X11) // Installs the X11 error handlers for the browser process after the // main message loop has started. This will allow us to exit cleanly @@ -506,7 +506,7 @@ void AtomBrowserMainParts::PostMainMessageLoopStart() { #endif } -void AtomBrowserMainParts::PostMainMessageLoopRun() { +void ElectronBrowserMainParts::PostMainMessageLoopRun() { #if defined(USE_X11) // Unset the X11 error handlers. The X11 error handlers log the errors using a // |PostTask()| on the message-loop. But since the message-loop is in the @@ -537,12 +537,12 @@ void AtomBrowserMainParts::PostMainMessageLoopRun() { } #if !defined(OS_MACOSX) -void AtomBrowserMainParts::PreMainMessageLoopStart() { +void ElectronBrowserMainParts::PreMainMessageLoopStart() { PreMainMessageLoopStartCommon(); } #endif -void AtomBrowserMainParts::PreMainMessageLoopStartCommon() { +void ElectronBrowserMainParts::PreMainMessageLoopStartCommon() { #if defined(OS_MACOSX) InitializeMainNib(); RegisterURLHandler(); @@ -551,7 +551,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStartCommon() { } device::mojom::GeolocationControl* -AtomBrowserMainParts::GetGeolocationControl() { +ElectronBrowserMainParts::GetGeolocationControl() { if (!geolocation_control_) { content::GetDeviceService().BindGeolocationControl( geolocation_control_.BindNewPipeAndPassReceiver()); @@ -559,7 +559,7 @@ AtomBrowserMainParts::GetGeolocationControl() { return geolocation_control_.get(); } -IconManager* AtomBrowserMainParts::GetIconManager() { +IconManager* ElectronBrowserMainParts::GetIconManager() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!icon_manager_.get()) icon_manager_ = std::make_unique(); diff --git a/shell/browser/atom_browser_main_parts.h b/shell/browser/electron_browser_main_parts.h similarity index 88% rename from shell/browser/atom_browser_main_parts.h rename to shell/browser/electron_browser_main_parts.h index 0a6c7254b8a..6a72ea90c08 100644 --- a/shell/browser/atom_browser_main_parts.h +++ b/shell/browser/electron_browser_main_parts.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_ -#define SHELL_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_ +#ifndef SHELL_BROWSER_ELECTRON_BROWSER_MAIN_PARTS_H_ +#define SHELL_BROWSER_ELECTRON_BROWSER_MAIN_PARTS_H_ #include #include @@ -31,7 +31,7 @@ class WMState; namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; class Browser; class ElectronBindings; class JavascriptEnvironment; @@ -53,12 +53,12 @@ class ViewsDelegate; class ViewsDelegateMac; #endif -class AtomBrowserMainParts : public content::BrowserMainParts { +class ElectronBrowserMainParts : public content::BrowserMainParts { public: - explicit AtomBrowserMainParts(const content::MainFunctionParams& params); - ~AtomBrowserMainParts() override; + explicit ElectronBrowserMainParts(const content::MainFunctionParams& params); + ~ElectronBrowserMainParts() override; - static AtomBrowserMainParts* Get(); + static ElectronBrowserMainParts* Get(); // Sets the exit code, will fail if the message loop is not ready. bool SetExitCode(int code); @@ -150,11 +150,11 @@ class AtomBrowserMainParts : public content::BrowserMainParts { mojo::Remote geolocation_control_; - static AtomBrowserMainParts* self_; + static ElectronBrowserMainParts* self_; - DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts); + DISALLOW_COPY_AND_ASSIGN(ElectronBrowserMainParts); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_ +#endif // SHELL_BROWSER_ELECTRON_BROWSER_MAIN_PARTS_H_ diff --git a/shell/browser/atom_browser_main_parts_mac.mm b/shell/browser/electron_browser_main_parts_mac.mm similarity index 77% rename from shell/browser/atom_browser_main_parts_mac.mm rename to shell/browser/electron_browser_main_parts_mac.mm index 523b87c1747..90f97098a7d 100644 --- a/shell/browser/atom_browser_main_parts_mac.mm +++ b/shell/browser/electron_browser_main_parts_mac.mm @@ -2,21 +2,22 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_browser_main_parts.h" +#include "shell/browser/electron_browser_main_parts.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/path_service.h" -#include "shell/browser/atom_paths.h" -#import "shell/browser/mac/atom_application.h" -#include "shell/browser/mac/atom_application_delegate.h" +#include "shell/browser/electron_paths.h" +#import "shell/browser/mac/electron_application.h" +#include "shell/browser/mac/electron_application_delegate.h" #include "ui/base/l10n/l10n_util_mac.h" namespace electron { -void AtomBrowserMainParts::PreMainMessageLoopStart() { +void ElectronBrowserMainParts::PreMainMessageLoopStart() { // Set our own application delegate. - AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init]; + ElectronApplicationDelegate* delegate = + [[ElectronApplicationDelegate alloc] init]; [NSApp setDelegate:delegate]; PreMainMessageLoopStartCommon(); @@ -28,17 +29,17 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() { forKey:@"NSTreatUnknownArgumentsAsOpen"]; } -void AtomBrowserMainParts::FreeAppDelegate() { +void ElectronBrowserMainParts::FreeAppDelegate() { [[NSApp delegate] release]; [NSApp setDelegate:nil]; } -void AtomBrowserMainParts::RegisterURLHandler() { - [[AtomApplication sharedApplication] registerURLHandler]; +void ElectronBrowserMainParts::RegisterURLHandler() { + [[ElectronApplication sharedApplication] registerURLHandler]; } // Replicates NSApplicationMain, but doesn't start a run loop. -void AtomBrowserMainParts::InitializeMainNib() { +void ElectronBrowserMainParts::InitializeMainNib() { auto infoDictionary = base::mac::OuterBundle().infoDictionary; auto principalClass = diff --git a/shell/browser/atom_browser_main_parts_posix.cc b/shell/browser/electron_browser_main_parts_posix.cc similarity index 97% rename from shell/browser/atom_browser_main_parts_posix.cc rename to shell/browser/electron_browser_main_parts_posix.cc index b3b4716deb5..4bd8f002d3e 100644 --- a/shell/browser/atom_browser_main_parts_posix.cc +++ b/shell/browser/electron_browser_main_parts_posix.cc @@ -4,7 +4,7 @@ // Most code came from: chrome/browser/chrome_browser_main_posix.cc. -#include "shell/browser/atom_browser_main_parts.h" +#include "shell/browser/electron_browser_main_parts.h" #include #include @@ -164,7 +164,7 @@ void ShutdownDetector::ThreadMain() { } // namespace -void AtomBrowserMainParts::HandleSIGCHLD() { +void ElectronBrowserMainParts::HandleSIGCHLD() { // We need to accept SIGCHLD, even though our handler is a no-op because // otherwise we cannot wait on children. (According to POSIX 2001.) struct sigaction action; @@ -173,7 +173,7 @@ void AtomBrowserMainParts::HandleSIGCHLD() { CHECK_EQ(sigaction(SIGCHLD, &action, nullptr), 0); } -void AtomBrowserMainParts::HandleShutdownSignals() { +void ElectronBrowserMainParts::HandleShutdownSignals() { int pipefd[2]; int ret = pipe(pipefd); if (ret < 0) { diff --git a/shell/browser/atom_download_manager_delegate.cc b/shell/browser/electron_download_manager_delegate.cc similarity index 87% rename from shell/browser/atom_download_manager_delegate.cc rename to shell/browser/electron_download_manager_delegate.cc index 05a8837d72d..bc469ee94ec 100644 --- a/shell/browser/atom_download_manager_delegate.cc +++ b/shell/browser/electron_download_manager_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_download_manager_delegate.h" +#include "shell/browser/electron_download_manager_delegate.h" #include #include @@ -18,8 +18,8 @@ #include "content/public/browser/download_item_utils.h" #include "content/public/browser/download_manager.h" #include "net/base/filename_util.h" -#include "shell/browser/api/atom_api_download_item.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/api/electron_api_download_item.h" +#include "shell/browser/electron_browser_context.h" #include "shell/browser/native_window.h" #include "shell/browser/ui/file_dialog.h" #include "shell/browser/web_contents_preferences.h" @@ -49,11 +49,11 @@ base::FilePath CreateDownloadPath(const GURL& url, } // namespace -AtomDownloadManagerDelegate::AtomDownloadManagerDelegate( +ElectronDownloadManagerDelegate::ElectronDownloadManagerDelegate( content::DownloadManager* manager) : download_manager_(manager), weak_ptr_factory_(this) {} -AtomDownloadManagerDelegate::~AtomDownloadManagerDelegate() { +ElectronDownloadManagerDelegate::~ElectronDownloadManagerDelegate() { if (download_manager_) { DCHECK_EQ(static_cast(this), download_manager_->GetDelegate()); @@ -62,8 +62,9 @@ AtomDownloadManagerDelegate::~AtomDownloadManagerDelegate() { } } -void AtomDownloadManagerDelegate::GetItemSavePath(download::DownloadItem* item, - base::FilePath* path) { +void ElectronDownloadManagerDelegate::GetItemSavePath( + download::DownloadItem* item, + base::FilePath* path) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Locker locker(isolate); v8::HandleScope handle_scope(isolate); @@ -73,7 +74,7 @@ void AtomDownloadManagerDelegate::GetItemSavePath(download::DownloadItem* item, *path = download->GetSavePath(); } -void AtomDownloadManagerDelegate::GetItemSaveDialogOptions( +void ElectronDownloadManagerDelegate::GetItemSaveDialogOptions( download::DownloadItem* item, file_dialog::DialogSettings* options) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); @@ -85,7 +86,7 @@ void AtomDownloadManagerDelegate::GetItemSaveDialogOptions( *options = download->GetSaveDialogOptions(); } -void AtomDownloadManagerDelegate::OnDownloadPathGenerated( +void ElectronDownloadManagerDelegate::OnDownloadPathGenerated( uint32_t download_id, content::DownloadTargetCallback callback, const base::FilePath& default_path) { @@ -126,7 +127,7 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated( v8::Isolate* isolate = v8::Isolate::GetCurrent(); gin_helper::Promise dialog_promise(isolate); auto dialog_callback = base::BindOnce( - &AtomDownloadManagerDelegate::OnDownloadSaveDialogDone, + &ElectronDownloadManagerDelegate::OnDownloadSaveDialogDone, base::Unretained(this), download_id, std::move(callback)); ignore_result(dialog_promise.Then(std::move(dialog_callback))); @@ -140,7 +141,7 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated( } } -void AtomDownloadManagerDelegate::OnDownloadSaveDialogDone( +void ElectronDownloadManagerDelegate::OnDownloadSaveDialogDone( uint32_t download_id, content::DownloadTargetCallback download_callback, gin_helper::Dictionary result) { @@ -158,8 +159,9 @@ void AtomDownloadManagerDelegate::OnDownloadSaveDialogDone( if (!canceled) { if (result.Get("filePath", &path)) { // Remember the last selected download directory. - AtomBrowserContext* browser_context = static_cast( - download_manager_->GetBrowserContext()); + ElectronBrowserContext* browser_context = + static_cast( + download_manager_->GetBrowserContext()); browser_context->prefs()->SetFilePath(prefs::kDownloadDefaultDirectory, path.DirName()); @@ -185,12 +187,12 @@ void AtomDownloadManagerDelegate::OnDownloadSaveDialogDone( item->GetMixedContentStatus(), path, interrupt_reason); } -void AtomDownloadManagerDelegate::Shutdown() { +void ElectronDownloadManagerDelegate::Shutdown() { weak_ptr_factory_.InvalidateWeakPtrs(); download_manager_ = nullptr; } -bool AtomDownloadManagerDelegate::DetermineDownloadTarget( +bool ElectronDownloadManagerDelegate::DetermineDownloadTarget( download::DownloadItem* download, content::DownloadTargetCallback* callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -218,8 +220,9 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget( return true; } - AtomBrowserContext* browser_context = - static_cast(download_manager_->GetBrowserContext()); + ElectronBrowserContext* browser_context = + static_cast( + download_manager_->GetBrowserContext()); base::FilePath default_download_path = browser_context->prefs()->GetFilePath(prefs::kDownloadDefaultDirectory); @@ -231,19 +234,19 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget( download->GetContentDisposition(), download->GetSuggestedFilename(), download->GetMimeType(), default_download_path), - base::BindOnce(&AtomDownloadManagerDelegate::OnDownloadPathGenerated, + base::BindOnce(&ElectronDownloadManagerDelegate::OnDownloadPathGenerated, weak_ptr_factory_.GetWeakPtr(), download->GetId(), std::move(*callback))); return true; } -bool AtomDownloadManagerDelegate::ShouldOpenDownload( +bool ElectronDownloadManagerDelegate::ShouldOpenDownload( download::DownloadItem* download, content::DownloadOpenDelayedCallback callback) { return true; } -void AtomDownloadManagerDelegate::GetNextId( +void ElectronDownloadManagerDelegate::GetNextId( content::DownloadIdCallback callback) { static uint32_t next_id = download::DownloadItem::kInvalidId + 1; std::move(callback).Run(next_id++); diff --git a/shell/browser/atom_download_manager_delegate.h b/shell/browser/electron_download_manager_delegate.h similarity index 75% rename from shell/browser/atom_download_manager_delegate.h rename to shell/browser/electron_download_manager_delegate.h index c7b52d85a33..fb0c7e58f22 100644 --- a/shell/browser/atom_download_manager_delegate.h +++ b/shell/browser/electron_download_manager_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_DOWNLOAD_MANAGER_DELEGATE_H_ -#define SHELL_BROWSER_ATOM_DOWNLOAD_MANAGER_DELEGATE_H_ +#ifndef SHELL_BROWSER_ELECTRON_DOWNLOAD_MANAGER_DELEGATE_H_ +#define SHELL_BROWSER_ELECTRON_DOWNLOAD_MANAGER_DELEGATE_H_ #include @@ -18,13 +18,14 @@ class DownloadManager; namespace electron { -class AtomDownloadManagerDelegate : public content::DownloadManagerDelegate { +class ElectronDownloadManagerDelegate + : public content::DownloadManagerDelegate { public: using CreateDownloadPathCallback = base::Callback; - explicit AtomDownloadManagerDelegate(content::DownloadManager* manager); - ~AtomDownloadManagerDelegate() override; + explicit ElectronDownloadManagerDelegate(content::DownloadManager* manager); + ~ElectronDownloadManagerDelegate() override; // content::DownloadManagerDelegate: void Shutdown() override; @@ -52,11 +53,11 @@ class AtomDownloadManagerDelegate : public content::DownloadManagerDelegate { gin_helper::Dictionary result); content::DownloadManager* download_manager_; - base::WeakPtrFactory weak_ptr_factory_; + base::WeakPtrFactory weak_ptr_factory_; - DISALLOW_COPY_AND_ASSIGN(AtomDownloadManagerDelegate); + DISALLOW_COPY_AND_ASSIGN(ElectronDownloadManagerDelegate); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_DOWNLOAD_MANAGER_DELEGATE_H_ +#endif // SHELL_BROWSER_ELECTRON_DOWNLOAD_MANAGER_DELEGATE_H_ diff --git a/shell/browser/atom_gpu_client.cc b/shell/browser/electron_gpu_client.cc similarity index 75% rename from shell/browser/atom_gpu_client.cc rename to shell/browser/electron_gpu_client.cc index f5e04fc4499..c7457849a71 100644 --- a/shell/browser/atom_gpu_client.cc +++ b/shell/browser/electron_gpu_client.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_gpu_client.h" +#include "shell/browser/electron_gpu_client.h" #include "base/environment.h" @@ -12,9 +12,9 @@ namespace electron { -AtomGpuClient::AtomGpuClient() = default; +ElectronGpuClient::ElectronGpuClient() = default; -void AtomGpuClient::PreCreateMessageLoop() { +void ElectronGpuClient::PreCreateMessageLoop() { #if defined(OS_WIN) auto env = base::Environment::Create(); if (env->HasVar("ELECTRON_DEFAULT_ERROR_MODE")) diff --git a/shell/browser/atom_gpu_client.h b/shell/browser/electron_gpu_client.h similarity index 55% rename from shell/browser/atom_gpu_client.h rename to shell/browser/electron_gpu_client.h index fc64f2a8492..bbedf298b41 100644 --- a/shell/browser/atom_gpu_client.h +++ b/shell/browser/electron_gpu_client.h @@ -2,24 +2,24 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_GPU_CLIENT_H_ -#define SHELL_BROWSER_ATOM_GPU_CLIENT_H_ +#ifndef SHELL_BROWSER_ELECTRON_GPU_CLIENT_H_ +#define SHELL_BROWSER_ELECTRON_GPU_CLIENT_H_ #include "content/public/gpu/content_gpu_client.h" namespace electron { -class AtomGpuClient : public content::ContentGpuClient { +class ElectronGpuClient : public content::ContentGpuClient { public: - AtomGpuClient(); + ElectronGpuClient(); // content::ContentGpuClient: void PreCreateMessageLoop() override; private: - DISALLOW_COPY_AND_ASSIGN(AtomGpuClient); + DISALLOW_COPY_AND_ASSIGN(ElectronGpuClient); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_GPU_CLIENT_H_ +#endif // SHELL_BROWSER_ELECTRON_GPU_CLIENT_H_ diff --git a/shell/browser/atom_javascript_dialog_manager.cc b/shell/browser/electron_javascript_dialog_manager.cc similarity index 86% rename from shell/browser/atom_javascript_dialog_manager.cc rename to shell/browser/electron_javascript_dialog_manager.cc index a425537f61b..2db0480724f 100644 --- a/shell/browser/atom_javascript_dialog_manager.cc +++ b/shell/browser/electron_javascript_dialog_manager.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_javascript_dialog_manager.h" +#include "shell/browser/electron_javascript_dialog_manager.h" #include #include @@ -10,7 +10,7 @@ #include "base/bind.h" #include "base/strings/utf_string_conversions.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/native_window.h" #include "shell/browser/ui/message_box.h" #include "shell/browser/web_contents_preferences.h" @@ -27,12 +27,12 @@ constexpr int kUserWantsNoMoreDialogs = -1; } // namespace -AtomJavaScriptDialogManager::AtomJavaScriptDialogManager( +ElectronJavaScriptDialogManager::ElectronJavaScriptDialogManager( api::WebContents* api_web_contents) : api_web_contents_(api_web_contents) {} -AtomJavaScriptDialogManager::~AtomJavaScriptDialogManager() = default; +ElectronJavaScriptDialogManager::~ElectronJavaScriptDialogManager() = default; -void AtomJavaScriptDialogManager::RunJavaScriptDialog( +void ElectronJavaScriptDialogManager::RunJavaScriptDialog( content::WebContents* web_contents, content::RenderFrameHost* rfh, JavaScriptDialogType dialog_type, @@ -100,12 +100,12 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog( electron::ShowMessageBox( settings, - base::BindOnce(&AtomJavaScriptDialogManager::OnMessageBoxCallback, + base::BindOnce(&ElectronJavaScriptDialogManager::OnMessageBoxCallback, base::Unretained(this), base::Passed(std::move(callback)), origin)); } -void AtomJavaScriptDialogManager::RunBeforeUnloadDialog( +void ElectronJavaScriptDialogManager::RunBeforeUnloadDialog( content::WebContents* web_contents, content::RenderFrameHost* rfh, bool is_reload, @@ -115,11 +115,11 @@ void AtomJavaScriptDialogManager::RunBeforeUnloadDialog( return; } -void AtomJavaScriptDialogManager::CancelDialogs( +void ElectronJavaScriptDialogManager::CancelDialogs( content::WebContents* web_contents, bool reset_state) {} -void AtomJavaScriptDialogManager::OnMessageBoxCallback( +void ElectronJavaScriptDialogManager::OnMessageBoxCallback( DialogClosedCallback callback, const std::string& origin, int code, diff --git a/shell/browser/atom_javascript_dialog_manager.h b/shell/browser/electron_javascript_dialog_manager.h similarity index 78% rename from shell/browser/atom_javascript_dialog_manager.h rename to shell/browser/electron_javascript_dialog_manager.h index 330490a6a0f..69a865c47f7 100644 --- a/shell/browser/atom_javascript_dialog_manager.h +++ b/shell/browser/electron_javascript_dialog_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_ -#define SHELL_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_ +#ifndef SHELL_BROWSER_ELECTRON_JAVASCRIPT_DIALOG_MANAGER_H_ +#define SHELL_BROWSER_ELECTRON_JAVASCRIPT_DIALOG_MANAGER_H_ #include #include @@ -16,10 +16,11 @@ namespace api { class WebContents; } -class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager { +class ElectronJavaScriptDialogManager + : public content::JavaScriptDialogManager { public: - explicit AtomJavaScriptDialogManager(api::WebContents* api_web_contents); - ~AtomJavaScriptDialogManager() override; + explicit ElectronJavaScriptDialogManager(api::WebContents* api_web_contents); + ~ElectronJavaScriptDialogManager() override; // content::JavaScriptDialogManager implementations. void RunJavaScriptDialog(content::WebContents* web_contents, @@ -48,4 +49,4 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager { } // namespace electron -#endif // SHELL_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_ +#endif // SHELL_BROWSER_ELECTRON_JAVASCRIPT_DIALOG_MANAGER_H_ diff --git a/shell/browser/atom_navigation_throttle.cc b/shell/browser/electron_navigation_throttle.cc similarity index 69% rename from shell/browser/atom_navigation_throttle.cc rename to shell/browser/electron_navigation_throttle.cc index f4f6aac852a..5c0ef054421 100644 --- a/shell/browser/atom_navigation_throttle.cc +++ b/shell/browser/electron_navigation_throttle.cc @@ -2,25 +2,25 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_navigation_throttle.h" +#include "shell/browser/electron_navigation_throttle.h" #include "content/public/browser/navigation_handle.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" namespace electron { -AtomNavigationThrottle::AtomNavigationThrottle( +ElectronNavigationThrottle::ElectronNavigationThrottle( content::NavigationHandle* navigation_handle) : content::NavigationThrottle(navigation_handle) {} -AtomNavigationThrottle::~AtomNavigationThrottle() = default; +ElectronNavigationThrottle::~ElectronNavigationThrottle() = default; -const char* AtomNavigationThrottle::GetNameForLogging() { - return "AtomNavigationThrottle"; +const char* ElectronNavigationThrottle::GetNameForLogging() { + return "ElectronNavigationThrottle"; } content::NavigationThrottle::ThrottleCheckResult -AtomNavigationThrottle::WillRedirectRequest() { +ElectronNavigationThrottle::WillRedirectRequest() { auto* handle = navigation_handle(); auto* contents = handle->GetWebContents(); if (!contents) { diff --git a/shell/browser/electron_navigation_throttle.h b/shell/browser/electron_navigation_throttle.h new file mode 100644 index 00000000000..b7f96205ea5 --- /dev/null +++ b/shell/browser/electron_navigation_throttle.h @@ -0,0 +1,28 @@ +// Copyright (c) 2018 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef SHELL_BROWSER_ELECTRON_NAVIGATION_THROTTLE_H_ +#define SHELL_BROWSER_ELECTRON_NAVIGATION_THROTTLE_H_ + +#include "content/public/browser/navigation_throttle.h" + +namespace electron { + +class ElectronNavigationThrottle : public content::NavigationThrottle { + public: + explicit ElectronNavigationThrottle(content::NavigationHandle* handle); + ~ElectronNavigationThrottle() override; + + ElectronNavigationThrottle::ThrottleCheckResult WillRedirectRequest() + override; + + const char* GetNameForLogging() override; + + private: + DISALLOW_COPY_AND_ASSIGN(ElectronNavigationThrottle); +}; + +} // namespace electron + +#endif // SHELL_BROWSER_ELECTRON_NAVIGATION_THROTTLE_H_ diff --git a/shell/browser/atom_paths.h b/shell/browser/electron_paths.h similarity index 90% rename from shell/browser/atom_paths.h rename to shell/browser/electron_paths.h index d534b8991ac..070cdb74d6a 100644 --- a/shell/browser/atom_paths.h +++ b/shell/browser/electron_paths.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_PATHS_H_ -#define SHELL_BROWSER_ATOM_PATHS_H_ +#ifndef SHELL_BROWSER_ELECTRON_PATHS_H_ +#define SHELL_BROWSER_ELECTRON_PATHS_H_ #include "base/base_paths.h" @@ -47,4 +47,4 @@ static_assert(PATH_START < PATH_END, "invalid PATH boundaries"); } // namespace electron -#endif // SHELL_BROWSER_ATOM_PATHS_H_ +#endif // SHELL_BROWSER_ELECTRON_PATHS_H_ diff --git a/shell/browser/atom_permission_manager.cc b/shell/browser/electron_permission_manager.cc similarity index 84% rename from shell/browser/atom_permission_manager.cc rename to shell/browser/electron_permission_manager.cc index 3c8793b7e2d..c06828be6c3 100644 --- a/shell/browser/atom_permission_manager.cc +++ b/shell/browser/electron_permission_manager.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_permission_manager.h" +#include "shell/browser/electron_permission_manager.h" #include #include @@ -15,8 +15,8 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" -#include "shell/browser/atom_browser_client.h" -#include "shell/browser/atom_browser_main_parts.h" +#include "shell/browser/electron_browser_client.h" +#include "shell/browser/electron_browser_main_parts.h" #include "shell/browser/web_contents_preferences.h" namespace electron { @@ -25,7 +25,7 @@ namespace { bool WebContentsDestroyed(int process_id) { content::WebContents* web_contents = - static_cast(AtomBrowserClient::Get()) + static_cast(ElectronBrowserClient::Get()) ->GetWebContentsFromProcessID(process_id); if (!web_contents) return true; @@ -33,14 +33,14 @@ bool WebContentsDestroyed(int process_id) { } void PermissionRequestResponseCallbackWrapper( - AtomPermissionManager::StatusCallback callback, + ElectronPermissionManager::StatusCallback callback, const std::vector& vector) { std::move(callback).Run(vector[0]); } } // namespace -class AtomPermissionManager::PendingRequest { +class ElectronPermissionManager::PendingRequest { public: PendingRequest(content::RenderFrameHost* render_frame_host, const std::vector& permissions, @@ -61,7 +61,7 @@ class AtomPermissionManager::PendingRequest { content::ChildProcessSecurityPolicy::GetInstance() ->GrantSendMidiSysExMessage(render_process_id_); } else if (permission == content::PermissionType::GEOLOCATION) { - AtomBrowserMainParts::Get() + ElectronBrowserMainParts::Get() ->GetGeolocationControl() ->UserDidOptIntoLocationServices(); } @@ -89,11 +89,11 @@ class AtomPermissionManager::PendingRequest { size_t remaining_results_; }; -AtomPermissionManager::AtomPermissionManager() = default; +ElectronPermissionManager::ElectronPermissionManager() = default; -AtomPermissionManager::~AtomPermissionManager() = default; +ElectronPermissionManager::~ElectronPermissionManager() = default; -void AtomPermissionManager::SetPermissionRequestHandler( +void ElectronPermissionManager::SetPermissionRequestHandler( const RequestHandler& handler) { if (handler.is_null() && !pending_requests_.IsEmpty()) { for (PendingRequestsMap::iterator iter(&pending_requests_); !iter.IsAtEnd(); @@ -107,12 +107,12 @@ void AtomPermissionManager::SetPermissionRequestHandler( request_handler_ = handler; } -void AtomPermissionManager::SetPermissionCheckHandler( +void ElectronPermissionManager::SetPermissionCheckHandler( const CheckHandler& handler) { check_handler_ = handler; } -int AtomPermissionManager::RequestPermission( +int ElectronPermissionManager::RequestPermission( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, @@ -123,7 +123,7 @@ int AtomPermissionManager::RequestPermission( std::move(response_callback)); } -int AtomPermissionManager::RequestPermissionWithDetails( +int ElectronPermissionManager::RequestPermissionWithDetails( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, @@ -137,7 +137,7 @@ int AtomPermissionManager::RequestPermissionWithDetails( std::move(response_callback))); } -int AtomPermissionManager::RequestPermissions( +int ElectronPermissionManager::RequestPermissions( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, @@ -148,7 +148,7 @@ int AtomPermissionManager::RequestPermissions( std::move(response_callback)); } -int AtomPermissionManager::RequestPermissionsWithDetails( +int ElectronPermissionManager::RequestPermissionsWithDetails( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, @@ -168,7 +168,7 @@ int AtomPermissionManager::RequestPermissionsWithDetails( ->GrantSendMidiSysExMessage( render_frame_host->GetProcess()->GetID()); } else if (permission == content::PermissionType::GEOLOCATION) { - AtomBrowserMainParts::Get() + ElectronBrowserMainParts::Get() ->GetGeolocationControl() ->UserDidOptIntoLocationServices(); } @@ -186,7 +186,7 @@ int AtomPermissionManager::RequestPermissionsWithDetails( for (size_t i = 0; i < permissions.size(); ++i) { auto permission = permissions[i]; const auto callback = - base::BindRepeating(&AtomPermissionManager::OnPermissionResponse, + base::BindRepeating(&ElectronPermissionManager::OnPermissionResponse, base::Unretained(this), request_id, i); auto mutable_details = details == nullptr ? base::DictionaryValue() : details->Clone(); @@ -200,7 +200,7 @@ int AtomPermissionManager::RequestPermissionsWithDetails( return request_id; } -void AtomPermissionManager::OnPermissionResponse( +void ElectronPermissionManager::OnPermissionResponse( int request_id, int permission_id, blink::mojom::PermissionStatus status) { @@ -215,18 +215,19 @@ void AtomPermissionManager::OnPermissionResponse( } } -void AtomPermissionManager::ResetPermission(content::PermissionType permission, - const GURL& requesting_origin, - const GURL& embedding_origin) {} +void ElectronPermissionManager::ResetPermission( + content::PermissionType permission, + const GURL& requesting_origin, + const GURL& embedding_origin) {} -blink::mojom::PermissionStatus AtomPermissionManager::GetPermissionStatus( +blink::mojom::PermissionStatus ElectronPermissionManager::GetPermissionStatus( content::PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) { return blink::mojom::PermissionStatus::GRANTED; } -int AtomPermissionManager::SubscribePermissionStatusChange( +int ElectronPermissionManager::SubscribePermissionStatusChange( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, @@ -234,10 +235,10 @@ int AtomPermissionManager::SubscribePermissionStatusChange( return -1; } -void AtomPermissionManager::UnsubscribePermissionStatusChange( +void ElectronPermissionManager::UnsubscribePermissionStatusChange( int subscription_id) {} -bool AtomPermissionManager::CheckPermissionWithDetails( +bool ElectronPermissionManager::CheckPermissionWithDetails( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, @@ -258,7 +259,7 @@ bool AtomPermissionManager::CheckPermissionWithDetails( } blink::mojom::PermissionStatus -AtomPermissionManager::GetPermissionStatusForFrame( +ElectronPermissionManager::GetPermissionStatusForFrame( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin) { diff --git a/shell/browser/atom_permission_manager.h b/shell/browser/electron_permission_manager.h similarity index 92% rename from shell/browser/atom_permission_manager.h rename to shell/browser/electron_permission_manager.h index d1a4c6889c0..a347afd8375 100644 --- a/shell/browser/atom_permission_manager.h +++ b/shell/browser/electron_permission_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_PERMISSION_MANAGER_H_ -#define SHELL_BROWSER_ATOM_PERMISSION_MANAGER_H_ +#ifndef SHELL_BROWSER_ELECTRON_PERMISSION_MANAGER_H_ +#define SHELL_BROWSER_ELECTRON_PERMISSION_MANAGER_H_ #include #include @@ -20,10 +20,10 @@ class WebContents; namespace electron { -class AtomPermissionManager : public content::PermissionControllerDelegate { +class ElectronPermissionManager : public content::PermissionControllerDelegate { public: - AtomPermissionManager(); - ~AtomPermissionManager() override; + ElectronPermissionManager(); + ~ElectronPermissionManager() override; using StatusCallback = base::OnceCallback; @@ -107,9 +107,9 @@ class AtomPermissionManager : public content::PermissionControllerDelegate { PendingRequestsMap pending_requests_; - DISALLOW_COPY_AND_ASSIGN(AtomPermissionManager); + DISALLOW_COPY_AND_ASSIGN(ElectronPermissionManager); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_PERMISSION_MANAGER_H_ +#endif // SHELL_BROWSER_ELECTRON_PERMISSION_MANAGER_H_ diff --git a/shell/browser/atom_quota_permission_context.cc b/shell/browser/electron_quota_permission_context.cc similarity index 58% rename from shell/browser/atom_quota_permission_context.cc rename to shell/browser/electron_quota_permission_context.cc index 8753d6afd2c..7c0f98d2195 100644 --- a/shell/browser/atom_quota_permission_context.cc +++ b/shell/browser/electron_quota_permission_context.cc @@ -2,17 +2,17 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_quota_permission_context.h" +#include "shell/browser/electron_quota_permission_context.h" #include namespace electron { -AtomQuotaPermissionContext::AtomQuotaPermissionContext() = default; +ElectronQuotaPermissionContext::ElectronQuotaPermissionContext() = default; -AtomQuotaPermissionContext::~AtomQuotaPermissionContext() = default; +ElectronQuotaPermissionContext::~ElectronQuotaPermissionContext() = default; -void AtomQuotaPermissionContext::RequestQuotaPermission( +void ElectronQuotaPermissionContext::RequestQuotaPermission( const content::StorageQuotaParams& params, int render_process_id, PermissionCallback callback) { diff --git a/shell/browser/atom_quota_permission_context.h b/shell/browser/electron_quota_permission_context.h similarity index 61% rename from shell/browser/atom_quota_permission_context.h rename to shell/browser/electron_quota_permission_context.h index 6c1394df6f9..5312b968d40 100644 --- a/shell/browser/atom_quota_permission_context.h +++ b/shell/browser/electron_quota_permission_context.h @@ -2,19 +2,19 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_QUOTA_PERMISSION_CONTEXT_H_ -#define SHELL_BROWSER_ATOM_QUOTA_PERMISSION_CONTEXT_H_ +#ifndef SHELL_BROWSER_ELECTRON_QUOTA_PERMISSION_CONTEXT_H_ +#define SHELL_BROWSER_ELECTRON_QUOTA_PERMISSION_CONTEXT_H_ #include "content/public/browser/quota_permission_context.h" #include "content/public/common/storage_quota_params.h" namespace electron { -class AtomQuotaPermissionContext : public content::QuotaPermissionContext { +class ElectronQuotaPermissionContext : public content::QuotaPermissionContext { public: typedef content::QuotaPermissionContext::QuotaPermissionResponse response; - AtomQuotaPermissionContext(); + ElectronQuotaPermissionContext(); // content::QuotaPermissionContext: void RequestQuotaPermission(const content::StorageQuotaParams& params, @@ -22,11 +22,11 @@ class AtomQuotaPermissionContext : public content::QuotaPermissionContext { PermissionCallback callback) override; private: - ~AtomQuotaPermissionContext() override; + ~ElectronQuotaPermissionContext() override; - DISALLOW_COPY_AND_ASSIGN(AtomQuotaPermissionContext); + DISALLOW_COPY_AND_ASSIGN(ElectronQuotaPermissionContext); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_QUOTA_PERMISSION_CONTEXT_H_ +#endif // SHELL_BROWSER_ELECTRON_QUOTA_PERMISSION_CONTEXT_H_ diff --git a/shell/browser/electron_speech_recognition_manager_delegate.cc b/shell/browser/electron_speech_recognition_manager_delegate.cc new file mode 100644 index 00000000000..5a6cfa86daa --- /dev/null +++ b/shell/browser/electron_speech_recognition_manager_delegate.cc @@ -0,0 +1,66 @@ +// Copyright (c) 2014 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "shell/browser/electron_speech_recognition_manager_delegate.h" + +#include +#include + +#include "base/callback.h" + +namespace electron { + +ElectronSpeechRecognitionManagerDelegate:: + ElectronSpeechRecognitionManagerDelegate() = default; + +ElectronSpeechRecognitionManagerDelegate:: + ~ElectronSpeechRecognitionManagerDelegate() = default; + +void ElectronSpeechRecognitionManagerDelegate::OnRecognitionStart( + int session_id) {} + +void ElectronSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {} + +void ElectronSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete( + int session_id) {} + +void ElectronSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) {} + +void ElectronSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) {} + +void ElectronSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {} + +void ElectronSpeechRecognitionManagerDelegate::OnRecognitionEnd( + int session_id) {} + +void ElectronSpeechRecognitionManagerDelegate::OnRecognitionResults( + int session_id, + const std::vector& results) {} + +void ElectronSpeechRecognitionManagerDelegate::OnRecognitionError( + int session_id, + const blink::mojom::SpeechRecognitionError& error) {} + +void ElectronSpeechRecognitionManagerDelegate::OnAudioLevelsChange( + int session_id, + float volume, + float noise_volume) {} + +void ElectronSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( + int session_id, + base::OnceCallback callback) { + std::move(callback).Run(true, true); +} + +content::SpeechRecognitionEventListener* +ElectronSpeechRecognitionManagerDelegate::GetEventListener() { + return this; +} + +bool ElectronSpeechRecognitionManagerDelegate::FilterProfanities( + int render_process_id) { + return false; +} + +} // namespace electron diff --git a/shell/browser/atom_speech_recognition_manager_delegate.h b/shell/browser/electron_speech_recognition_manager_delegate.h similarity index 79% rename from shell/browser/atom_speech_recognition_manager_delegate.h rename to shell/browser/electron_speech_recognition_manager_delegate.h index 6b22b3ae215..a78ba22dae6 100644 --- a/shell/browser/atom_speech_recognition_manager_delegate.h +++ b/shell/browser/electron_speech_recognition_manager_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ -#define SHELL_BROWSER_ATOM_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ +#ifndef SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ +#define SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ #include #include @@ -14,12 +14,12 @@ namespace electron { -class AtomSpeechRecognitionManagerDelegate +class ElectronSpeechRecognitionManagerDelegate : public content::SpeechRecognitionManagerDelegate, public content::SpeechRecognitionEventListener { public: - AtomSpeechRecognitionManagerDelegate(); - ~AtomSpeechRecognitionManagerDelegate() override; + ElectronSpeechRecognitionManagerDelegate(); + ~ElectronSpeechRecognitionManagerDelegate() override; // content::SpeechRecognitionEventListener: void OnRecognitionStart(int session_id) override; @@ -48,9 +48,9 @@ class AtomSpeechRecognitionManagerDelegate bool FilterProfanities(int render_process_id) override; private: - DISALLOW_COPY_AND_ASSIGN(AtomSpeechRecognitionManagerDelegate); + DISALLOW_COPY_AND_ASSIGN(ElectronSpeechRecognitionManagerDelegate); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ +#endif // SHELL_BROWSER_ELECTRON_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ diff --git a/shell/browser/atom_web_ui_controller_factory.cc b/shell/browser/electron_web_ui_controller_factory.cc similarity index 61% rename from shell/browser/atom_web_ui_controller_factory.cc rename to shell/browser/electron_web_ui_controller_factory.cc index c1527d9d759..07955829b54 100644 --- a/shell/browser/atom_web_ui_controller_factory.cc +++ b/shell/browser/electron_web_ui_controller_factory.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/atom_web_ui_controller_factory.h" +#include "shell/browser/electron_web_ui_controller_factory.h" #include @@ -19,39 +19,40 @@ const char kChromeUIDevToolsBundledHost[] = "devtools"; } // namespace // static -AtomWebUIControllerFactory* AtomWebUIControllerFactory::GetInstance() { - return base::Singleton::get(); +ElectronWebUIControllerFactory* ElectronWebUIControllerFactory::GetInstance() { + return base::Singleton::get(); } -AtomWebUIControllerFactory::AtomWebUIControllerFactory() = default; +ElectronWebUIControllerFactory::ElectronWebUIControllerFactory() = default; -AtomWebUIControllerFactory::~AtomWebUIControllerFactory() = default; +ElectronWebUIControllerFactory::~ElectronWebUIControllerFactory() = default; -content::WebUI::TypeID AtomWebUIControllerFactory::GetWebUIType( +content::WebUI::TypeID ElectronWebUIControllerFactory::GetWebUIType( content::BrowserContext* browser_context, const GURL& url) { if (url.host() == kChromeUIDevToolsBundledHost) { - return const_cast(this); + return const_cast(this); } return content::WebUI::kNoWebUI; } -bool AtomWebUIControllerFactory::UseWebUIForURL( +bool ElectronWebUIControllerFactory::UseWebUIForURL( content::BrowserContext* browser_context, const GURL& url) { return GetWebUIType(browser_context, url) != content::WebUI::kNoWebUI; } -bool AtomWebUIControllerFactory::UseWebUIBindingsForURL( +bool ElectronWebUIControllerFactory::UseWebUIBindingsForURL( content::BrowserContext* browser_context, const GURL& url) { return UseWebUIForURL(browser_context, url); } std::unique_ptr -AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui, - const GURL& url) { +ElectronWebUIControllerFactory::CreateWebUIControllerForURL( + content::WebUI* web_ui, + const GURL& url) { if (url.host() == kChromeUIDevToolsBundledHost) { auto* browser_context = web_ui->GetWebContents()->GetBrowserContext(); return std::make_unique(browser_context, web_ui); diff --git a/shell/browser/atom_web_ui_controller_factory.h b/shell/browser/electron_web_ui_controller_factory.h similarity index 64% rename from shell/browser/atom_web_ui_controller_factory.h rename to shell/browser/electron_web_ui_controller_factory.h index 6a238595d38..287ec5280cf 100644 --- a/shell/browser/atom_web_ui_controller_factory.h +++ b/shell/browser/electron_web_ui_controller_factory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_ -#define SHELL_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_ +#ifndef SHELL_BROWSER_ELECTRON_WEB_UI_CONTROLLER_FACTORY_H_ +#define SHELL_BROWSER_ELECTRON_WEB_UI_CONTROLLER_FACTORY_H_ #include @@ -14,12 +14,12 @@ namespace electron { -class AtomWebUIControllerFactory : public content::WebUIControllerFactory { +class ElectronWebUIControllerFactory : public content::WebUIControllerFactory { public: - static AtomWebUIControllerFactory* GetInstance(); + static ElectronWebUIControllerFactory* GetInstance(); - AtomWebUIControllerFactory(); - ~AtomWebUIControllerFactory() override; + ElectronWebUIControllerFactory(); + ~ElectronWebUIControllerFactory() override; // content::WebUIControllerFactory: content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context, @@ -33,11 +33,11 @@ class AtomWebUIControllerFactory : public content::WebUIControllerFactory { const GURL& url) override; private: - friend struct base::DefaultSingletonTraits; + friend struct base::DefaultSingletonTraits; - DISALLOW_COPY_AND_ASSIGN(AtomWebUIControllerFactory); + DISALLOW_COPY_AND_ASSIGN(ElectronWebUIControllerFactory); }; } // namespace electron -#endif // SHELL_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_ +#endif // SHELL_BROWSER_ELECTRON_WEB_UI_CONTROLLER_FACTORY_H_ diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index b35422f2b7a..cff0bd6d121 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -11,7 +11,7 @@ #include "extensions/common/error_utils.h" #include "extensions/common/manifest_constants.h" #include "extensions/common/permissions/permissions_data.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" namespace extensions { diff --git a/shell/browser/extensions/electron_extensions_browser_client.cc b/shell/browser/extensions/electron_extensions_browser_client.cc index 8bc975cb3ae..6fb991cd5ad 100644 --- a/shell/browser/extensions/electron_extensions_browser_client.cc +++ b/shell/browser/extensions/electron_extensions_browser_client.cc @@ -27,9 +27,9 @@ #include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_url_handlers.h" #include "services/network/public/mojom/url_loader.mojom.h" -#include "shell/browser/atom_browser_client.h" -#include "shell/browser/atom_browser_context.h" #include "shell/browser/browser.h" +#include "shell/browser/electron_browser_client.h" +#include "shell/browser/electron_browser_context.h" #include "shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h" #include "shell/browser/extensions/electron_extension_host_delegate.h" #include "shell/browser/extensions/electron_extension_system_factory.h" @@ -71,7 +71,7 @@ bool ElectronExtensionsBrowserClient::AreExtensionsDisabled( } bool ElectronExtensionsBrowserClient::IsValidContext(BrowserContext* context) { - auto context_map = AtomBrowserContext::browser_context_map(); + auto context_map = ElectronBrowserContext::browser_context_map(); for (auto const& entry : context_map) { if (entry.second && entry.second.get() == context) return true; @@ -99,7 +99,7 @@ BrowserContext* ElectronExtensionsBrowserClient::GetOriginalContext( BrowserContext* context) { DCHECK(context); if (context->IsOffTheRecord()) { - return AtomBrowserContext::From("", false).get(); + return ElectronBrowserContext::From("", false).get(); } else { return context; } @@ -194,7 +194,7 @@ bool ElectronExtensionsBrowserClient::AllowCrossRendererResourceLoad( PrefService* ElectronExtensionsBrowserClient::GetPrefServiceForContext( BrowserContext* context) { - return static_cast(context)->prefs(); + return static_cast(context)->prefs(); } void ElectronExtensionsBrowserClient::GetEarlyExtensionPrefsObservers( @@ -275,7 +275,7 @@ void ElectronExtensionsBrowserClient::BroadcastEventToRenderers( std::unique_ptr event( new extensions::Event(histogram_value, event_name, std::move(args))); - auto context_map = AtomBrowserContext::browser_context_map(); + auto context_map = ElectronBrowserContext::browser_context_map(); for (auto const& entry : context_map) { if (entry.second) { extensions::EventRouter::Get(entry.second.get()) @@ -320,11 +320,11 @@ bool ElectronExtensionsBrowserClient::IsLockScreenContext( } std::string ElectronExtensionsBrowserClient::GetApplicationLocale() { - return AtomBrowserClient::Get()->GetApplicationLocale(); + return ElectronBrowserClient::Get()->GetApplicationLocale(); } std::string ElectronExtensionsBrowserClient::GetUserAgent() const { - return AtomBrowserClient::Get()->GetUserAgent(); + return ElectronBrowserClient::Get()->GetUserAgent(); } void ElectronExtensionsBrowserClient::RegisterBrowserInterfaceBindersForFrame( diff --git a/shell/browser/extensions/electron_messaging_delegate.cc b/shell/browser/extensions/electron_messaging_delegate.cc index ff0d864deed..b1eb0fc4dde 100644 --- a/shell/browser/extensions/electron_messaging_delegate.cc +++ b/shell/browser/extensions/electron_messaging_delegate.cc @@ -23,7 +23,7 @@ #include "ui/gfx/native_widget_types.h" #include "url/gurl.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" namespace extensions { diff --git a/shell/browser/lib/bluetooth_chooser.h b/shell/browser/lib/bluetooth_chooser.h index d6f0f7c82f4..d74684ff3ba 100644 --- a/shell/browser/lib/bluetooth_chooser.h +++ b/shell/browser/lib/bluetooth_chooser.h @@ -10,7 +10,7 @@ #include #include "content/public/browser/bluetooth_chooser.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" namespace electron { diff --git a/shell/browser/login_handler.cc b/shell/browser/login_handler.cc index 0efbeb40ad9..1b6c3c529de 100644 --- a/shell/browser/login_handler.cc +++ b/shell/browser/login_handler.cc @@ -14,7 +14,7 @@ #include "base/threading/sequenced_task_runner_handle.h" #include "gin/arguments.h" #include "gin/dictionary.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/net_converter.h" diff --git a/shell/browser/mac/atom_application_delegate.h b/shell/browser/mac/atom_application_delegate.h deleted file mode 100644 index 1805f256b18..00000000000 --- a/shell/browser/mac/atom_application_delegate.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2013 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#import - -#import "shell/browser/ui/cocoa/atom_menu_controller.h" - -@interface AtomApplicationDelegate : NSObject { - @private - base::scoped_nsobject menu_controller_; -} - -// Sets the menu that will be returned in "applicationDockMenu:". -- (void)setApplicationDockMenu:(electron::AtomMenuModel*)model; - -@end diff --git a/shell/browser/mac/atom_application.h b/shell/browser/mac/electron_application.h similarity index 81% rename from shell/browser/mac/atom_application.h rename to shell/browser/mac/electron_application.h index a9d1817b4e6..f09e5d4d4db 100644 --- a/shell/browser/mac/atom_application.h +++ b/shell/browser/mac/electron_application.h @@ -9,9 +9,9 @@ #import #import -@interface AtomApplication : NSApplication { +@interface ElectronApplication : NSApplication { @private BOOL handlingSendEvent_; base::scoped_nsobject currentActivity_; @@ -20,7 +20,7 @@ base::Callback shouldShutdown_; } -+ (AtomApplication*)sharedApplication; ++ (ElectronApplication*)sharedApplication; - (void)setShutdownHandler:(base::Callback)handler; - (void)registerURLHandler; diff --git a/shell/browser/mac/atom_application.mm b/shell/browser/mac/electron_application.mm similarity index 95% rename from shell/browser/mac/atom_application.mm rename to shell/browser/mac/electron_application.mm index 6ea40a9b107..50b7c96aadd 100644 --- a/shell/browser/mac/atom_application.mm +++ b/shell/browser/mac/electron_application.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#import "shell/browser/mac/atom_application.h" +#import "shell/browser/mac/electron_application.h" #include #include @@ -15,8 +15,8 @@ #include "content/public/browser/native_event_processor_mac.h" #include "content/public/browser/native_event_processor_observer_mac.h" #include "shell/browser/browser.h" -#import "shell/browser/mac/atom_application_delegate.h" #include "shell/browser/mac/dict_util.h" +#import "shell/browser/mac/electron_application_delegate.h" namespace { @@ -29,16 +29,16 @@ inline void dispatch_sync_main(dispatch_block_t block) { } // namespace -@interface AtomApplication () { +@interface ElectronApplication () { base::ObserverList::Unchecked observers_; } @end -@implementation AtomApplication +@implementation ElectronApplication -+ (AtomApplication*)sharedApplication { - return (AtomApplication*)[super sharedApplication]; ++ (ElectronApplication*)sharedApplication { + return (ElectronApplication*)[super sharedApplication]; } - (void)terminate:(id)sender { diff --git a/shell/browser/mac/electron_application_delegate.h b/shell/browser/mac/electron_application_delegate.h new file mode 100644 index 00000000000..43063ae2d87 --- /dev/null +++ b/shell/browser/mac/electron_application_delegate.h @@ -0,0 +1,17 @@ +// Copyright (c) 2013 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#import + +#import "shell/browser/ui/cocoa/electron_menu_controller.h" + +@interface ElectronApplicationDelegate : NSObject { + @private + base::scoped_nsobject menu_controller_; +} + +// Sets the menu that will be returned in "applicationDockMenu:". +- (void)setApplicationDockMenu:(electron::ElectronMenuModel*)model; + +@end diff --git a/shell/browser/mac/atom_application_delegate.mm b/shell/browser/mac/electron_application_delegate.mm similarity index 92% rename from shell/browser/mac/atom_application_delegate.mm rename to shell/browser/mac/electron_application_delegate.mm index 924776b768e..57de325d7bb 100644 --- a/shell/browser/mac/atom_application_delegate.mm +++ b/shell/browser/mac/electron_application_delegate.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#import "shell/browser/mac/atom_application_delegate.h" +#import "shell/browser/mac/electron_application_delegate.h" #include #include @@ -14,8 +14,8 @@ #include "base/strings/sys_string_conversions.h" #include "base/values.h" #include "shell/browser/browser.h" -#import "shell/browser/mac/atom_application.h" #include "shell/browser/mac/dict_util.h" +#import "shell/browser/mac/electron_application.h" #if BUILDFLAG(USE_ALLOCATOR_SHIM) // On macOS 10.12, the IME system attempts to allocate a 2^64 size buffer, @@ -41,11 +41,11 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; @end #endif // BUILDFLAG(USE_ALLOCATOR_SHIM) -@implementation AtomApplicationDelegate +@implementation ElectronApplicationDelegate -- (void)setApplicationDockMenu:(electron::AtomMenuModel*)model { - menu_controller_.reset([[AtomMenuController alloc] initWithModel:model - useDefaultAccelerator:NO]); +- (void)setApplicationDockMenu:(electron::ElectronMenuModel*)model { + menu_controller_.reset([[ElectronMenuController alloc] initWithModel:model + useDefaultAccelerator:NO]); } - (void)applicationWillFinishLaunching:(NSNotification*)notify { diff --git a/shell/browser/native_browser_view.cc b/shell/browser/native_browser_view.cc index b80dbdd4f3f..ff948e4839d 100644 --- a/shell/browser/native_browser_view.cc +++ b/shell/browser/native_browser_view.cc @@ -6,7 +6,7 @@ #include "shell/browser/native_browser_view.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/ui/inspectable_web_contents.h" namespace electron { diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index 8a370898bf7..251269458cd 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -322,7 +322,7 @@ bool NativeWindow::IsDocumentEdited() { void NativeWindow::SetFocusable(bool focusable) {} -void NativeWindow::SetMenu(AtomMenuModel* menu) {} +void NativeWindow::SetMenu(ElectronMenuModel* menu) {} void NativeWindow::SetParentWindow(NativeWindow* parent) { parent_ = parent; diff --git a/shell/browser/native_window.h b/shell/browser/native_window.h index ea8ab223d5f..7626bdc7019 100644 --- a/shell/browser/native_window.h +++ b/shell/browser/native_window.h @@ -44,7 +44,7 @@ class PersistentDictionary; namespace electron { -class AtomMenuModel; +class ElectronMenuModel; class NativeBrowserView; #if defined(OS_MACOSX) @@ -161,7 +161,7 @@ class NativeWindow : public base::SupportsUserData, virtual void SetIgnoreMouseEvents(bool ignore, bool forward) = 0; virtual void SetContentProtection(bool enable) = 0; virtual void SetFocusable(bool focusable); - virtual void SetMenu(AtomMenuModel* menu); + virtual void SetMenu(ElectronMenuModel* menu); virtual void SetParentWindow(NativeWindow* parent); virtual void AddBrowserView(NativeBrowserView* browser_view) = 0; virtual void RemoveBrowserView(NativeBrowserView* browser_view) = 0; diff --git a/shell/browser/native_window_mac.h b/shell/browser/native_window_mac.h index 0a7caa13e50..9e812568069 100644 --- a/shell/browser/native_window_mac.h +++ b/shell/browser/native_window_mac.h @@ -16,10 +16,10 @@ #include "shell/browser/native_window.h" #include "ui/views/controls/native/native_view_host.h" -@class AtomNSWindow; -@class AtomNSWindowDelegate; -@class AtomPreviewItem; -@class AtomTouchBar; +@class ElectronNSWindow; +@class ElectronNSWindowDelegate; +@class ElectronPreviewItem; +@class ElectronTouchBar; @class CustomWindowButtonView; namespace electron { @@ -161,8 +161,8 @@ class NativeWindowMac : public NativeWindow { }; TitleBarStyle title_bar_style() const { return title_bar_style_; } - AtomPreviewItem* preview_item() const { return preview_item_.get(); } - AtomTouchBar* touch_bar() const { return touch_bar_.get(); } + ElectronPreviewItem* preview_item() const { return preview_item_.get(); } + ElectronTouchBar* touch_bar() const { return touch_bar_.get(); } bool zoom_to_page_width() const { return zoom_to_page_width_; } bool fullscreen_window_title() const { return fullscreen_window_title_; } bool always_simple_fullscreen() const { return always_simple_fullscreen_; } @@ -180,11 +180,11 @@ class NativeWindowMac : public NativeWindow { void InternalSetParentWindow(NativeWindow* parent, bool attach); void SetForwardMouseMessages(bool forward); - AtomNSWindow* window_; // Weak ref, managed by widget_. + ElectronNSWindow* window_; // Weak ref, managed by widget_. - base::scoped_nsobject window_delegate_; - base::scoped_nsobject preview_item_; - base::scoped_nsobject touch_bar_; + base::scoped_nsobject window_delegate_; + base::scoped_nsobject preview_item_; + base::scoped_nsobject touch_bar_; base::scoped_nsobject buttons_view_; // Event monitor for scroll wheel event. diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 54763b7f1a3..3afab2b8bb4 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -20,11 +20,11 @@ #include "content/public/browser/browser_accessibility_state.h" #include "content/public/browser/desktop_media_id.h" #include "shell/browser/native_browser_view_mac.h" -#include "shell/browser/ui/cocoa/atom_native_widget_mac.h" -#include "shell/browser/ui/cocoa/atom_ns_window.h" -#include "shell/browser/ui/cocoa/atom_ns_window_delegate.h" -#include "shell/browser/ui/cocoa/atom_preview_item.h" -#include "shell/browser/ui/cocoa/atom_touch_bar.h" +#include "shell/browser/ui/cocoa/electron_native_widget_mac.h" +#include "shell/browser/ui/cocoa/electron_ns_window.h" +#include "shell/browser/ui/cocoa/electron_ns_window_delegate.h" +#include "shell/browser/ui/cocoa/electron_preview_item.h" +#include "shell/browser/ui/cocoa/electron_touch_bar.h" #include "shell/browser/ui/cocoa/root_view_mac.h" #include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/ui/inspectable_web_contents_view.h" @@ -209,10 +209,10 @@ @end -@interface AtomProgressBar : NSProgressIndicator +@interface ElectronProgressBar : NSProgressIndicator @end -@implementation AtomProgressBar +@implementation ElectronProgressBar - (void)drawRect:(NSRect)dirtyRect { if (self.style != NSProgressIndicatorBarStyle) @@ -281,7 +281,7 @@ bool IsFramelessWindow(NSView* view) { NSWindow* nswindow = [view window]; if (![nswindow respondsToSelector:@selector(shell)]) return false; - NativeWindow* window = [static_cast(nswindow) shell]; + NativeWindow* window = [static_cast(nswindow) shell]; return window && !window->has_frame(); } @@ -389,14 +389,14 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, params.bounds = bounds; params.delegate = this; params.type = views::Widget::InitParams::TYPE_WINDOW; - params.native_widget = new AtomNativeWidgetMac(this, styleMask, widget()); + params.native_widget = new ElectronNativeWidgetMac(this, styleMask, widget()); widget()->Init(std::move(params)); - window_ = static_cast( + window_ = static_cast( widget()->GetNativeWindow().GetNativeNSWindow()); [window_ setEnableLargerThanScreen:enable_larger_than_screen()]; - window_delegate_.reset([[AtomNSWindowDelegate alloc] initWithShell:this]); + window_delegate_.reset([[ElectronNSWindowDelegate alloc] initWithShell:this]); [window_ setDelegate:window_delegate_]; // Only use native parent window for non-modal windows. @@ -870,7 +870,7 @@ void NativeWindowMac::SetAspectRatio(double aspect_ratio, void NativeWindowMac::PreviewFile(const std::string& path, const std::string& display_name) { - preview_item_.reset([[AtomPreviewItem alloc] + preview_item_.reset([[ElectronPreviewItem alloc] initWithURL:[NSURL fileURLWithPath:base::SysUTF8ToNSString(path)] title:base::SysUTF8ToNSString(display_name)]); [[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil]; @@ -1299,7 +1299,7 @@ void NativeWindowMac::SetProgressBar(double progress, NSRect frame = NSMakeRect(0.0f, 0.0f, dock_tile.size.width, 15.0); NSProgressIndicator* progress_indicator = - [[[AtomProgressBar alloc] initWithFrame:frame] autorelease]; + [[[ElectronProgressBar alloc] initWithFrame:frame] autorelease]; [progress_indicator setStyle:NSProgressIndicatorBarStyle]; [progress_indicator setIndeterminate:NO]; [progress_indicator setBezeled:YES]; @@ -1542,7 +1542,7 @@ void NativeWindowMac::SetVibrancy(const std::string& type) { void NativeWindowMac::SetTouchBar( std::vector items) { if (@available(macOS 10.12.2, *)) { - touch_bar_.reset([[AtomTouchBar alloc] + touch_bar_.reset([[ElectronTouchBar alloc] initWithDelegate:window_delegate_.get() window:this settings:std::move(items)]); diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index c31e7bb528b..97b2123b100 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -18,7 +18,7 @@ #include "base/strings/utf_string_conversions.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/desktop_media_id.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/native_browser_view_views.h" #include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/ui/inspectable_web_contents_view.h" @@ -26,7 +26,7 @@ #include "shell/browser/web_contents_preferences.h" #include "shell/browser/web_view_manager.h" #include "shell/browser/window_list.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #include "shell/common/gin_converters/image_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/options_switches.h" @@ -59,7 +59,7 @@ #include "ui/views/window/native_frame_view.h" #elif defined(OS_WIN) #include "shell/browser/ui/views/win_frame_view.h" -#include "shell/browser/ui/win/atom_desktop_native_widget_aura.h" +#include "shell/browser/ui/win/electron_desktop_native_widget_aura.h" #include "skia/ext/skia_utils_win.h" #include "ui/base/win/shell.h" #include "ui/display/screen.h" @@ -189,7 +189,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, if (parent) params.parent = parent->GetNativeWindow(); - params.native_widget = new AtomDesktopNativeWidgetAura(this); + params.native_widget = new ElectronDesktopNativeWidgetAura(this); #elif defined(USE_X11) std::string name = Browser::Get()->GetName(); // Set WM_WINDOW_ROLE. @@ -1005,7 +1005,7 @@ void NativeWindowViews::SetFocusable(bool focusable) { #endif } -void NativeWindowViews::SetMenu(AtomMenuModel* menu_model) { +void NativeWindowViews::SetMenu(ElectronMenuModel* menu_model) { #if defined(USE_X11) // Remove global menu bar. if (global_menu_bar_ && menu_model == nullptr) { diff --git a/shell/browser/native_window_views.h b/shell/browser/native_window_views.h index 5b6c9005a17..d4eab6dfaee 100644 --- a/shell/browser/native_window_views.h +++ b/shell/browser/native_window_views.h @@ -109,7 +109,7 @@ class NativeWindowViews : public NativeWindow, void SetIgnoreMouseEvents(bool ignore, bool forward) override; void SetContentProtection(bool enable) override; void SetFocusable(bool focusable) override; - void SetMenu(AtomMenuModel* menu_model) override; + void SetMenu(ElectronMenuModel* menu_model) override; void AddBrowserView(NativeBrowserView* browser_view) override; void RemoveBrowserView(NativeBrowserView* browser_view) override; void SetParentWindow(NativeWindow* parent) override; diff --git a/shell/browser/native_window_views_win.cc b/shell/browser/native_window_views_win.cc index ba670d3eeed..5003fbc3c70 100644 --- a/shell/browser/native_window_views_win.cc +++ b/shell/browser/native_window_views_win.cc @@ -9,7 +9,7 @@ #include "shell/browser/browser.h" #include "shell/browser/native_window_views.h" #include "shell/browser/ui/views/root_view.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #include "ui/base/win/accessibility_misc_utils.h" #include "ui/display/display.h" #include "ui/display/win/screen_win.h" diff --git a/shell/browser/net/atom_url_loader_factory.cc b/shell/browser/net/electron_url_loader_factory.cc similarity index 94% rename from shell/browser/net/atom_url_loader_factory.cc rename to shell/browser/net/electron_url_loader_factory.cc index 60b0cf1de3e..21e303db097 100644 --- a/shell/browser/net/atom_url_loader_factory.cc +++ b/shell/browser/net/electron_url_loader_factory.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/net/atom_url_loader_factory.h" +#include "shell/browser/net/electron_url_loader_factory.h" #include #include @@ -18,12 +18,12 @@ #include "net/http/http_status_code.h" #include "services/network/public/cpp/url_loader_completion_status.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" -#include "shell/browser/api/atom_api_session.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/api/electron_api_session.h" +#include "shell/browser/electron_browser_context.h" #include "shell/browser/net/asar/asar_url_loader.h" #include "shell/browser/net/node_stream_loader.h" #include "shell/browser/net/url_pipe_loader.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/net_converter.h" @@ -161,13 +161,14 @@ void OnWrite(std::unique_ptr write_data, MojoResult result) { } // namespace -AtomURLLoaderFactory::AtomURLLoaderFactory(ProtocolType type, - const ProtocolHandler& handler) +ElectronURLLoaderFactory::ElectronURLLoaderFactory( + ProtocolType type, + const ProtocolHandler& handler) : type_(type), handler_(handler) {} -AtomURLLoaderFactory::~AtomURLLoaderFactory() = default; +ElectronURLLoaderFactory::~ElectronURLLoaderFactory() = default; -void AtomURLLoaderFactory::CreateLoaderAndStart( +void ElectronURLLoaderFactory::CreateLoaderAndStart( mojo::PendingReceiver loader, int32_t routing_id, int32_t request_id, @@ -178,18 +179,18 @@ void AtomURLLoaderFactory::CreateLoaderAndStart( DCHECK_CURRENTLY_ON(content::BrowserThread::UI); handler_.Run( request, - base::BindOnce(&AtomURLLoaderFactory::StartLoading, std::move(loader), + base::BindOnce(&ElectronURLLoaderFactory::StartLoading, std::move(loader), routing_id, request_id, options, request, std::move(client), traffic_annotation, nullptr, type_)); } -void AtomURLLoaderFactory::Clone( +void ElectronURLLoaderFactory::Clone( mojo::PendingReceiver receiver) { receivers_.Add(this, std::move(receiver)); } // static -void AtomURLLoaderFactory::StartLoading( +void ElectronURLLoaderFactory::StartLoading( mojo::PendingReceiver loader, int32_t routing_id, int32_t request_id, @@ -308,7 +309,7 @@ void AtomURLLoaderFactory::StartLoading( } // static -void AtomURLLoaderFactory::StartLoadingBuffer( +void ElectronURLLoaderFactory::StartLoadingBuffer( mojo::PendingRemote client, network::mojom::URLResponseHeadPtr head, const gin_helper::Dictionary& dict) { @@ -328,7 +329,7 @@ void AtomURLLoaderFactory::StartLoadingBuffer( } // static -void AtomURLLoaderFactory::StartLoadingString( +void ElectronURLLoaderFactory::StartLoadingString( mojo::PendingRemote client, network::mojom::URLResponseHeadPtr head, const gin_helper::Dictionary& dict, @@ -351,7 +352,7 @@ void AtomURLLoaderFactory::StartLoadingString( } // static -void AtomURLLoaderFactory::StartLoadingFile( +void ElectronURLLoaderFactory::StartLoadingFile( mojo::PendingReceiver loader, network::ResourceRequest request, mojo::PendingRemote client, @@ -381,7 +382,7 @@ void AtomURLLoaderFactory::StartLoadingFile( } // static -void AtomURLLoaderFactory::StartLoadingHttp( +void ElectronURLLoaderFactory::StartLoadingHttp( mojo::PendingReceiver loader, const network::ResourceRequest& original_request, mojo::PendingRemote client, @@ -400,12 +401,13 @@ void AtomURLLoaderFactory::StartLoadingHttp( if (request->method != "GET" && request->method != "HEAD") dict.Get("uploadData", &upload_data); - scoped_refptr browser_context = - AtomBrowserContext::From("", false); + scoped_refptr browser_context = + ElectronBrowserContext::From("", false); v8::Local value; if (dict.Get("session", &value)) { if (value->IsNull()) { - browser_context = AtomBrowserContext::From(base::GenerateGUID(), true); + browser_context = + ElectronBrowserContext::From(base::GenerateGUID(), true); } else { gin::Handle session; if (gin::ConvertFromV8(dict.isolate(), value, &session) && @@ -423,7 +425,7 @@ void AtomURLLoaderFactory::StartLoadingHttp( } // static -void AtomURLLoaderFactory::StartLoadingStream( +void ElectronURLLoaderFactory::StartLoadingStream( mojo::PendingReceiver loader, mojo::PendingRemote client, network::mojom::URLResponseHeadPtr head, @@ -476,7 +478,7 @@ void AtomURLLoaderFactory::StartLoadingStream( } // static -void AtomURLLoaderFactory::SendContents( +void ElectronURLLoaderFactory::SendContents( mojo::PendingRemote client, network::mojom::URLResponseHeadPtr head, std::string data) { diff --git a/shell/browser/net/atom_url_loader_factory.h b/shell/browser/net/electron_url_loader_factory.h similarity index 90% rename from shell/browser/net/atom_url_loader_factory.h rename to shell/browser/net/electron_url_loader_factory.h index fc4fead508d..27e43fd12ae 100644 --- a/shell/browser/net/atom_url_loader_factory.h +++ b/shell/browser/net/electron_url_loader_factory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_NET_ATOM_URL_LOADER_FACTORY_H_ -#define SHELL_BROWSER_NET_ATOM_URL_LOADER_FACTORY_H_ +#ifndef SHELL_BROWSER_NET_ELECTRON_URL_LOADER_FACTORY_H_ +#define SHELL_BROWSER_NET_ELECTRON_URL_LOADER_FACTORY_H_ #include #include @@ -39,10 +39,10 @@ using HandlersMap = std::map>; // Implementation of URLLoaderFactory. -class AtomURLLoaderFactory : public network::mojom::URLLoaderFactory { +class ElectronURLLoaderFactory : public network::mojom::URLLoaderFactory { public: - AtomURLLoaderFactory(ProtocolType type, const ProtocolHandler& handler); - ~AtomURLLoaderFactory() override; + ElectronURLLoaderFactory(ProtocolType type, const ProtocolHandler& handler); + ~ElectronURLLoaderFactory() override; // network::mojom::URLLoaderFactory: void CreateLoaderAndStart( @@ -114,9 +114,9 @@ class AtomURLLoaderFactory : public network::mojom::URLLoaderFactory { ProtocolType type_; ProtocolHandler handler_; - DISALLOW_COPY_AND_ASSIGN(AtomURLLoaderFactory); + DISALLOW_COPY_AND_ASSIGN(ElectronURLLoaderFactory); }; } // namespace electron -#endif // SHELL_BROWSER_NET_ATOM_URL_LOADER_FACTORY_H_ +#endif // SHELL_BROWSER_NET_ELECTRON_URL_LOADER_FACTORY_H_ diff --git a/shell/browser/net/network_context_service.cc b/shell/browser/net/network_context_service.cc index 54649646670..b822b2d9c85 100644 --- a/shell/browser/net/network_context_service.cc +++ b/shell/browser/net/network_context_service.cc @@ -7,14 +7,14 @@ #include "chrome/common/chrome_constants.h" #include "content/public/browser/network_service_instance.h" #include "services/network/network_service.h" -#include "shell/browser/atom_browser_client.h" #include "shell/browser/browser_process_impl.h" +#include "shell/browser/electron_browser_client.h" #include "shell/browser/net/system_network_context_manager.h" namespace electron { NetworkContextService::NetworkContextService(content::BrowserContext* context) - : browser_context_(static_cast(context)), + : browser_context_(static_cast(context)), proxy_config_monitor_(browser_context_->prefs()) {} NetworkContextService::~NetworkContextService() = default; @@ -42,7 +42,7 @@ NetworkContextService::CreateNetworkContextParams(bool in_memory, network_context_params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader( - AtomBrowserClient::Get()->GetApplicationLocale()); + ElectronBrowserClient::Get()->GetApplicationLocale()); // Enable the HTTP cache. network_context_params->http_cache_enabled = diff --git a/shell/browser/net/network_context_service.h b/shell/browser/net/network_context_service.h index cfe43439991..82eb5302972 100644 --- a/shell/browser/net/network_context_service.h +++ b/shell/browser/net/network_context_service.h @@ -10,7 +10,7 @@ #include "components/keyed_service/core/keyed_service.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/mojom/network_context.mojom.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" namespace electron { @@ -33,7 +33,7 @@ class NetworkContextService : public KeyedService { bool in_memory, const base::FilePath& path); - AtomBrowserContext* browser_context_; + ElectronBrowserContext* browser_context_; ProxyConfigMonitor proxy_config_monitor_; }; diff --git a/shell/browser/net/network_context_service_factory.cc b/shell/browser/net/network_context_service_factory.cc index 810f4afa7d7..26a66cf8375 100644 --- a/shell/browser/net/network_context_service_factory.cc +++ b/shell/browser/net/network_context_service_factory.cc @@ -28,7 +28,8 @@ NetworkContextServiceFactory::~NetworkContextServiceFactory() = default; KeyedService* NetworkContextServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { - return new NetworkContextService(static_cast(context)); + return new NetworkContextService( + static_cast(context)); } content::BrowserContext* NetworkContextServiceFactory::GetBrowserContextToUse( diff --git a/shell/browser/net/proxying_url_loader_factory.cc b/shell/browser/net/proxying_url_loader_factory.cc index 0bd7e932693..0dcfc47cebe 100644 --- a/shell/browser/net/proxying_url_loader_factory.cc +++ b/shell/browser/net/proxying_url_loader_factory.cc @@ -739,7 +739,7 @@ void ProxyingURLLoaderFactory::CreateLoaderAndStart( if (it != intercepted_handlers_.end()) { // > it->second.second.Run( - request, base::BindOnce(&AtomURLLoaderFactory::StartLoading, + request, base::BindOnce(&ElectronURLLoaderFactory::StartLoading, std::move(loader), routing_id, request_id, options, request, std::move(client), traffic_annotation, this, it->second.first)); diff --git a/shell/browser/net/proxying_url_loader_factory.h b/shell/browser/net/proxying_url_loader_factory.h index 65f367c1ac9..9c3d42b7faf 100644 --- a/shell/browser/net/proxying_url_loader_factory.h +++ b/shell/browser/net/proxying_url_loader_factory.h @@ -23,7 +23,7 @@ #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" -#include "shell/browser/net/atom_url_loader_factory.h" +#include "shell/browser/net/electron_url_loader_factory.h" namespace electron { diff --git a/shell/browser/net/resolve_proxy_helper.cc b/shell/browser/net/resolve_proxy_helper.cc index bbeca9fa1dd..e3da04bc6e3 100644 --- a/shell/browser/net/resolve_proxy_helper.cc +++ b/shell/browser/net/resolve_proxy_helper.cc @@ -12,13 +12,13 @@ #include "mojo/public/cpp/bindings/pending_remote.h" #include "net/proxy_resolution/proxy_info.h" #include "services/network/public/mojom/network_context.mojom.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" using content::BrowserThread; namespace electron { -ResolveProxyHelper::ResolveProxyHelper(AtomBrowserContext* browser_context) +ResolveProxyHelper::ResolveProxyHelper(ElectronBrowserContext* browser_context) : browser_context_(browser_context) {} ResolveProxyHelper::~ResolveProxyHelper() { diff --git a/shell/browser/net/resolve_proxy_helper.h b/shell/browser/net/resolve_proxy_helper.h index 46929b9c460..be330bf2f12 100644 --- a/shell/browser/net/resolve_proxy_helper.h +++ b/shell/browser/net/resolve_proxy_helper.h @@ -16,7 +16,7 @@ namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; class ResolveProxyHelper : public base::RefCountedThreadSafe, @@ -24,7 +24,7 @@ class ResolveProxyHelper public: using ResolveProxyCallback = base::OnceCallback; - explicit ResolveProxyHelper(AtomBrowserContext* browser_context); + explicit ResolveProxyHelper(ElectronBrowserContext* browser_context); void ResolveProxy(const GURL& url, ResolveProxyCallback callback); @@ -65,7 +65,7 @@ class ResolveProxyHelper mojo::Receiver receiver_{this}; // Weak Ref - AtomBrowserContext* browser_context_; + ElectronBrowserContext* browser_context_; DISALLOW_COPY_AND_ASSIGN(ResolveProxyHelper); }; diff --git a/shell/browser/net/system_network_context_manager.cc b/shell/browser/net/system_network_context_manager.cc index 820547b2e9f..92333a24ec1 100644 --- a/shell/browser/net/system_network_context_manager.cc +++ b/shell/browser/net/system_network_context_manager.cc @@ -21,7 +21,7 @@ #include "services/network/public/cpp/cross_thread_pending_shared_url_loader_factory.h" #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/shared_url_loader_factory.h" -#include "shell/browser/atom_browser_client.h" +#include "shell/browser/electron_browser_client.h" #include "shell/common/application_info.h" #include "shell/common/options_switches.h" #include "url/gurl.h" @@ -220,7 +220,7 @@ SystemNetworkContextManager::CreateNetworkContextParams() { network_context_params->context_name = std::string("system"); network_context_params->user_agent = - electron::AtomBrowserClient::Get()->GetUserAgent(); + electron::ElectronBrowserClient::Get()->GetUserAgent(); network_context_params->http_cache_enabled = false; diff --git a/shell/browser/network_hints_handler_impl.cc b/shell/browser/network_hints_handler_impl.cc index cc8322436f9..a7d8a63c823 100644 --- a/shell/browser/network_hints_handler_impl.cc +++ b/shell/browser/network_hints_handler_impl.cc @@ -11,8 +11,8 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" -#include "shell/browser/api/atom_api_session.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/api/electron_api_session.h" +#include "shell/browser/electron_browser_context.h" #include "shell/common/gin_converters/gurl_converter.h" #include "v8/include/v8.h" @@ -33,7 +33,7 @@ void NetworkHintsHandlerImpl::Preconnect(const GURL& url, render_frame_host_->GetProcess()->GetBrowserContext(); auto* session = electron::api::Session::FromWrappedClass( v8::Isolate::GetCurrent(), - static_cast(browser_context)); + static_cast(browser_context)); if (session) { session->Emit("preconnect", url, allow_credentials); } diff --git a/shell/browser/notifications/platform_notification_service.cc b/shell/browser/notifications/platform_notification_service.cc index 159c2dbff9a..f6f15bfdb54 100644 --- a/shell/browser/notifications/platform_notification_service.cc +++ b/shell/browser/notifications/platform_notification_service.cc @@ -7,7 +7,7 @@ #include "base/strings/utf_string_conversions.h" #include "content/public/browser/notification_event_dispatcher.h" #include "content/public/browser/render_process_host.h" -#include "shell/browser/atom_browser_client.h" +#include "shell/browser/electron_browser_client.h" #include "shell/browser/notifications/notification.h" #include "shell/browser/notifications/notification_delegate.h" #include "shell/browser/notifications/notification_presenter.h" @@ -72,7 +72,7 @@ class NotificationDelegateImpl final : public electron::NotificationDelegate { } // namespace PlatformNotificationService::PlatformNotificationService( - AtomBrowserClient* browser_client) + ElectronBrowserClient* browser_client) : browser_client_(browser_client) {} PlatformNotificationService::~PlatformNotificationService() = default; diff --git a/shell/browser/notifications/platform_notification_service.h b/shell/browser/notifications/platform_notification_service.h index c5946573335..53d93abd202 100644 --- a/shell/browser/notifications/platform_notification_service.h +++ b/shell/browser/notifications/platform_notification_service.h @@ -12,12 +12,12 @@ namespace electron { -class AtomBrowserClient; +class ElectronBrowserClient; class PlatformNotificationService : public content::PlatformNotificationService { public: - explicit PlatformNotificationService(AtomBrowserClient* browser_client); + explicit PlatformNotificationService(ElectronBrowserClient* browser_client); ~PlatformNotificationService() override; protected: @@ -45,7 +45,7 @@ class PlatformNotificationService base::Time ReadNextTriggerTimestamp() override; private: - AtomBrowserClient* browser_client_; + ElectronBrowserClient* browser_client_; DISALLOW_COPY_AND_ASSIGN(PlatformNotificationService); }; diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index 361f10326f2..dae83d6c2bd 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -121,10 +121,10 @@ ui::MouseWheelEvent UiMouseWheelEventFromWebMouseEvent( } // namespace -class AtomBeginFrameTimer : public viz::DelayBasedTimeSourceClient { +class ElectronBeginFrameTimer : public viz::DelayBasedTimeSourceClient { public: - AtomBeginFrameTimer(int frame_rate_threshold_us, - const base::Closure& callback) + ElectronBeginFrameTimer(int frame_rate_threshold_us, + const base::Closure& callback) : callback_(callback) { time_source_ = std::make_unique( base::CreateSingleThreadTaskRunner({content::BrowserThread::UI}).get()); @@ -150,12 +150,13 @@ class AtomBeginFrameTimer : public viz::DelayBasedTimeSourceClient { const base::Closure callback_; std::unique_ptr time_source_; - DISALLOW_COPY_AND_ASSIGN(AtomBeginFrameTimer); + DISALLOW_COPY_AND_ASSIGN(ElectronBeginFrameTimer); }; -class AtomDelegatedFrameHostClient : public content::DelegatedFrameHostClient { +class ElectronDelegatedFrameHostClient + : public content::DelegatedFrameHostClient { public: - explicit AtomDelegatedFrameHostClient(OffScreenRenderWidgetHostView* view) + explicit ElectronDelegatedFrameHostClient(OffScreenRenderWidgetHostView* view) : view_(view) {} ui::Layer* DelegatedFrameHostGetLayer() const override { @@ -194,7 +195,7 @@ class AtomDelegatedFrameHostClient : public content::DelegatedFrameHostClient { private: OffScreenRenderWidgetHostView* const view_; - DISALLOW_COPY_AND_ASSIGN(AtomDelegatedFrameHostClient); + DISALLOW_COPY_AND_ASSIGN(ElectronDelegatedFrameHostClient); }; OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView( @@ -231,7 +232,7 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView( compositor_allocator_.GetCurrentLocalSurfaceIdAllocation(); delegated_frame_host_client_ = - std::make_unique(this); + std::make_unique(this); delegated_frame_host_ = std::make_unique( AllocateFrameSinkId(is_guest_view_hack), delegated_frame_host_client_.get(), @@ -1055,7 +1056,7 @@ void OffScreenRenderWidgetHostView::SetupFrameRate(bool force) { if (begin_frame_timer_.get()) { begin_frame_timer_->SetFrameRateThresholdUs(frame_rate_threshold_us_); } else { - begin_frame_timer_ = std::make_unique( + begin_frame_timer_ = std::make_unique( frame_rate_threshold_us_, base::BindRepeating( &OffScreenRenderWidgetHostView::OnBeginFrameTimerTick, diff --git a/shell/browser/osr/osr_render_widget_host_view.h b/shell/browser/osr/osr_render_widget_host_view.h index 35225f3ac34..bda522622a2 100644 --- a/shell/browser/osr/osr_render_widget_host_view.h +++ b/shell/browser/osr/osr_render_widget_host_view.h @@ -50,10 +50,10 @@ class CursorManager; namespace electron { -class AtomCopyFrameGenerator; -class AtomBeginFrameTimer; +class ElectronCopyFrameGenerator; +class ElectronBeginFrameTimer; -class AtomDelegatedFrameHostClient; +class ElectronDelegatedFrameHostClient; typedef base::Callback OnPaintCallback; typedef base::Callback OnPopupPaintCallback; @@ -279,7 +279,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, std::unique_ptr cursor_manager_; - std::unique_ptr begin_frame_timer_; + std::unique_ptr begin_frame_timer_; OffScreenHostDisplayClient* host_display_client_; std::unique_ptr video_consumer_; @@ -287,7 +287,8 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, viz::StubBeginFrameSource begin_frame_source_; uint64_t begin_frame_number_ = viz::BeginFrameArgs::kStartingFrameNumber; - std::unique_ptr delegated_frame_host_client_; + std::unique_ptr + delegated_frame_host_client_; content::MouseWheelPhaseHandler mouse_wheel_phase_handler_; diff --git a/shell/browser/pref_store_delegate.cc b/shell/browser/pref_store_delegate.cc index 1273e5a7969..34141f0dca9 100644 --- a/shell/browser/pref_store_delegate.cc +++ b/shell/browser/pref_store_delegate.cc @@ -7,12 +7,12 @@ #include #include "components/prefs/value_map_pref_store.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" namespace electron { PrefStoreDelegate::PrefStoreDelegate( - base::WeakPtr browser_context) + base::WeakPtr browser_context) : browser_context_(std::move(browser_context)) {} PrefStoreDelegate::~PrefStoreDelegate() { diff --git a/shell/browser/pref_store_delegate.h b/shell/browser/pref_store_delegate.h index 9f31d0297c7..548696bcb77 100644 --- a/shell/browser/pref_store_delegate.h +++ b/shell/browser/pref_store_delegate.h @@ -14,13 +14,14 @@ namespace electron { -class AtomBrowserContext; +class ElectronBrowserContext; // Retrieves handle to the in memory pref store that gets // initialized with the pref service. class PrefStoreDelegate : public PrefValueStore::Delegate { public: - explicit PrefStoreDelegate(base::WeakPtr browser_context); + explicit PrefStoreDelegate( + base::WeakPtr browser_context); ~PrefStoreDelegate() override; void Init(PrefStore* managed_prefs, @@ -42,7 +43,7 @@ class PrefStoreDelegate : public PrefValueStore::Delegate { void UpdateCommandLinePrefStore(PrefStore* command_line_prefs) override; private: - base::WeakPtr browser_context_; + base::WeakPtr browser_context_; DISALLOW_COPY_AND_ASSIGN(PrefStoreDelegate); }; diff --git a/shell/browser/relauncher.cc b/shell/browser/relauncher.cc index adf2f520005..40ce93be5f8 100644 --- a/shell/browser/relauncher.cc +++ b/shell/browser/relauncher.cc @@ -15,7 +15,7 @@ #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" -#include "shell/common/atom_command_line.h" +#include "shell/common/electron_command_line.h" #if defined(OS_POSIX) #include "base/posix/eintr_wrapper.h" @@ -138,7 +138,7 @@ bool RelaunchAppWithHelper(const base::FilePath& helper, } int RelauncherMain(const content::MainFunctionParams& main_parameters) { - const StringVector& argv = electron::AtomCommandLine::argv(); + const StringVector& argv = electron::ElectronCommandLine::argv(); if (argv.size() < 4 || argv[1] != internal::kRelauncherTypeArg) { LOG(ERROR) << "relauncher process invoked with unexpected arguments"; diff --git a/shell/browser/resources/mac/Info.plist b/shell/browser/resources/mac/Info.plist index 5a1d71cbc86..bd94c784cbc 100644 --- a/shell/browser/resources/mac/Info.plist +++ b/shell/browser/resources/mac/Info.plist @@ -27,7 +27,7 @@ NSMainNibFile MainMenu NSPrincipalClass - AtomApplication + ElectronApplication NSSupportsAutomaticGraphicsSwitching NSHighResolutionCapable diff --git a/shell/browser/ui/accelerator_util.cc b/shell/browser/ui/accelerator_util.cc index d061a76a1f6..f1d83d6892e 100644 --- a/shell/browser/ui/accelerator_util.cc +++ b/shell/browser/ui/accelerator_util.cc @@ -68,11 +68,11 @@ bool StringToAccelerator(const std::string& shortcut, } void GenerateAcceleratorTable(AcceleratorTable* table, - electron::AtomMenuModel* model) { + electron::ElectronMenuModel* model) { int count = model->GetItemCount(); for (int i = 0; i < count; ++i) { - electron::AtomMenuModel::ItemType type = model->GetTypeAt(i); - if (type == electron::AtomMenuModel::TYPE_SUBMENU) { + electron::ElectronMenuModel::ItemType type = model->GetTypeAt(i); + if (type == electron::ElectronMenuModel::TYPE_SUBMENU) { auto* submodel = model->GetSubmenuModelAt(i); GenerateAcceleratorTable(table, submodel); } else { diff --git a/shell/browser/ui/accelerator_util.h b/shell/browser/ui/accelerator_util.h index e3e78bdcf48..e3b942dc189 100644 --- a/shell/browser/ui/accelerator_util.h +++ b/shell/browser/ui/accelerator_util.h @@ -8,14 +8,14 @@ #include #include -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "ui/base/accelerators/accelerator.h" namespace accelerator_util { typedef struct { int position; - electron::AtomMenuModel* model; + electron::ElectronMenuModel* model; } MenuItem; typedef std::map AcceleratorTable; @@ -25,7 +25,7 @@ bool StringToAccelerator(const std::string& description, // Generate a table that contains memu model's accelerators and command ids. void GenerateAcceleratorTable(AcceleratorTable* table, - electron::AtomMenuModel* model); + electron::ElectronMenuModel* model); // Trigger command from the accelerators table. bool TriggerAcceleratorTableCommand(AcceleratorTable* table, diff --git a/shell/browser/ui/cocoa/atom_native_widget_mac.h b/shell/browser/ui/cocoa/atom_native_widget_mac.h deleted file mode 100644 index 65ce66874d9..00000000000 --- a/shell/browser/ui/cocoa/atom_native_widget_mac.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2018 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#ifndef SHELL_BROWSER_UI_COCOA_ATOM_NATIVE_WIDGET_MAC_H_ -#define SHELL_BROWSER_UI_COCOA_ATOM_NATIVE_WIDGET_MAC_H_ - -#include "ui/views/widget/native_widget_mac.h" - -namespace electron { - -class NativeWindowMac; - -class AtomNativeWidgetMac : public views::NativeWidgetMac { - public: - AtomNativeWidgetMac(NativeWindowMac* shell, - NSUInteger style_mask, - views::internal::NativeWidgetDelegate* delegate); - ~AtomNativeWidgetMac() override; - - protected: - // NativeWidgetMac: - NativeWidgetMacNSWindow* CreateNSWindow( - const remote_cocoa::mojom::CreateWindowParams* params) override; - - private: - NativeWindowMac* shell_; - NSUInteger style_mask_; - - DISALLOW_COPY_AND_ASSIGN(AtomNativeWidgetMac); -}; - -} // namespace electron - -#endif // SHELL_BROWSER_UI_COCOA_ATOM_NATIVE_WIDGET_MAC_H_ diff --git a/shell/browser/ui/cocoa/atom_bundle_mover.h b/shell/browser/ui/cocoa/electron_bundle_mover.h similarity index 86% rename from shell/browser/ui/cocoa/atom_bundle_mover.h rename to shell/browser/ui/cocoa/electron_bundle_mover.h index 8e952a1f23f..a68fac162ee 100644 --- a/shell/browser/ui/cocoa/atom_bundle_mover.h +++ b/shell/browser/ui/cocoa/electron_bundle_mover.h @@ -2,8 +2,10 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_ -#define SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_ +#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_ +#define SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_ + +#include #include "base/mac/foundation_util.h" #include "shell/common/gin_helper/error_thrower.h" @@ -17,7 +19,7 @@ namespace electron { // Possible bundle movement conflicts enum class BundlerMoverConflictType { EXISTS, EXISTS_AND_RUNNING }; -class AtomBundleMover { +class ElectronBundleMover { public: static bool Move(gin_helper::ErrorThrower thrower, gin::Arguments* args); static bool IsCurrentAppInApplicationsFolder(); @@ -41,4 +43,4 @@ class AtomBundleMover { } // namespace electron -#endif // SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_ +#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_ diff --git a/shell/browser/ui/cocoa/atom_bundle_mover.mm b/shell/browser/ui/cocoa/electron_bundle_mover.mm similarity index 92% rename from shell/browser/ui/cocoa/atom_bundle_mover.mm rename to shell/browser/ui/cocoa/electron_bundle_mover.mm index 2f8cf770831..a881a51906e 100644 --- a/shell/browser/ui/cocoa/atom_bundle_mover.mm +++ b/shell/browser/ui/cocoa/electron_bundle_mover.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#import "shell/browser/ui/cocoa/atom_bundle_mover.h" +#import "shell/browser/ui/cocoa/electron_bundle_mover.h" #import #import @@ -38,9 +38,9 @@ struct Converter { namespace electron { -bool AtomBundleMover::ShouldContinueMove(gin_helper::ErrorThrower thrower, - BundlerMoverConflictType type, - gin::Arguments* args) { +bool ElectronBundleMover::ShouldContinueMove(gin_helper::ErrorThrower thrower, + BundlerMoverConflictType type, + gin::Arguments* args) { gin::Dictionary options(args->isolate()); bool hasOptions = args->GetNext(&options); base::OnceCallback(BundlerMoverConflictType)> @@ -61,8 +61,8 @@ bool AtomBundleMover::ShouldContinueMove(gin_helper::ErrorThrower thrower, return true; } -bool AtomBundleMover::Move(gin_helper::ErrorThrower thrower, - gin::Arguments* args) { +bool ElectronBundleMover::Move(gin_helper::ErrorThrower thrower, + gin::Arguments* args) { // Path of the current bundle NSString* bundlePath = [[NSBundle mainBundle] bundlePath]; @@ -178,11 +178,11 @@ bool AtomBundleMover::Move(gin_helper::ErrorThrower thrower, return true; } -bool AtomBundleMover::IsCurrentAppInApplicationsFolder() { +bool ElectronBundleMover::IsCurrentAppInApplicationsFolder() { return IsInApplicationsFolder([[NSBundle mainBundle] bundlePath]); } -bool AtomBundleMover::IsInApplicationsFolder(NSString* bundlePath) { +bool ElectronBundleMover::IsInApplicationsFolder(NSString* bundlePath) { // Check all the normal Application directories NSArray* applicationDirs = NSSearchPathForDirectoriesInDomains( NSApplicationDirectory, NSAllDomainsMask, true); @@ -199,7 +199,7 @@ bool AtomBundleMover::IsInApplicationsFolder(NSString* bundlePath) { return false; } -NSString* AtomBundleMover::ContainingDiskImageDevice(NSString* bundlePath) { +NSString* ElectronBundleMover::ContainingDiskImageDevice(NSString* bundlePath) { NSString* containingPath = [bundlePath stringByDeletingLastPathComponent]; struct statfs fs; @@ -258,9 +258,9 @@ NSString* AtomBundleMover::ContainingDiskImageDevice(NSString* bundlePath) { return nil; } -bool AtomBundleMover::AuthorizedInstall(NSString* srcPath, - NSString* dstPath, - bool* canceled) { +bool ElectronBundleMover::AuthorizedInstall(NSString* srcPath, + NSString* dstPath, + bool* canceled) { if (canceled) *canceled = false; @@ -361,21 +361,21 @@ fail: return false; } -bool AtomBundleMover::CopyBundle(NSString* srcPath, NSString* dstPath) { +bool ElectronBundleMover::CopyBundle(NSString* srcPath, NSString* dstPath) { NSFileManager* fileManager = [NSFileManager defaultManager]; NSError* error = nil; return [fileManager copyItemAtPath:srcPath toPath:dstPath error:&error]; } -NSString* AtomBundleMover::ShellQuotedString(NSString* string) { +NSString* ElectronBundleMover::ShellQuotedString(NSString* string) { return [NSString stringWithFormat:@"'%@'", [string stringByReplacingOccurrencesOfString:@"'" withString:@"'\\''"]]; } -void AtomBundleMover::Relaunch(NSString* destinationPath) { +void ElectronBundleMover::Relaunch(NSString* destinationPath) { // The shell script waits until the original app process terminates. // This is done so that the relaunched app opens as the front-most app. int pid = [[NSProcessInfo processInfo] processIdentifier]; @@ -402,7 +402,7 @@ void AtomBundleMover::Relaunch(NSString* destinationPath) { arguments:[NSArray arrayWithObjects:@"-c", script, nil]]; } -bool AtomBundleMover::IsApplicationAtPathRunning(NSString* bundlePath) { +bool ElectronBundleMover::IsApplicationAtPathRunning(NSString* bundlePath) { bundlePath = [bundlePath stringByStandardizingPath]; for (NSRunningApplication* runningApplication in @@ -416,7 +416,7 @@ bool AtomBundleMover::IsApplicationAtPathRunning(NSString* bundlePath) { return false; } -bool AtomBundleMover::Trash(NSString* path) { +bool ElectronBundleMover::Trash(NSString* path) { bool result = false; if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_8) { @@ -456,7 +456,7 @@ end tell return result; } -bool AtomBundleMover::DeleteOrTrash(NSString* path) { +bool ElectronBundleMover::DeleteOrTrash(NSString* path) { NSError* error; if ([[NSFileManager defaultManager] removeItemAtPath:path error:&error]) { diff --git a/shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h similarity index 94% rename from shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h rename to shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h index 4166099ff95..691c25f6393 100644 --- a/shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h +++ b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h @@ -17,7 +17,7 @@ class InspectableWebContentsViewMac; using electron::InspectableWebContentsViewMac; -@interface AtomInspectableWebContentsView : BaseView { +@interface ElectronInspectableWebContentsView : BaseView { @private electron::InspectableWebContentsViewMac* inspectableWebContentsView_; diff --git a/shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm similarity index 98% rename from shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm rename to shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm index 64d01a76de4..0b25862211b 100644 --- a/shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm +++ b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#include "shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h" +#include "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h" #include "content/public/browser/render_widget_host_view.h" #include "shell/browser/ui/cocoa/event_dispatching_window.h" @@ -11,7 +11,7 @@ #include "shell/browser/ui/inspectable_web_contents_view_mac.h" #include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h" -@implementation AtomInspectableWebContentsView +@implementation ElectronInspectableWebContentsView - (instancetype)initWithInspectableWebContentsViewMac: (InspectableWebContentsViewMac*)view { diff --git a/shell/browser/ui/cocoa/atom_menu_controller.h b/shell/browser/ui/cocoa/electron_menu_controller.h similarity index 77% rename from shell/browser/ui/cocoa/atom_menu_controller.h rename to shell/browser/ui/cocoa/electron_menu_controller.h index 7e3b9f18129..886fe7f8104 100644 --- a/shell/browser/ui/cocoa/atom_menu_controller.h +++ b/shell/browser/ui/cocoa/electron_menu_controller.h @@ -3,8 +3,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_COCOA_ATOM_MENU_CONTROLLER_H_ -#define SHELL_BROWSER_UI_COCOA_ATOM_MENU_CONTROLLER_H_ +#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_MENU_CONTROLLER_H_ +#define SHELL_BROWSER_UI_COCOA_ELECTRON_MENU_CONTROLLER_H_ #import @@ -13,7 +13,7 @@ #include "base/strings/string16.h" namespace electron { -class AtomMenuModel; +class ElectronMenuModel; } // A controller for the cross-platform menu model. The menu that's created @@ -22,26 +22,26 @@ class AtomMenuModel; // allow for hierarchical menus). The tag is the index into that model for // that particular item. It is important that the model outlives this object // as it only maintains weak references. -@interface AtomMenuController : NSObject { +@interface ElectronMenuController : NSObject { @protected - electron::AtomMenuModel* model_; // weak + electron::ElectronMenuModel* model_; // weak base::scoped_nsobject menu_; BOOL isMenuOpen_; BOOL useDefaultAccelerator_; base::OnceClosure closeCallback; } -@property(nonatomic, assign) electron::AtomMenuModel* model; +@property(nonatomic, assign) electron::ElectronMenuModel* model; // Builds a NSMenu from the pre-built model (must not be nil). Changes made // to the contents of the model after calling this will not be noticed. -- (id)initWithModel:(electron::AtomMenuModel*)model +- (id)initWithModel:(electron::ElectronMenuModel*)model useDefaultAccelerator:(BOOL)use; - (void)setCloseCallback:(base::OnceClosure)callback; // Populate current NSMenu with |model|. -- (void)populateWithModel:(electron::AtomMenuModel*)model; +- (void)populateWithModel:(electron::ElectronMenuModel*)model; // Programmatically close the constructed menu. - (void)cancel; @@ -60,4 +60,4 @@ class AtomMenuModel; @end -#endif // SHELL_BROWSER_UI_COCOA_ATOM_MENU_CONTROLLER_H_ +#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_MENU_CONTROLLER_H_ diff --git a/shell/browser/ui/cocoa/atom_menu_controller.mm b/shell/browser/ui/cocoa/electron_menu_controller.mm similarity index 90% rename from shell/browser/ui/cocoa/atom_menu_controller.mm rename to shell/browser/ui/cocoa/electron_menu_controller.mm index 663a1ed5e17..86b0470081a 100644 --- a/shell/browser/ui/cocoa/atom_menu_controller.mm +++ b/shell/browser/ui/cocoa/electron_menu_controller.mm @@ -3,7 +3,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#import "shell/browser/ui/cocoa/atom_menu_controller.h" +#import "shell/browser/ui/cocoa/electron_menu_controller.h" #include @@ -13,8 +13,8 @@ #include "base/task/post_task.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#include "shell/browser/mac/atom_application.h" -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/mac/electron_application.h" +#include "shell/browser/ui/electron_menu_model.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/accelerators/platform_accelerator_cocoa.h" #include "ui/base/l10n/l10n_util_mac.h" @@ -64,7 +64,7 @@ Role kRolesMap[] = { // Called when adding a submenu to the menu and checks if the submenu, via its // |model|, has visible child items. -bool MenuHasVisibleItems(const electron::AtomMenuModel* model) { +bool MenuHasVisibleItems(const electron::ElectronMenuModel* model) { int count = model->GetItemCount(); for (int index = 0; index < count; index++) { if (model->IsVisibleAt(index)) @@ -93,11 +93,11 @@ static base::scoped_nsobject recentDocumentsMenuItem_; // Submenu retained to be swapped back to |recentDocumentsMenuItem_| static base::scoped_nsobject recentDocumentsMenuSwap_; -@implementation AtomMenuController +@implementation ElectronMenuController @synthesize model = model_; -- (id)initWithModel:(electron::AtomMenuModel*)model +- (id)initWithModel:(electron::ElectronMenuModel*)model useDefaultAccelerator:(BOOL)use { if ((self = [super init])) { model_ = model; @@ -124,7 +124,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; closeCallback = std::move(callback); } -- (void)populateWithModel:(electron::AtomMenuModel*)model { +- (void)populateWithModel:(electron::ElectronMenuModel*)model { if (!menu_) return; @@ -142,7 +142,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; const int count = model->GetItemCount(); for (int index = 0; index < count; index++) { - if (model->GetTypeAt(index) == electron::AtomMenuModel::TYPE_SEPARATOR) + if (model->GetTypeAt(index) == electron::ElectronMenuModel::TYPE_SEPARATOR) [self addSeparatorToMenu:menu_ atIndex:index]; else [self addItemToMenu:menu_ atIndex:index fromModel:model]; @@ -162,12 +162,12 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; // Creates a NSMenu from the given model. If the model has submenus, this can // be invoked recursively. -- (NSMenu*)menuFromModel:(electron::AtomMenuModel*)model { +- (NSMenu*)menuFromModel:(electron::ElectronMenuModel*)model { NSMenu* menu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; const int count = model->GetItemCount(); for (int index = 0; index < count; index++) { - if (model->GetTypeAt(index) == electron::AtomMenuModel::TYPE_SEPARATOR) + if (model->GetTypeAt(index) == electron::ElectronMenuModel::TYPE_SEPARATOR) [self addSeparatorToMenu:menu atIndex:index]; else [self addItemToMenu:menu atIndex:index fromModel:model]; @@ -226,7 +226,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; // associated with the entry in the model identified by |modelIndex|. - (void)addItemToMenu:(NSMenu*)menu atIndex:(NSInteger)index - fromModel:(electron::AtomMenuModel*)model { + fromModel:(electron::ElectronMenuModel*)model { base::string16 label16 = model->GetLabelAt(index); NSString* label = l10n_util::FixUpWindowsStyleLabel(label16); @@ -244,7 +244,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; [item setToolTip:base::SysUTF16ToNSString(toolTip)]; base::string16 role = model->GetRoleAt(index); - electron::AtomMenuModel::ItemType type = model->GetTypeAt(index); + electron::ElectronMenuModel::ItemType type = model->GetTypeAt(index); if (role == base::ASCIIToUTF16("services")) { base::string16 title = base::ASCIIToUTF16("Services"); @@ -255,7 +255,7 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; NSMenu* submenu = [[NSMenu alloc] initWithTitle:label]; [item setSubmenu:submenu]; [NSApp setServicesMenu:submenu]; - } else if (type == electron::AtomMenuModel::TYPE_SUBMENU && + } else if (type == electron::ElectronMenuModel::TYPE_SUBMENU && model->IsVisibleAt(index)) { // We need to specifically check that the submenu top-level item has been // enabled as it's not validated by validateUserInterfaceItem @@ -265,8 +265,9 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; // Recursively build a submenu from the sub-model at this index. [item setTarget:nil]; [item setAction:nil]; - electron::AtomMenuModel* submenuModel = - static_cast(model->GetSubmenuModelAt(index)); + electron::ElectronMenuModel* submenuModel = + static_cast( + model->GetSubmenuModelAt(index)); NSMenu* submenu = MenuHasVisibleItems(submenuModel) ? [self menuFromModel:submenuModel] : MakeEmptySubmenu(); @@ -330,8 +331,9 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; return NO; NSInteger modelIndex = [item tag]; - electron::AtomMenuModel* model = static_cast( - [[(id)item representedObject] pointerValue]); + electron::ElectronMenuModel* model = + static_cast( + [[(id)item representedObject] pointerValue]); DCHECK(model); if (model) { BOOL checked = model->IsItemCheckedAt(modelIndex); @@ -349,8 +351,9 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; // item chosen. - (void)itemSelected:(id)sender { NSInteger modelIndex = [sender tag]; - electron::AtomMenuModel* model = static_cast( - [[sender representedObject] pointerValue]); + electron::ElectronMenuModel* model = + static_cast( + [[sender representedObject] pointerValue]); DCHECK(model); if (model) { NSEvent* event = [NSApp currentEvent]; diff --git a/shell/browser/ui/cocoa/electron_native_widget_mac.h b/shell/browser/ui/cocoa/electron_native_widget_mac.h new file mode 100644 index 00000000000..5a1f3ad99f0 --- /dev/null +++ b/shell/browser/ui/cocoa/electron_native_widget_mac.h @@ -0,0 +1,35 @@ +// Copyright (c) 2018 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_NATIVE_WIDGET_MAC_H_ +#define SHELL_BROWSER_UI_COCOA_ELECTRON_NATIVE_WIDGET_MAC_H_ + +#include "ui/views/widget/native_widget_mac.h" + +namespace electron { + +class NativeWindowMac; + +class ElectronNativeWidgetMac : public views::NativeWidgetMac { + public: + ElectronNativeWidgetMac(NativeWindowMac* shell, + NSUInteger style_mask, + views::internal::NativeWidgetDelegate* delegate); + ~ElectronNativeWidgetMac() override; + + protected: + // NativeWidgetMac: + NativeWidgetMacNSWindow* CreateNSWindow( + const remote_cocoa::mojom::CreateWindowParams* params) override; + + private: + NativeWindowMac* shell_; + NSUInteger style_mask_; + + DISALLOW_COPY_AND_ASSIGN(ElectronNativeWidgetMac); +}; + +} // namespace electron + +#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_NATIVE_WIDGET_MAC_H_ diff --git a/shell/browser/ui/cocoa/atom_native_widget_mac.mm b/shell/browser/ui/cocoa/electron_native_widget_mac.mm similarity index 51% rename from shell/browser/ui/cocoa/atom_native_widget_mac.mm rename to shell/browser/ui/cocoa/electron_native_widget_mac.mm index 3900f6cb85d..21b5afe1b30 100644 --- a/shell/browser/ui/cocoa/atom_native_widget_mac.mm +++ b/shell/browser/ui/cocoa/electron_native_widget_mac.mm @@ -2,13 +2,13 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/ui/cocoa/atom_native_widget_mac.h" +#include "shell/browser/ui/cocoa/electron_native_widget_mac.h" -#include "shell/browser/ui/cocoa/atom_ns_window.h" +#include "shell/browser/ui/cocoa/electron_ns_window.h" namespace electron { -AtomNativeWidgetMac::AtomNativeWidgetMac( +ElectronNativeWidgetMac::ElectronNativeWidgetMac( NativeWindowMac* shell, NSUInteger style_mask, views::internal::NativeWidgetDelegate* delegate) @@ -16,12 +16,12 @@ AtomNativeWidgetMac::AtomNativeWidgetMac( shell_(shell), style_mask_(style_mask) {} -AtomNativeWidgetMac::~AtomNativeWidgetMac() {} +ElectronNativeWidgetMac::~ElectronNativeWidgetMac() {} -NativeWidgetMacNSWindow* AtomNativeWidgetMac::CreateNSWindow( +NativeWidgetMacNSWindow* ElectronNativeWidgetMac::CreateNSWindow( const remote_cocoa::mojom::CreateWindowParams* params) { - return [[[AtomNSWindow alloc] initWithShell:shell_ - styleMask:style_mask_] autorelease]; + return [[[ElectronNSWindow alloc] initWithShell:shell_ + styleMask:style_mask_] autorelease]; } } // namespace electron diff --git a/shell/browser/ui/cocoa/atom_ns_window.h b/shell/browser/ui/cocoa/electron_ns_window.h similarity index 85% rename from shell/browser/ui/cocoa/atom_ns_window.h rename to shell/browser/ui/cocoa/electron_ns_window.h index 8d6a2488919..48e32def1ea 100644 --- a/shell/browser/ui/cocoa/atom_ns_window.h +++ b/shell/browser/ui/cocoa/electron_ns_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_H_ -#define SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_H_ +#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_ +#define SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_ #include "components/remote_cocoa/app_shim/native_widget_mac_nswindow.h" #include "shell/browser/ui/cocoa/event_dispatching_window.h" @@ -27,7 +27,7 @@ class ScopedDisableResize { } // namespace electron -@interface AtomNSWindow : NativeWidgetMacNSWindow { +@interface ElectronNSWindow : NativeWidgetMacNSWindow { @private electron::NativeWindowMac* shell_; } @@ -46,4 +46,4 @@ class ScopedDisableResize { - (NSImage*)_cornerMask; @end -#endif // SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_H_ +#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_ diff --git a/shell/browser/ui/cocoa/atom_ns_window.mm b/shell/browser/ui/cocoa/electron_ns_window.mm similarity index 96% rename from shell/browser/ui/cocoa/atom_ns_window.mm rename to shell/browser/ui/cocoa/electron_ns_window.mm index 283d23c4113..ae11246e48a 100644 --- a/shell/browser/ui/cocoa/atom_ns_window.mm +++ b/shell/browser/ui/cocoa/electron_ns_window.mm @@ -2,12 +2,12 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/ui/cocoa/atom_ns_window.h" +#include "shell/browser/ui/cocoa/electron_ns_window.h" #include "base/strings/sys_string_conversions.h" #include "shell/browser/native_window_mac.h" -#include "shell/browser/ui/cocoa/atom_preview_item.h" -#include "shell/browser/ui/cocoa/atom_touch_bar.h" +#include "shell/browser/ui/cocoa/electron_preview_item.h" +#include "shell/browser/ui/cocoa/electron_touch_bar.h" #include "shell/browser/ui/cocoa/root_view_mac.h" #include "ui/base/cocoa/window_size_constants.h" @@ -17,7 +17,7 @@ bool ScopedDisableResize::disable_resize_ = false; } // namespace electron -@implementation AtomNSWindow +@implementation ElectronNSWindow @synthesize acceptsFirstMouse; @synthesize enableLargerThanScreen; diff --git a/shell/browser/ui/cocoa/atom_ns_window_delegate.h b/shell/browser/ui/cocoa/electron_ns_window_delegate.h similarity index 70% rename from shell/browser/ui/cocoa/atom_ns_window_delegate.h rename to shell/browser/ui/cocoa/electron_ns_window_delegate.h index 80112054e40..c5db7fbb27f 100644 --- a/shell/browser/ui/cocoa/atom_ns_window_delegate.h +++ b/shell/browser/ui/cocoa/electron_ns_window_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_DELEGATE_H_ -#define SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_DELEGATE_H_ +#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_ +#define SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_ #include @@ -13,7 +13,7 @@ namespace electron { class NativeWindowMac; } -@interface AtomNSWindowDelegate +@interface ElectronNSWindowDelegate : ViewsNSWindowDelegate { @private electron::NativeWindowMac* shell_; @@ -24,4 +24,4 @@ class NativeWindowMac; - (id)initWithShell:(electron::NativeWindowMac*)shell; @end -#endif // SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_DELEGATE_H_ +#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_ diff --git a/shell/browser/ui/cocoa/atom_ns_window_delegate.mm b/shell/browser/ui/cocoa/electron_ns_window_delegate.mm similarity index 98% rename from shell/browser/ui/cocoa/atom_ns_window_delegate.mm rename to shell/browser/ui/cocoa/electron_ns_window_delegate.mm index f715f950685..d5d9fcc2ea5 100644 --- a/shell/browser/ui/cocoa/atom_ns_window_delegate.mm +++ b/shell/browser/ui/cocoa/electron_ns_window_delegate.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/ui/cocoa/atom_ns_window_delegate.h" +#include "shell/browser/ui/cocoa/electron_ns_window_delegate.h" #include @@ -10,15 +10,15 @@ #include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h" #include "shell/browser/browser.h" #include "shell/browser/native_window_mac.h" -#include "shell/browser/ui/cocoa/atom_preview_item.h" -#include "shell/browser/ui/cocoa/atom_touch_bar.h" +#include "shell/browser/ui/cocoa/electron_preview_item.h" +#include "shell/browser/ui/cocoa/electron_touch_bar.h" #include "ui/gfx/mac/coordinate_conversion.h" #include "ui/views/cocoa/native_widget_mac_ns_window_host.h" #include "ui/views/widget/native_widget_mac.h" using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle; -@implementation AtomNSWindowDelegate +@implementation ElectronNSWindowDelegate - (id)initWithShell:(electron::NativeWindowMac*)shell { // The views library assumes the window delegate must be an instance of diff --git a/shell/browser/ui/cocoa/atom_preview_item.h b/shell/browser/ui/cocoa/electron_preview_item.h similarity index 60% rename from shell/browser/ui/cocoa/atom_preview_item.h rename to shell/browser/ui/cocoa/electron_preview_item.h index c267570ce60..f8172af1834 100644 --- a/shell/browser/ui/cocoa/atom_preview_item.h +++ b/shell/browser/ui/cocoa/electron_preview_item.h @@ -2,16 +2,16 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_COCOA_ATOM_PREVIEW_ITEM_H_ -#define SHELL_BROWSER_UI_COCOA_ATOM_PREVIEW_ITEM_H_ +#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_PREVIEW_ITEM_H_ +#define SHELL_BROWSER_UI_COCOA_ELECTRON_PREVIEW_ITEM_H_ #import #import -@interface AtomPreviewItem : NSObject +@interface ElectronPreviewItem : NSObject @property(nonatomic, retain) NSURL* previewItemURL; @property(nonatomic, retain) NSString* previewItemTitle; - (id)initWithURL:(NSURL*)url title:(NSString*)title; @end -#endif // SHELL_BROWSER_UI_COCOA_ATOM_PREVIEW_ITEM_H_ +#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_PREVIEW_ITEM_H_ diff --git a/shell/browser/ui/cocoa/atom_preview_item.mm b/shell/browser/ui/cocoa/electron_preview_item.mm similarity index 80% rename from shell/browser/ui/cocoa/atom_preview_item.mm rename to shell/browser/ui/cocoa/electron_preview_item.mm index 42920f62506..f7f9e8b26b5 100644 --- a/shell/browser/ui/cocoa/atom_preview_item.mm +++ b/shell/browser/ui/cocoa/electron_preview_item.mm @@ -2,9 +2,9 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/ui/cocoa/atom_preview_item.h" +#include "shell/browser/ui/cocoa/electron_preview_item.h" -@implementation AtomPreviewItem +@implementation ElectronPreviewItem @synthesize previewItemURL; @synthesize previewItemTitle; diff --git a/shell/browser/ui/cocoa/atom_touch_bar.h b/shell/browser/ui/cocoa/electron_touch_bar.h similarity index 91% rename from shell/browser/ui/cocoa/atom_touch_bar.h rename to shell/browser/ui/cocoa/electron_touch_bar.h index 134c6df5bca..137878d3a6f 100644 --- a/shell/browser/ui/cocoa/atom_touch_bar.h +++ b/shell/browser/ui/cocoa/electron_touch_bar.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_COCOA_ATOM_TOUCH_BAR_H_ -#define SHELL_BROWSER_UI_COCOA_ATOM_TOUCH_BAR_H_ +#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_TOUCH_BAR_H_ +#define SHELL_BROWSER_UI_COCOA_ELECTRON_TOUCH_BAR_H_ #import @@ -15,9 +15,9 @@ #include "shell/browser/native_window.h" #include "shell/common/gin_helper/persistent_dictionary.h" -@interface AtomTouchBar : NSObject { +@interface ElectronTouchBar : NSObject { @protected std::vector ordered_settings_; std::map settings_; @@ -96,4 +96,4 @@ @end -#endif // SHELL_BROWSER_UI_COCOA_ATOM_TOUCH_BAR_H_ +#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_TOUCH_BAR_H_ diff --git a/shell/browser/ui/cocoa/atom_touch_bar.mm b/shell/browser/ui/cocoa/electron_touch_bar.mm similarity index 99% rename from shell/browser/ui/cocoa/atom_touch_bar.mm rename to shell/browser/ui/cocoa/electron_touch_bar.mm index 416886422a2..ff114986593 100644 --- a/shell/browser/ui/cocoa/atom_touch_bar.mm +++ b/shell/browser/ui/cocoa/electron_touch_bar.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#import "shell/browser/ui/cocoa/atom_touch_bar.h" +#import "shell/browser/ui/cocoa/electron_touch_bar.h" #include #include @@ -14,7 +14,7 @@ #include "skia/ext/skia_utils_mac.h" #include "ui/gfx/image/image.h" -@implementation AtomTouchBar +@implementation ElectronTouchBar static NSTouchBarItemIdentifier ButtonIdentifier = @"com.electron.touchbar.button."; diff --git a/shell/browser/ui/devtools_manager_delegate.cc b/shell/browser/ui/devtools_manager_delegate.cc index e06f531c6f9..ccd57c8c125 100644 --- a/shell/browser/ui/devtools_manager_delegate.cc +++ b/shell/browser/ui/devtools_manager_delegate.cc @@ -27,7 +27,7 @@ #include "net/base/net_errors.h" #include "net/socket/stream_socket.h" #include "net/socket/tcp_server_socket.h" -#include "shell/browser/atom_paths.h" +#include "shell/browser/electron_paths.h" #include "ui/base/resource/resource_bundle.h" namespace electron { diff --git a/shell/browser/ui/atom_menu_model.cc b/shell/browser/ui/electron_menu_model.cc similarity index 66% rename from shell/browser/ui/atom_menu_model.cc rename to shell/browser/ui/electron_menu_model.cc index f7f1cc6ddb9..3f20ae24ac6 100644 --- a/shell/browser/ui/atom_menu_model.cc +++ b/shell/browser/ui/electron_menu_model.cc @@ -2,57 +2,57 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "base/stl_util.h" namespace electron { -bool AtomMenuModel::Delegate::GetAcceleratorForCommandId( +bool ElectronMenuModel::Delegate::GetAcceleratorForCommandId( int command_id, ui::Accelerator* accelerator) const { return GetAcceleratorForCommandIdWithParams(command_id, false, accelerator); } -AtomMenuModel::AtomMenuModel(Delegate* delegate) +ElectronMenuModel::ElectronMenuModel(Delegate* delegate) : ui::SimpleMenuModel(delegate), delegate_(delegate) {} -AtomMenuModel::~AtomMenuModel() = default; +ElectronMenuModel::~ElectronMenuModel() = default; -void AtomMenuModel::SetToolTip(int index, const base::string16& toolTip) { +void ElectronMenuModel::SetToolTip(int index, const base::string16& toolTip) { int command_id = GetCommandIdAt(index); toolTips_[command_id] = toolTip; } -base::string16 AtomMenuModel::GetToolTipAt(int index) { +base::string16 ElectronMenuModel::GetToolTipAt(int index) { const int command_id = GetCommandIdAt(index); const auto iter = toolTips_.find(command_id); return iter == std::end(toolTips_) ? base::string16() : iter->second; } -void AtomMenuModel::SetRole(int index, const base::string16& role) { +void ElectronMenuModel::SetRole(int index, const base::string16& role) { int command_id = GetCommandIdAt(index); roles_[command_id] = role; } -base::string16 AtomMenuModel::GetRoleAt(int index) { +base::string16 ElectronMenuModel::GetRoleAt(int index) { const int command_id = GetCommandIdAt(index); const auto iter = roles_.find(command_id); return iter == std::end(roles_) ? base::string16() : iter->second; } -void AtomMenuModel::SetSublabel(int index, const base::string16& sublabel) { +void ElectronMenuModel::SetSublabel(int index, const base::string16& sublabel) { int command_id = GetCommandIdAt(index); sublabels_[command_id] = sublabel; } -base::string16 AtomMenuModel::GetSublabelAt(int index) const { +base::string16 ElectronMenuModel::GetSublabelAt(int index) const { int command_id = GetCommandIdAt(index); const auto iter = sublabels_.find(command_id); return iter == std::end(sublabels_) ? base::string16() : iter->second; } -bool AtomMenuModel::GetAcceleratorAtWithParams( +bool ElectronMenuModel::GetAcceleratorAtWithParams( int index, bool use_default_accelerator, ui::Accelerator* accelerator) const { @@ -63,7 +63,7 @@ bool AtomMenuModel::GetAcceleratorAtWithParams( return false; } -bool AtomMenuModel::ShouldRegisterAcceleratorAt(int index) const { +bool ElectronMenuModel::ShouldRegisterAcceleratorAt(int index) const { if (delegate_) { return delegate_->ShouldRegisterAcceleratorForCommandId( GetCommandIdAt(index)); @@ -71,29 +71,29 @@ bool AtomMenuModel::ShouldRegisterAcceleratorAt(int index) const { return true; } -bool AtomMenuModel::WorksWhenHiddenAt(int index) const { +bool ElectronMenuModel::WorksWhenHiddenAt(int index) const { if (delegate_) { return delegate_->ShouldCommandIdWorkWhenHidden(GetCommandIdAt(index)); } return true; } -void AtomMenuModel::MenuWillClose() { +void ElectronMenuModel::MenuWillClose() { ui::SimpleMenuModel::MenuWillClose(); for (Observer& observer : observers_) { observer.OnMenuWillClose(); } } -void AtomMenuModel::MenuWillShow() { +void ElectronMenuModel::MenuWillShow() { ui::SimpleMenuModel::MenuWillShow(); for (Observer& observer : observers_) { observer.OnMenuWillShow(); } } -AtomMenuModel* AtomMenuModel::GetSubmenuModelAt(int index) { - return static_cast( +ElectronMenuModel* ElectronMenuModel::GetSubmenuModelAt(int index) { + return static_cast( ui::SimpleMenuModel::GetSubmenuModelAt(index)); } diff --git a/shell/browser/ui/atom_menu_model.h b/shell/browser/ui/electron_menu_model.h similarity index 86% rename from shell/browser/ui/atom_menu_model.h rename to shell/browser/ui/electron_menu_model.h index 1de791bb9dc..40c314579fd 100644 --- a/shell/browser/ui/atom_menu_model.h +++ b/shell/browser/ui/electron_menu_model.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_ATOM_MENU_MODEL_H_ -#define SHELL_BROWSER_UI_ATOM_MENU_MODEL_H_ +#ifndef SHELL_BROWSER_UI_ELECTRON_MENU_MODEL_H_ +#define SHELL_BROWSER_UI_ELECTRON_MENU_MODEL_H_ #include @@ -13,7 +13,7 @@ namespace electron { -class AtomMenuModel : public ui::SimpleMenuModel { +class ElectronMenuModel : public ui::SimpleMenuModel { public: class Delegate : public ui::SimpleMenuModel::Delegate { public: @@ -47,8 +47,8 @@ class AtomMenuModel : public ui::SimpleMenuModel { virtual void OnMenuWillClose() {} }; - explicit AtomMenuModel(Delegate* delegate); - ~AtomMenuModel() override; + explicit ElectronMenuModel(Delegate* delegate); + ~ElectronMenuModel() override; void AddObserver(Observer* obs) { observers_.AddObserver(obs); } void RemoveObserver(Observer* obs) { observers_.RemoveObserver(obs); } @@ -70,7 +70,7 @@ class AtomMenuModel : public ui::SimpleMenuModel { void MenuWillShow() override; using SimpleMenuModel::GetSubmenuModelAt; - AtomMenuModel* GetSubmenuModelAt(int index); + ElectronMenuModel* GetSubmenuModelAt(int index); private: Delegate* delegate_; // weak ref. @@ -80,9 +80,9 @@ class AtomMenuModel : public ui::SimpleMenuModel { std::map sublabels_; // command id -> sublabel base::ObserverList observers_; - DISALLOW_COPY_AND_ASSIGN(AtomMenuModel); + DISALLOW_COPY_AND_ASSIGN(ElectronMenuModel); }; } // namespace electron -#endif // SHELL_BROWSER_UI_ATOM_MENU_MODEL_H_ +#endif // SHELL_BROWSER_UI_ELECTRON_MENU_MODEL_H_ diff --git a/shell/browser/ui/file_dialog_mac.mm b/shell/browser/ui/file_dialog_mac.mm index 664bb220439..08bef054cd9 100644 --- a/shell/browser/ui/file_dialog_mac.mm +++ b/shell/browser/ui/file_dialog_mac.mm @@ -62,10 +62,10 @@ @end // Manages the PopUpButtonHandler. -@interface AtomAccessoryView : NSView +@interface ElectronAccessoryView : NSView @end -@implementation AtomAccessoryView +@implementation ElectronAccessoryView - (void)dealloc { auto* popupButton = @@ -114,8 +114,8 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) { return; // don't add file format picker // Add file format picker. - AtomAccessoryView* accessoryView = - [[AtomAccessoryView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 200, 32.0)]; + ElectronAccessoryView* accessoryView = [[ElectronAccessoryView alloc] + initWithFrame:NSMakeRect(0.0, 0.0, 200, 32.0)]; NSTextField* label = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 60, 22)]; diff --git a/shell/browser/ui/inspectable_web_contents_impl.cc b/shell/browser/ui/inspectable_web_contents_impl.cc index 74d304c9158..89dc68fb068 100644 --- a/shell/browser/ui/inspectable_web_contents_impl.cc +++ b/shell/browser/ui/inspectable_web_contents_impl.cc @@ -56,7 +56,7 @@ #include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_url_handlers.h" #include "extensions/common/permissions/permissions_data.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" #endif namespace electron { diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.h b/shell/browser/ui/inspectable_web_contents_view_mac.h index a788c0dadfa..cd83588be20 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.h +++ b/shell/browser/ui/inspectable_web_contents_view_mac.h @@ -10,7 +10,7 @@ #include "base/mac/scoped_nsobject.h" -@class AtomInspectableWebContentsView; +@class ElectronInspectableWebContentsView; namespace electron { @@ -40,7 +40,7 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView { // Owns us. InspectableWebContentsImpl* inspectable_web_contents_; - base::scoped_nsobject view_; + base::scoped_nsobject view_; DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewMac); }; diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.mm b/shell/browser/ui/inspectable_web_contents_view_mac.mm index 4a241a7917d..7d8da3bf51d 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.mm +++ b/shell/browser/ui/inspectable_web_contents_view_mac.mm @@ -8,7 +8,7 @@ #import #include "base/strings/sys_string_conversions.h" -#import "shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h" +#import "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h" #include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/ui/inspectable_web_contents_view_delegate.h" @@ -22,7 +22,7 @@ InspectableWebContentsView* CreateInspectableContentsView( InspectableWebContentsViewMac::InspectableWebContentsViewMac( InspectableWebContentsImpl* inspectable_web_contents) : inspectable_web_contents_(inspectable_web_contents), - view_([[AtomInspectableWebContentsView alloc] + view_([[ElectronInspectableWebContentsView alloc] initWithInspectableWebContentsViewMac:this]) {} InspectableWebContentsViewMac::~InspectableWebContentsViewMac() { diff --git a/shell/browser/ui/tray_icon.cc b/shell/browser/ui/tray_icon.cc index aac7b3cc794..4415f6c9b7b 100644 --- a/shell/browser/ui/tray_icon.cc +++ b/shell/browser/ui/tray_icon.cc @@ -21,7 +21,7 @@ void TrayIcon::RemoveBalloon() {} void TrayIcon::Focus() {} void TrayIcon::PopUpContextMenu(const gfx::Point& pos, - AtomMenuModel* menu_model) {} + ElectronMenuModel* menu_model) {} void TrayIcon::CloseContextMenu() {} diff --git a/shell/browser/ui/tray_icon.h b/shell/browser/ui/tray_icon.h index c5673325c46..3fceee52e17 100644 --- a/shell/browser/ui/tray_icon.h +++ b/shell/browser/ui/tray_icon.h @@ -9,7 +9,7 @@ #include #include "base/observer_list.h" -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "shell/browser/ui/tray_icon_observer.h" #include "shell/common/gin_converters/guid_converter.h" #include "ui/gfx/geometry/rect.h" @@ -80,12 +80,12 @@ class TrayIcon { // Popups the menu. virtual void PopUpContextMenu(const gfx::Point& pos, - AtomMenuModel* menu_model); + ElectronMenuModel* menu_model); virtual void CloseContextMenu(); // Set the context menu for this icon. - virtual void SetContextMenu(AtomMenuModel* menu_model) = 0; + virtual void SetContextMenu(ElectronMenuModel* menu_model) = 0; // Returns the bounds of tray icon. virtual gfx::Rect GetBounds(); diff --git a/shell/browser/ui/tray_icon_cocoa.h b/shell/browser/ui/tray_icon_cocoa.h index 93cb97e1e19..03989390e6a 100644 --- a/shell/browser/ui/tray_icon_cocoa.h +++ b/shell/browser/ui/tray_icon_cocoa.h @@ -12,7 +12,7 @@ #include "base/mac/scoped_nsobject.h" #include "shell/browser/ui/tray_icon.h" -@class AtomMenuController; +@class ElectronMenuController; @class StatusItemView; namespace electron { @@ -29,11 +29,11 @@ class TrayIconCocoa : public TrayIcon { std::string GetTitle() override; void SetIgnoreDoubleClickEvents(bool ignore) override; bool GetIgnoreDoubleClickEvents() override; - void PopUpOnUI(AtomMenuModel* menu_model); + void PopUpOnUI(ElectronMenuModel* menu_model); void PopUpContextMenu(const gfx::Point& pos, - AtomMenuModel* menu_model) override; + ElectronMenuModel* menu_model) override; void CloseContextMenu() override; - void SetContextMenu(AtomMenuModel* menu_model) override; + void SetContextMenu(ElectronMenuModel* menu_model) override; gfx::Rect GetBounds() override; private: @@ -41,7 +41,7 @@ class TrayIconCocoa : public TrayIcon { base::scoped_nsobject status_item_view_; // Status menu shown when right-clicking the system icon. - base::scoped_nsobject menu_; + base::scoped_nsobject menu_; base::WeakPtrFactory weak_factory_; diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index c76a6b8a50d..56107ce538b 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -14,14 +14,14 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "shell/browser/ui/cocoa/NSString+ANSI.h" -#include "shell/browser/ui/cocoa/atom_menu_controller.h" +#include "shell/browser/ui/cocoa/electron_menu_controller.h" #include "ui/events/cocoa/cocoa_event_utils.h" #include "ui/gfx/mac/coordinate_conversion.h" #include "ui/native_theme/native_theme.h" @interface StatusItemView : NSView { - electron::TrayIconCocoa* trayIcon_; // weak - AtomMenuController* menuController_; // weak + electron::TrayIconCocoa* trayIcon_; // weak + ElectronMenuController* menuController_; // weak BOOL ignoreDoubleClickEvents_; base::scoped_nsobject statusItem_; base::scoped_nsobject trackingArea_; @@ -125,7 +125,7 @@ return [statusItem_ button].title; } -- (void)setMenuController:(AtomMenuController*)menu { +- (void)setMenuController:(ElectronMenuController*)menu { menuController_ = menu; [statusItem_ setMenu:[menuController_ menu]]; } @@ -170,15 +170,15 @@ ui::EventFlagsFromModifiers([event modifierFlags])); } -- (void)popUpContextMenu:(electron::AtomMenuModel*)menu_model { +- (void)popUpContextMenu:(electron::ElectronMenuModel*)menu_model { // Make sure events can be pumped while the menu is up. base::MessageLoopCurrent::ScopedNestableTaskAllower allow; // Show a custom menu. if (menu_model) { - base::scoped_nsobject menuController( - [[AtomMenuController alloc] initWithModel:menu_model - useDefaultAccelerator:NO]); + base::scoped_nsobject menuController( + [[ElectronMenuController alloc] initWithModel:menu_model + useDefaultAccelerator:NO]); // Hacky way to mimic design of ordinary tray menu. [statusItem_ setMenu:[menuController menu]]; [[statusItem_ button] performClick:self]; @@ -309,12 +309,12 @@ bool TrayIconCocoa::GetIgnoreDoubleClickEvents() { return [status_item_view_ getIgnoreDoubleClickEvents]; } -void TrayIconCocoa::PopUpOnUI(AtomMenuModel* menu_model) { +void TrayIconCocoa::PopUpOnUI(ElectronMenuModel* menu_model) { [status_item_view_ popUpContextMenu:menu_model]; } void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos, - AtomMenuModel* menu_model) { + ElectronMenuModel* menu_model) { base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&TrayIconCocoa::PopUpOnUI, weak_factory_.GetWeakPtr(), @@ -325,11 +325,11 @@ void TrayIconCocoa::CloseContextMenu() { [status_item_view_ closeContextMenu]; } -void TrayIconCocoa::SetContextMenu(AtomMenuModel* menu_model) { +void TrayIconCocoa::SetContextMenu(ElectronMenuModel* menu_model) { if (menu_model) { // Create native menu. - menu_.reset([[AtomMenuController alloc] initWithModel:menu_model - useDefaultAccelerator:NO]); + menu_.reset([[ElectronMenuController alloc] initWithModel:menu_model + useDefaultAccelerator:NO]); } else { menu_.reset(); } diff --git a/shell/browser/ui/tray_icon_gtk.cc b/shell/browser/ui/tray_icon_gtk.cc index 7a63f0c7ef0..046c54f9fdd 100644 --- a/shell/browser/ui/tray_icon_gtk.cc +++ b/shell/browser/ui/tray_icon_gtk.cc @@ -63,7 +63,7 @@ void TrayIconGtk::SetToolTip(const std::string& tool_tip) { icon_->SetToolTip(tool_tip_); } -void TrayIconGtk::SetContextMenu(AtomMenuModel* menu_model) { +void TrayIconGtk::SetContextMenu(ElectronMenuModel* menu_model) { menu_model_ = menu_model; icon_->UpdatePlatformContextMenu(menu_model_); } diff --git a/shell/browser/ui/tray_icon_gtk.h b/shell/browser/ui/tray_icon_gtk.h index a474b99196d..bf10df377af 100644 --- a/shell/browser/ui/tray_icon_gtk.h +++ b/shell/browser/ui/tray_icon_gtk.h @@ -26,7 +26,7 @@ class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate { // TrayIcon: void SetImage(const gfx::Image& image) override; void SetToolTip(const std::string& tool_tip) override; - void SetContextMenu(AtomMenuModel* menu_model) override; + void SetContextMenu(ElectronMenuModel* menu_model) override; // views::StatusIconLinux::Delegate void OnClick() override; diff --git a/shell/browser/ui/views/atom_views_delegate.cc b/shell/browser/ui/views/electron_views_delegate.cc similarity index 98% rename from shell/browser/ui/views/atom_views_delegate.cc rename to shell/browser/ui/views/electron_views_delegate.cc index e8aabb927dc..e21023f1b3c 100644 --- a/shell/browser/ui/views/atom_views_delegate.cc +++ b/shell/browser/ui/views/electron_views_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#include "shell/browser/ui/views/atom_views_delegate.h" +#include "shell/browser/ui/views/electron_views_delegate.h" #include diff --git a/shell/browser/ui/views/atom_views_delegate.h b/shell/browser/ui/views/electron_views_delegate.h similarity index 94% rename from shell/browser/ui/views/atom_views_delegate.h rename to shell/browser/ui/views/electron_views_delegate.h index e8a9778ee0f..8ed463e38a1 100644 --- a/shell/browser/ui/views/atom_views_delegate.h +++ b/shell/browser/ui/views/electron_views_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#ifndef SHELL_BROWSER_UI_VIEWS_ATOM_VIEWS_DELEGATE_H_ -#define SHELL_BROWSER_UI_VIEWS_ATOM_VIEWS_DELEGATE_H_ +#ifndef SHELL_BROWSER_UI_VIEWS_ELECTRON_VIEWS_DELEGATE_H_ +#define SHELL_BROWSER_UI_VIEWS_ELECTRON_VIEWS_DELEGATE_H_ #include #include @@ -76,4 +76,4 @@ class ViewsDelegate : public views::ViewsDelegate { } // namespace electron -#endif // SHELL_BROWSER_UI_VIEWS_ATOM_VIEWS_DELEGATE_H_ +#endif // SHELL_BROWSER_UI_VIEWS_ELECTRON_VIEWS_DELEGATE_H_ diff --git a/shell/browser/ui/views/atom_views_delegate_win.cc b/shell/browser/ui/views/electron_views_delegate_win.cc similarity index 99% rename from shell/browser/ui/views/atom_views_delegate_win.cc rename to shell/browser/ui/views/electron_views_delegate_win.cc index 6c4384a9cd4..ff2c6f0274d 100644 --- a/shell/browser/ui/views/atom_views_delegate_win.cc +++ b/shell/browser/ui/views/electron_views_delegate_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#include "shell/browser/ui/views/atom_views_delegate.h" +#include "shell/browser/ui/views/electron_views_delegate.h" #include #include diff --git a/shell/browser/ui/views/global_menu_bar_x11.cc b/shell/browser/ui/views/global_menu_bar_x11.cc index f5996efa1cc..44a260281af 100644 --- a/shell/browser/ui/views/global_menu_bar_x11.cc +++ b/shell/browser/ui/views/global_menu_bar_x11.cc @@ -12,7 +12,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h" #include "shell/browser/native_window_views.h" -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/accelerators/menu_label_accelerator_util_linux.h" @@ -134,8 +134,8 @@ void EnsureMethodsLoaded() { dlsym(dbusmenu_lib, "dbusmenu_server_set_root")); } -AtomMenuModel* ModelForMenuItem(DbusmenuMenuitem* item) { - return reinterpret_cast( +ElectronMenuModel* ModelForMenuItem(DbusmenuMenuitem* item) { + return reinterpret_cast( g_object_get_data(G_OBJECT(item), "model")); } @@ -156,7 +156,7 @@ void SetMenuItemID(DbusmenuMenuitem* item, int id) { g_object_set_data(G_OBJECT(item), "menu-id", GINT_TO_POINTER(id + 1)); } -std::string GetMenuModelStatus(AtomMenuModel* model) { +std::string GetMenuModelStatus(ElectronMenuModel* model) { std::string ret; for (int i = 0; i < model->GetItemCount(); ++i) { int status = model->GetTypeAt(i) | (model->IsVisibleAt(i) << 3) | @@ -192,7 +192,7 @@ std::string GlobalMenuBarX11::GetPathForWindow(gfx::AcceleratedWidget xid) { return base::StringPrintf("/com/canonical/menu/%lX", xid); } -void GlobalMenuBarX11::SetMenu(AtomMenuModel* menu_model) { +void GlobalMenuBarX11::SetMenu(ElectronMenuModel* menu_model) { if (!IsServerStarted()) return; @@ -224,14 +224,14 @@ void GlobalMenuBarX11::OnWindowUnmapped() { GlobalMenuBarRegistrarX11::GetInstance()->OnWindowUnmapped(xid_); } -void GlobalMenuBarX11::BuildMenuFromModel(AtomMenuModel* model, +void GlobalMenuBarX11::BuildMenuFromModel(ElectronMenuModel* model, DbusmenuMenuitem* parent) { for (int i = 0; i < model->GetItemCount(); ++i) { DbusmenuMenuitem* item = menuitem_new(); menuitem_property_set_bool(item, kPropertyVisible, model->IsVisibleAt(i)); - AtomMenuModel::ItemType type = model->GetTypeAt(i); - if (type == AtomMenuModel::TYPE_SEPARATOR) { + ElectronMenuModel::ItemType type = model->GetTypeAt(i); + if (type == ElectronMenuModel::TYPE_SEPARATOR) { menuitem_property_set(item, kPropertyType, kTypeSeparator); } else { std::string label = ui::ConvertAcceleratorsFromWindowsStyle( @@ -242,7 +242,7 @@ void GlobalMenuBarX11::BuildMenuFromModel(AtomMenuModel* model, g_object_set_data(G_OBJECT(item), "model", model); SetMenuItemID(item, i); - if (type == AtomMenuModel::TYPE_SUBMENU) { + if (type == ElectronMenuModel::TYPE_SUBMENU) { menuitem_property_set(item, kPropertyChildrenDisplay, kDisplaySubmenu); g_signal_connect(item, "about-to-show", G_CALLBACK(OnSubMenuShowThunk), this); @@ -254,11 +254,12 @@ void GlobalMenuBarX11::BuildMenuFromModel(AtomMenuModel* model, g_signal_connect(item, "item-activated", G_CALLBACK(OnItemActivatedThunk), this); - if (type == AtomMenuModel::TYPE_CHECK || - type == AtomMenuModel::TYPE_RADIO) { - menuitem_property_set( - item, kPropertyToggleType, - type == AtomMenuModel::TYPE_CHECK ? kToggleCheck : kToggleRadio); + if (type == ElectronMenuModel::TYPE_CHECK || + type == ElectronMenuModel::TYPE_RADIO) { + menuitem_property_set(item, kPropertyToggleType, + type == ElectronMenuModel::TYPE_CHECK + ? kToggleCheck + : kToggleRadio); menuitem_property_set_int(item, kPropertyToggleState, model->IsItemCheckedAt(i)); } @@ -303,14 +304,14 @@ void GlobalMenuBarX11::RegisterAccelerator(DbusmenuMenuitem* item, void GlobalMenuBarX11::OnItemActivated(DbusmenuMenuitem* item, unsigned int timestamp) { int id; - AtomMenuModel* model = ModelForMenuItem(item); + ElectronMenuModel* model = ModelForMenuItem(item); if (model && GetMenuItemID(item, &id)) model->ActivatedAt(id, 0); } void GlobalMenuBarX11::OnSubMenuShow(DbusmenuMenuitem* item) { int id; - AtomMenuModel* model = ModelForMenuItem(item); + ElectronMenuModel* model = ModelForMenuItem(item); if (!model || !GetMenuItemID(item, &id)) return; diff --git a/shell/browser/ui/views/global_menu_bar_x11.h b/shell/browser/ui/views/global_menu_bar_x11.h index b0ccf332176..467ce62548e 100644 --- a/shell/browser/ui/views/global_menu_bar_x11.h +++ b/shell/browser/ui/views/global_menu_bar_x11.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "ui/base/glib/glib_signal.h" #include "ui/gfx/native_widget_types.h" @@ -43,7 +43,7 @@ class GlobalMenuBarX11 { // Creates the object path for DbusmenuServer which is attached to |xid|. static std::string GetPathForWindow(gfx::AcceleratedWidget xid); - void SetMenu(AtomMenuModel* menu_model); + void SetMenu(ElectronMenuModel* menu_model); bool IsServerStarted() const; // Called by NativeWindow when it show/hides. @@ -55,7 +55,7 @@ class GlobalMenuBarX11 { void InitServer(gfx::AcceleratedWidget xid); // Create a menu from menu model. - void BuildMenuFromModel(AtomMenuModel* model, DbusmenuMenuitem* parent); + void BuildMenuFromModel(ElectronMenuModel* model, DbusmenuMenuitem* parent); // Sets the accelerator for |item|. void RegisterAccelerator(DbusmenuMenuitem* item, diff --git a/shell/browser/ui/views/menu_bar.cc b/shell/browser/ui/views/menu_bar.cc index e6ba7de5858..47f6427ccad 100644 --- a/shell/browser/ui/views/menu_bar.cc +++ b/shell/browser/ui/views/menu_bar.cc @@ -68,7 +68,7 @@ MenuBar::~MenuBar() { window_->GetFocusManager()->RemoveFocusChangeListener(color_updater_.get()); } -void MenuBar::SetMenu(AtomMenuModel* model) { +void MenuBar::SetMenu(ElectronMenuModel* model) { menu_model_ = model; RebuildChildren(); } @@ -101,7 +101,7 @@ int MenuBar::GetItemCount() const { } bool MenuBar::GetMenuButtonFromScreenPoint(const gfx::Point& screenPoint, - AtomMenuModel** menu_model, + ElectronMenuModel** menu_model, views::MenuButton** button) { if (!GetBoundsInScreen().Contains(screenPoint)) return false; @@ -109,7 +109,7 @@ bool MenuBar::GetMenuButtonFromScreenPoint(const gfx::Point& screenPoint, auto children = GetChildrenInZOrder(); for (int i = 0, n = children.size(); i < n; ++i) { if (children[i]->GetBoundsInScreen().Contains(screenPoint) && - (menu_model_->GetTypeAt(i) == AtomMenuModel::TYPE_SUBMENU)) { + (menu_model_->GetTypeAt(i) == ElectronMenuModel::TYPE_SUBMENU)) { *menu_model = menu_model_->GetSubmenuModelAt(i); *button = static_cast(children[i]); return true; @@ -265,8 +265,8 @@ void MenuBar::ButtonPressed(views::Button* source, const ui::Event& event) { window_->RequestFocus(); int id = source->tag(); - AtomMenuModel::ItemType type = menu_model_->GetTypeAt(id); - if (type != AtomMenuModel::TYPE_SUBMENU) { + ElectronMenuModel::ItemType type = menu_model_->GetTypeAt(id); + if (type != ElectronMenuModel::TYPE_SUBMENU) { menu_model_->ActivatedAt(id, 0); return; } diff --git a/shell/browser/ui/views/menu_bar.h b/shell/browser/ui/views/menu_bar.h index 2da43755b03..67fc4e3f54f 100644 --- a/shell/browser/ui/views/menu_bar.h +++ b/shell/browser/ui/views/menu_bar.h @@ -7,7 +7,7 @@ #include -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "shell/browser/ui/views/menu_delegate.h" #include "shell/browser/ui/views/root_view.h" #include "ui/views/accessible_pane_view.h" @@ -46,7 +46,7 @@ class MenuBar : public views::AccessiblePaneView, ~MenuBar() override; // Replaces current menu with a new one. - void SetMenu(AtomMenuModel* menu_model); + void SetMenu(ElectronMenuModel* menu_model); // Shows underline under accelerators. void SetAcceleratorVisibility(bool visible); @@ -62,7 +62,7 @@ class MenuBar : public views::AccessiblePaneView, // Get the menu under specified screen point. bool GetMenuButtonFromScreenPoint(const gfx::Point& point, - AtomMenuModel** menu_model, + ElectronMenuModel** menu_model, views::MenuButton** button); // electron::MenuDelegate::Observer: @@ -96,7 +96,7 @@ class MenuBar : public views::AccessiblePaneView, #endif RootView* window_ = nullptr; - AtomMenuModel* menu_model_ = nullptr; + ElectronMenuModel* menu_model_ = nullptr; View* FindAccelChild(base::char16 key); diff --git a/shell/browser/ui/views/menu_delegate.cc b/shell/browser/ui/views/menu_delegate.cc index ec0ce612f2d..3623914dad2 100644 --- a/shell/browser/ui/views/menu_delegate.cc +++ b/shell/browser/ui/views/menu_delegate.cc @@ -23,7 +23,7 @@ MenuDelegate::MenuDelegate(MenuBar* menu_bar) MenuDelegate::~MenuDelegate() = default; -void MenuDelegate::RunMenu(AtomMenuModel* model, +void MenuDelegate::RunMenu(ElectronMenuModel* model, views::Button* button, ui::MenuSourceType source_type) { gfx::Point screen_loc; @@ -123,7 +123,7 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu( // TODO(zcbenz): We should follow Chromium's logics on implementing the // sibling menu switches, this code is almost a hack. views::MenuButton* button; - AtomMenuModel* model; + ElectronMenuModel* model; if (menu_bar_->GetMenuButtonFromScreenPoint(screen_point, &model, &button) && button->tag() != id_) { bool switch_in_progress = !!button_to_open_; diff --git a/shell/browser/ui/views/menu_delegate.h b/shell/browser/ui/views/menu_delegate.h index db19b265c65..73aafb48637 100644 --- a/shell/browser/ui/views/menu_delegate.h +++ b/shell/browser/ui/views/menu_delegate.h @@ -8,7 +8,7 @@ #include #include "base/observer_list.h" -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "ui/views/controls/menu/menu_delegate.h" namespace views { @@ -25,7 +25,7 @@ class MenuDelegate : public views::MenuDelegate { explicit MenuDelegate(MenuBar* menu_bar); ~MenuDelegate() override; - void RunMenu(AtomMenuModel* model, + void RunMenu(ElectronMenuModel* model, views::Button* button, ui::MenuSourceType source_type); diff --git a/shell/browser/ui/views/menu_model_adapter.cc b/shell/browser/ui/views/menu_model_adapter.cc index 0fe6b8b9c2c..be8083833d0 100644 --- a/shell/browser/ui/views/menu_model_adapter.cc +++ b/shell/browser/ui/views/menu_model_adapter.cc @@ -6,7 +6,7 @@ namespace electron { -MenuModelAdapter::MenuModelAdapter(AtomMenuModel* menu_model) +MenuModelAdapter::MenuModelAdapter(ElectronMenuModel* menu_model) : views::MenuModelAdapter(menu_model), menu_model_(menu_model) {} MenuModelAdapter::~MenuModelAdapter() = default; @@ -16,7 +16,7 @@ bool MenuModelAdapter::GetAccelerator(int id, ui::MenuModel* model = menu_model_; int index = 0; if (ui::MenuModel::GetModelAndIndexForCommandId(id, &model, &index)) { - return static_cast(model)->GetAcceleratorAtWithParams( + return static_cast(model)->GetAcceleratorAtWithParams( index, true, accelerator); } return false; diff --git a/shell/browser/ui/views/menu_model_adapter.h b/shell/browser/ui/views/menu_model_adapter.h index 6647fa34353..1468bea3d12 100644 --- a/shell/browser/ui/views/menu_model_adapter.h +++ b/shell/browser/ui/views/menu_model_adapter.h @@ -5,21 +5,21 @@ #ifndef SHELL_BROWSER_UI_VIEWS_MENU_MODEL_ADAPTER_H_ #define SHELL_BROWSER_UI_VIEWS_MENU_MODEL_ADAPTER_H_ -#include "shell/browser/ui/atom_menu_model.h" +#include "shell/browser/ui/electron_menu_model.h" #include "ui/views/controls/menu/menu_model_adapter.h" namespace electron { class MenuModelAdapter : public views::MenuModelAdapter { public: - explicit MenuModelAdapter(AtomMenuModel* menu_model); + explicit MenuModelAdapter(ElectronMenuModel* menu_model); ~MenuModelAdapter() override; protected: bool GetAccelerator(int id, ui::Accelerator* accelerator) const override; private: - AtomMenuModel* menu_model_; + ElectronMenuModel* menu_model_; DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter); }; diff --git a/shell/browser/ui/views/native_frame_view.cc b/shell/browser/ui/views/native_frame_view.cc index 02f7ba8c2f1..48fa68f61d8 100644 --- a/shell/browser/ui/views/native_frame_view.cc +++ b/shell/browser/ui/views/native_frame_view.cc @@ -8,7 +8,7 @@ namespace electron { -const char NativeFrameView::kViewClassName[] = "AtomNativeFrameView"; +const char NativeFrameView::kViewClassName[] = "ElectronNativeFrameView"; NativeFrameView::NativeFrameView(NativeWindow* window, views::Widget* widget) : views::NativeFrameView(widget), window_(window) {} diff --git a/shell/browser/ui/views/root_view.cc b/shell/browser/ui/views/root_view.cc index 6d4b45c67f5..c3250a27350 100644 --- a/shell/browser/ui/views/root_view.cc +++ b/shell/browser/ui/views/root_view.cc @@ -45,7 +45,7 @@ RootView::RootView(NativeWindow* window) RootView::~RootView() = default; -void RootView::SetMenu(AtomMenuModel* menu_model) { +void RootView::SetMenu(ElectronMenuModel* menu_model) { if (menu_model == nullptr) { // Remove accelerators UnregisterAcceleratorsWithFocusManager(); @@ -201,7 +201,8 @@ bool RootView::AcceleratorPressed(const ui::Accelerator& accelerator) { accelerator); } -void RootView::RegisterAcceleratorsWithFocusManager(AtomMenuModel* menu_model) { +void RootView::RegisterAcceleratorsWithFocusManager( + ElectronMenuModel* menu_model) { if (!menu_model) return; // Clear previous accelerators. diff --git a/shell/browser/ui/views/root_view.h b/shell/browser/ui/views/root_view.h index 5a1c4123245..afd82a070df 100644 --- a/shell/browser/ui/views/root_view.h +++ b/shell/browser/ui/views/root_view.h @@ -18,7 +18,7 @@ struct NativeWebKeyboardEvent; namespace electron { -class AtomMenuModel; +class ElectronMenuModel; class MenuBar; class NativeWindow; @@ -27,7 +27,7 @@ class RootView : public views::View { explicit RootView(NativeWindow* window); ~RootView() override; - void SetMenu(AtomMenuModel* menu_model); + void SetMenu(ElectronMenuModel* menu_model); bool HasMenu() const; int GetMenuBarHeight() const; void SetAutoHideMenuBar(bool auto_hide); @@ -38,7 +38,7 @@ class RootView : public views::View { void ResetAltState(); void RestoreFocus(); // Register/Unregister accelerators supported by the menu model. - void RegisterAcceleratorsWithFocusManager(AtomMenuModel* menu_model); + void RegisterAcceleratorsWithFocusManager(ElectronMenuModel* menu_model); void UnregisterAcceleratorsWithFocusManager(); // views::View: diff --git a/shell/browser/ui/win/atom_desktop_native_widget_aura.cc b/shell/browser/ui/win/electron_desktop_native_widget_aura.cc similarity index 78% rename from shell/browser/ui/win/atom_desktop_native_widget_aura.cc rename to shell/browser/ui/win/electron_desktop_native_widget_aura.cc index ef42304c00d..91eb7d71b04 100644 --- a/shell/browser/ui/win/atom_desktop_native_widget_aura.cc +++ b/shell/browser/ui/win/electron_desktop_native_widget_aura.cc @@ -2,35 +2,35 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/ui/win/atom_desktop_native_widget_aura.h" +#include "shell/browser/ui/win/electron_desktop_native_widget_aura.h" #include -#include "shell/browser/ui/win/atom_desktop_window_tree_host_win.h" +#include "shell/browser/ui/win/electron_desktop_window_tree_host_win.h" #include "ui/views/corewm/tooltip_controller.h" #include "ui/wm/public/tooltip_client.h" namespace electron { -AtomDesktopNativeWidgetAura::AtomDesktopNativeWidgetAura( +ElectronDesktopNativeWidgetAura::ElectronDesktopNativeWidgetAura( NativeWindowViews* native_window_view) : views::DesktopNativeWidgetAura(native_window_view->widget()), native_window_view_(native_window_view) { - GetNativeWindow()->SetName("AtomDesktopNativeWidgetAura"); + GetNativeWindow()->SetName("ElectronDesktopNativeWidgetAura"); // This is to enable the override of OnWindowActivated wm::SetActivationChangeObserver(GetNativeWindow(), this); } -void AtomDesktopNativeWidgetAura::InitNativeWidget( +void ElectronDesktopNativeWidgetAura::InitNativeWidget( views::Widget::InitParams params) { - desktop_window_tree_host_ = new AtomDesktopWindowTreeHostWin( + desktop_window_tree_host_ = new ElectronDesktopWindowTreeHostWin( native_window_view_, static_cast(params.native_widget)); params.desktop_window_tree_host = desktop_window_tree_host_; views::DesktopNativeWidgetAura::InitNativeWidget(std::move(params)); } -void AtomDesktopNativeWidgetAura::Activate() { +void ElectronDesktopNativeWidgetAura::Activate() { // Activate can cause the focused window to be blurred so only // call when the window being activated is visible. This prevents // hidden windows from blurring the focused window when created. @@ -38,7 +38,7 @@ void AtomDesktopNativeWidgetAura::Activate() { views::DesktopNativeWidgetAura::Activate(); } -void AtomDesktopNativeWidgetAura::OnWindowActivated( +void ElectronDesktopNativeWidgetAura::OnWindowActivated( wm::ActivationChangeObserver::ActivationReason reason, aura::Window* gained_active, aura::Window* lost_active) { diff --git a/shell/browser/ui/win/atom_desktop_native_widget_aura.h b/shell/browser/ui/win/electron_desktop_native_widget_aura.h similarity index 66% rename from shell/browser/ui/win/atom_desktop_native_widget_aura.h rename to shell/browser/ui/win/electron_desktop_native_widget_aura.h index 9beb10913c9..00ffe0e86a2 100644 --- a/shell/browser/ui/win/atom_desktop_native_widget_aura.h +++ b/shell/browser/ui/win/electron_desktop_native_widget_aura.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_WIN_ATOM_DESKTOP_NATIVE_WIDGET_AURA_H_ -#define SHELL_BROWSER_UI_WIN_ATOM_DESKTOP_NATIVE_WIDGET_AURA_H_ +#ifndef SHELL_BROWSER_UI_WIN_ELECTRON_DESKTOP_NATIVE_WIDGET_AURA_H_ +#define SHELL_BROWSER_UI_WIN_ELECTRON_DESKTOP_NATIVE_WIDGET_AURA_H_ #include "shell/browser/native_window_views.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" @@ -14,9 +14,10 @@ class DesktopWindowTreeHost; namespace electron { -class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura { +class ElectronDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura { public: - explicit AtomDesktopNativeWidgetAura(NativeWindowViews* native_window_view); + explicit ElectronDesktopNativeWidgetAura( + NativeWindowViews* native_window_view); // views::DesktopNativeWidgetAura: void InitNativeWidget(views::Widget::InitParams params) override; @@ -34,9 +35,9 @@ class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura { // Owned by DesktopNativeWidgetAura. views::DesktopWindowTreeHost* desktop_window_tree_host_; - DISALLOW_COPY_AND_ASSIGN(AtomDesktopNativeWidgetAura); + DISALLOW_COPY_AND_ASSIGN(ElectronDesktopNativeWidgetAura); }; } // namespace electron -#endif // SHELL_BROWSER_UI_WIN_ATOM_DESKTOP_NATIVE_WIDGET_AURA_H_ +#endif // SHELL_BROWSER_UI_WIN_ELECTRON_DESKTOP_NATIVE_WIDGET_AURA_H_ diff --git a/shell/browser/ui/win/atom_desktop_window_tree_host_win.cc b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc similarity index 64% rename from shell/browser/ui/win/atom_desktop_window_tree_host_win.cc rename to shell/browser/ui/win/electron_desktop_window_tree_host_win.cc index 0890042e8ad..18ad4555c71 100644 --- a/shell/browser/ui/win/atom_desktop_window_tree_host_win.cc +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc @@ -2,37 +2,38 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/browser/ui/win/atom_desktop_window_tree_host_win.h" +#include "shell/browser/ui/win/electron_desktop_window_tree_host_win.h" #include "ui/base/win/hwnd_metrics.h" namespace electron { -AtomDesktopWindowTreeHostWin::AtomDesktopWindowTreeHostWin( +ElectronDesktopWindowTreeHostWin::ElectronDesktopWindowTreeHostWin( NativeWindowViews* native_window_view, views::DesktopNativeWidgetAura* desktop_native_widget_aura) : views::DesktopWindowTreeHostWin(native_window_view->widget(), desktop_native_widget_aura), native_window_view_(native_window_view) {} -AtomDesktopWindowTreeHostWin::~AtomDesktopWindowTreeHostWin() {} +ElectronDesktopWindowTreeHostWin::~ElectronDesktopWindowTreeHostWin() {} -bool AtomDesktopWindowTreeHostWin::PreHandleMSG(UINT message, - WPARAM w_param, - LPARAM l_param, - LRESULT* result) { +bool ElectronDesktopWindowTreeHostWin::PreHandleMSG(UINT message, + WPARAM w_param, + LPARAM l_param, + LRESULT* result) { return native_window_view_->PreHandleMSG(message, w_param, l_param, result); } -bool AtomDesktopWindowTreeHostWin::HasNativeFrame() const { +bool ElectronDesktopWindowTreeHostWin::HasNativeFrame() const { // Since we never use chromium's titlebar implementation, we can just say // that we use a native titlebar. This will disable the repaint locking when // DWM composition is disabled. return true; } -bool AtomDesktopWindowTreeHostWin::GetClientAreaInsets(gfx::Insets* insets, - HMONITOR monitor) const { +bool ElectronDesktopWindowTreeHostWin::GetClientAreaInsets( + gfx::Insets* insets, + HMONITOR monitor) const { if (IsMaximized() && !native_window_view_->has_frame()) { // Windows automatically adds a standard width border to all sides when a // window is maximized. diff --git a/shell/browser/ui/win/atom_desktop_window_tree_host_win.h b/shell/browser/ui/win/electron_desktop_window_tree_host_win.h similarity index 65% rename from shell/browser/ui/win/atom_desktop_window_tree_host_win.h rename to shell/browser/ui/win/electron_desktop_window_tree_host_win.h index 8afd235e20e..3c8f9692b50 100644 --- a/shell/browser/ui/win/atom_desktop_window_tree_host_win.h +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_BROWSER_UI_WIN_ATOM_DESKTOP_WINDOW_TREE_HOST_WIN_H_ -#define SHELL_BROWSER_UI_WIN_ATOM_DESKTOP_WINDOW_TREE_HOST_WIN_H_ +#ifndef SHELL_BROWSER_UI_WIN_ELECTRON_DESKTOP_WINDOW_TREE_HOST_WIN_H_ +#define SHELL_BROWSER_UI_WIN_ELECTRON_DESKTOP_WINDOW_TREE_HOST_WIN_H_ #include @@ -12,12 +12,13 @@ namespace electron { -class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin { +class ElectronDesktopWindowTreeHostWin + : public views::DesktopWindowTreeHostWin { public: - AtomDesktopWindowTreeHostWin( + ElectronDesktopWindowTreeHostWin( NativeWindowViews* native_window_view, views::DesktopNativeWidgetAura* desktop_native_widget_aura); - ~AtomDesktopWindowTreeHostWin() override; + ~ElectronDesktopWindowTreeHostWin() override; protected: bool PreHandleMSG(UINT message, @@ -31,9 +32,9 @@ class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin { private: NativeWindowViews* native_window_view_; // weak ref - DISALLOW_COPY_AND_ASSIGN(AtomDesktopWindowTreeHostWin); + DISALLOW_COPY_AND_ASSIGN(ElectronDesktopWindowTreeHostWin); }; } // namespace electron -#endif // SHELL_BROWSER_UI_WIN_ATOM_DESKTOP_WINDOW_TREE_HOST_WIN_H_ +#endif // SHELL_BROWSER_UI_WIN_ELECTRON_DESKTOP_WINDOW_TREE_HOST_WIN_H_ diff --git a/shell/browser/ui/win/notify_icon.cc b/shell/browser/ui/win/notify_icon.cc index 96753ca99da..15f3e252c6b 100644 --- a/shell/browser/ui/win/notify_icon.cc +++ b/shell/browser/ui/win/notify_icon.cc @@ -195,7 +195,7 @@ void NotifyIcon::Focus() { } void NotifyIcon::PopUpContextMenu(const gfx::Point& pos, - AtomMenuModel* menu_model) { + ElectronMenuModel* menu_model) { // Returns if context menu isn't set. if (menu_model == nullptr && menu_model_ == nullptr) return; @@ -243,7 +243,7 @@ void NotifyIcon::CloseContextMenu() { } } -void NotifyIcon::SetContextMenu(AtomMenuModel* menu_model) { +void NotifyIcon::SetContextMenu(ElectronMenuModel* menu_model) { menu_model_ = menu_model; } diff --git a/shell/browser/ui/win/notify_icon.h b/shell/browser/ui/win/notify_icon.h index db7179948a2..3589a86ca41 100644 --- a/shell/browser/ui/win/notify_icon.h +++ b/shell/browser/ui/win/notify_icon.h @@ -68,9 +68,9 @@ class NotifyIcon : public TrayIcon { void RemoveBalloon() override; void Focus() override; void PopUpContextMenu(const gfx::Point& pos, - AtomMenuModel* menu_model) override; + ElectronMenuModel* menu_model) override; void CloseContextMenu() override; - void SetContextMenu(AtomMenuModel* menu_model) override; + void SetContextMenu(ElectronMenuModel* menu_model) override; gfx::Rect GetBounds() override; private: @@ -93,7 +93,7 @@ class NotifyIcon : public TrayIcon { base::win::ScopedHICON icon_; // The context menu. - AtomMenuModel* menu_model_ = nullptr; + ElectronMenuModel* menu_model_ = nullptr; // An optional GUID used for identifying tray entries on Windows GUID guid_ = GUID_DEFAULT; diff --git a/shell/browser/web_contents_permission_helper.cc b/shell/browser/web_contents_permission_helper.cc index 49a3ac06ed0..a3f4adcd7d9 100644 --- a/shell/browser/web_contents_permission_helper.cc +++ b/shell/browser/web_contents_permission_helper.cc @@ -10,7 +10,7 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/render_process_host.h" -#include "shell/browser/atom_permission_manager.h" +#include "shell/browser/electron_permission_manager.h" #include "shell/browser/media/media_stream_devices_controller.h" namespace { @@ -69,7 +69,7 @@ void WebContentsPermissionHelper::RequestPermission( bool user_gesture, const base::DictionaryValue* details) { auto* rfh = web_contents_->GetMainFrame(); - auto* permission_manager = static_cast( + auto* permission_manager = static_cast( web_contents_->GetBrowserContext()->GetPermissionControllerDelegate()); auto origin = web_contents_->GetLastCommittedURL(); permission_manager->RequestPermissionWithDetails( @@ -81,7 +81,7 @@ bool WebContentsPermissionHelper::CheckPermission( content::PermissionType permission, const base::DictionaryValue* details) const { auto* rfh = web_contents_->GetMainFrame(); - auto* permission_manager = static_cast( + auto* permission_manager = static_cast( web_contents_->GetBrowserContext()->GetPermissionControllerDelegate()); auto origin = web_contents_->GetLastCommittedURL(); return permission_manager->CheckPermissionWithDetails(permission, rfh, origin, diff --git a/shell/browser/web_contents_preferences.h b/shell/browser/web_contents_preferences.h index 915ab7ddcd1..a8e434a3932 100644 --- a/shell/browser/web_contents_preferences.h +++ b/shell/browser/web_contents_preferences.h @@ -67,7 +67,7 @@ class WebContentsPreferences private: friend class content::WebContentsUserData; - friend class AtomBrowserClient; + friend class ElectronBrowserClient; // Get WebContents according to process ID. static content::WebContents* GetWebContentsFromProcessID(int process_id); diff --git a/shell/browser/web_dialog_helper.cc b/shell/browser/web_dialog_helper.cc index cd06e0712d0..ece49a8443b 100644 --- a/shell/browser/web_dialog_helper.cc +++ b/shell/browser/web_dialog_helper.cc @@ -25,7 +25,7 @@ #include "gin/dictionary.h" #include "net/base/directory_lister.h" #include "net/base/mime_util.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" #include "shell/browser/native_window.h" #include "shell/browser/ui/file_dialog.h" #include "shell/common/gin_converters/callback_converter.h" @@ -149,8 +149,9 @@ class FileSelectHelper : public base::RefCounted, } if (render_frame_host_ && !paths.empty()) { - auto* browser_context = static_cast( - render_frame_host_->GetProcess()->GetBrowserContext()); + auto* browser_context = + static_cast( + render_frame_host_->GetProcess()->GetBrowserContext()); browser_context->prefs()->SetFilePath(prefs::kSelectFileLastDirectory, paths[0].DirName()); } @@ -330,7 +331,7 @@ void WebDialogHelper::RunFileChooser( NOTREACHED(); } - auto* browser_context = static_cast( + auto* browser_context = static_cast( render_frame_host->GetProcess()->GetBrowserContext()); settings.default_path = browser_context->prefs() ->GetFilePath(prefs::kSelectFileLastDirectory) diff --git a/shell/browser/web_view_guest_delegate.cc b/shell/browser/web_view_guest_delegate.cc index e73d3d19026..aa39563657c 100644 --- a/shell/browser/web_view_guest_delegate.cc +++ b/shell/browser/web_view_guest_delegate.cc @@ -13,7 +13,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_view.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "third_party/blink/public/common/page/page_zoom.h" namespace electron { diff --git a/shell/browser/web_view_manager.cc b/shell/browser/web_view_manager.cc index 6aa9f81ae9d..64ecb922333 100644 --- a/shell/browser/web_view_manager.cc +++ b/shell/browser/web_view_manager.cc @@ -7,7 +7,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" -#include "shell/browser/atom_browser_context.h" +#include "shell/browser/electron_browser_context.h" namespace electron { diff --git a/shell/common/api/atom_api_asar.cc b/shell/common/api/electron_api_asar.cc similarity index 100% rename from shell/common/api/atom_api_asar.cc rename to shell/common/api/electron_api_asar.cc diff --git a/shell/common/api/atom_api_clipboard.cc b/shell/common/api/electron_api_clipboard.cc similarity index 99% rename from shell/common/api/atom_api_clipboard.cc rename to shell/common/api/electron_api_clipboard.cc index 6d2c490c863..51e312b3894 100644 --- a/shell/common/api/atom_api_clipboard.cc +++ b/shell/common/api/electron_api_clipboard.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/common/api/atom_api_clipboard.h" +#include "shell/common/api/electron_api_clipboard.h" #include "base/strings/utf_string_conversions.h" #include "shell/common/gin_converters/image_converter.h" diff --git a/shell/common/api/atom_api_clipboard.h b/shell/common/api/electron_api_clipboard.h similarity index 93% rename from shell/common/api/atom_api_clipboard.h rename to shell/common/api/electron_api_clipboard.h index 2198558fae8..815d588281d 100644 --- a/shell/common/api/atom_api_clipboard.h +++ b/shell/common/api/electron_api_clipboard.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_COMMON_API_ATOM_API_CLIPBOARD_H_ -#define SHELL_COMMON_API_ATOM_API_CLIPBOARD_H_ +#ifndef SHELL_COMMON_API_ELECTRON_API_CLIPBOARD_H_ +#define SHELL_COMMON_API_ELECTRON_API_CLIPBOARD_H_ #include #include @@ -70,4 +70,4 @@ class Clipboard { } // namespace electron -#endif // SHELL_COMMON_API_ATOM_API_CLIPBOARD_H_ +#endif // SHELL_COMMON_API_ELECTRON_API_CLIPBOARD_H_ diff --git a/shell/common/api/atom_api_clipboard_mac.mm b/shell/common/api/electron_api_clipboard_mac.mm similarity index 91% rename from shell/common/api/atom_api_clipboard_mac.mm rename to shell/common/api/electron_api_clipboard_mac.mm index 9e1e957cb91..aa47bab85dd 100644 --- a/shell/common/api/atom_api_clipboard_mac.mm +++ b/shell/common/api/electron_api_clipboard_mac.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/strings/sys_string_conversions.h" -#include "shell/common/api/atom_api_clipboard.h" +#include "shell/common/api/electron_api_clipboard.h" #include "ui/base/cocoa/find_pasteboard.h" namespace electron { diff --git a/shell/common/api/atom_api_command_line.cc b/shell/common/api/electron_api_command_line.cc similarity index 100% rename from shell/common/api/atom_api_command_line.cc rename to shell/common/api/electron_api_command_line.cc diff --git a/shell/common/api/atom_api_crash_reporter.cc b/shell/common/api/electron_api_crash_reporter.cc similarity index 100% rename from shell/common/api/atom_api_crash_reporter.cc rename to shell/common/api/electron_api_crash_reporter.cc diff --git a/shell/common/api/atom_api_key_weak_map.h b/shell/common/api/electron_api_key_weak_map.h similarity index 91% rename from shell/common/api/atom_api_key_weak_map.h rename to shell/common/api/electron_api_key_weak_map.h index 44a59e996ae..849a957918c 100644 --- a/shell/common/api/atom_api_key_weak_map.h +++ b/shell/common/api/electron_api_key_weak_map.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_COMMON_API_ATOM_API_KEY_WEAK_MAP_H_ -#define SHELL_COMMON_API_ATOM_API_KEY_WEAK_MAP_H_ +#ifndef SHELL_COMMON_API_ELECTRON_API_KEY_WEAK_MAP_H_ +#define SHELL_COMMON_API_ELECTRON_API_KEY_WEAK_MAP_H_ #include "gin/handle.h" #include "shell/common/gin_converters/std_converter.h" @@ -61,4 +61,4 @@ class KeyWeakMap : public gin_helper::Wrappable> { } // namespace electron -#endif // SHELL_COMMON_API_ATOM_API_KEY_WEAK_MAP_H_ +#endif // SHELL_COMMON_API_ELECTRON_API_KEY_WEAK_MAP_H_ diff --git a/shell/common/api/atom_api_native_image.cc b/shell/common/api/electron_api_native_image.cc similarity index 99% rename from shell/common/api/atom_api_native_image.cc rename to shell/common/api/electron_api_native_image.cc index e03c528dfb7..92b43b1489e 100644 --- a/shell/common/api/atom_api_native_image.cc +++ b/shell/common/api/electron_api_native_image.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/common/api/atom_api_native_image.h" +#include "shell/common/api/electron_api_native_image.h" #include #include diff --git a/shell/common/api/atom_api_native_image.h b/shell/common/api/electron_api_native_image.h similarity index 96% rename from shell/common/api/atom_api_native_image.h rename to shell/common/api/electron_api_native_image.h index e12aa45860f..e1d94e78e81 100644 --- a/shell/common/api/atom_api_native_image.h +++ b/shell/common/api/electron_api_native_image.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_COMMON_API_ATOM_API_NATIVE_IMAGE_H_ -#define SHELL_COMMON_API_ATOM_API_NATIVE_IMAGE_H_ +#ifndef SHELL_COMMON_API_ELECTRON_API_NATIVE_IMAGE_H_ +#define SHELL_COMMON_API_ELECTRON_API_NATIVE_IMAGE_H_ #include #include @@ -128,4 +128,4 @@ struct Converter { } // namespace gin -#endif // SHELL_COMMON_API_ATOM_API_NATIVE_IMAGE_H_ +#endif // SHELL_COMMON_API_ELECTRON_API_NATIVE_IMAGE_H_ diff --git a/shell/common/api/atom_api_native_image_mac.mm b/shell/common/api/electron_api_native_image_mac.mm similarity index 97% rename from shell/common/api/atom_api_native_image_mac.mm rename to shell/common/api/electron_api_native_image_mac.mm index 1d0a7fd07ba..8d6cab665ec 100644 --- a/shell/common/api/atom_api_native_image_mac.mm +++ b/shell/common/api/electron_api_native_image_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/common/api/atom_api_native_image.h" +#include "shell/common/api/electron_api_native_image.h" #include #include diff --git a/shell/common/api/atom_api_shell.cc b/shell/common/api/electron_api_shell.cc similarity index 100% rename from shell/common/api/atom_api_shell.cc rename to shell/common/api/electron_api_shell.cc diff --git a/shell/common/api/atom_api_v8_util.cc b/shell/common/api/electron_api_v8_util.cc similarity index 98% rename from shell/common/api/atom_api_v8_util.cc rename to shell/common/api/electron_api_v8_util.cc index a683f3dc544..572c451817e 100644 --- a/shell/common/api/atom_api_v8_util.cc +++ b/shell/common/api/electron_api_v8_util.cc @@ -15,7 +15,7 @@ #include "v8/include/v8-profiler.h" #if BUILDFLAG(ENABLE_REMOTE_MODULE) -#include "shell/common/api/atom_api_key_weak_map.h" +#include "shell/common/api/electron_api_key_weak_map.h" #include "shell/common/api/remote/remote_callback_freer.h" #include "shell/common/api/remote/remote_object_freer.h" #endif diff --git a/shell/common/crash_reporter/crash_reporter.cc b/shell/common/crash_reporter/crash_reporter.cc index ec756ed3fe4..1fd9a275f7e 100644 --- a/shell/common/crash_reporter/crash_reporter.cc +++ b/shell/common/crash_reporter/crash_reporter.cc @@ -15,7 +15,7 @@ #include "content/public/common/content_switches.h" #include "electron/electron_version.h" #include "shell/browser/browser.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/common/crash_reporter/crash_reporter_win.cc b/shell/common/crash_reporter/crash_reporter_win.cc index ffa2b728a43..0a737901a1e 100644 --- a/shell/common/crash_reporter/crash_reporter_win.cc +++ b/shell/common/crash_reporter/crash_reporter_win.cc @@ -15,7 +15,7 @@ #include "electron/shell/common/api/api.mojom.h" #include "mojo/public/cpp/bindings/associated_remote.h" #include "shell/browser/ui/inspectable_web_contents_impl.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/crashpad/crashpad/client/crashpad_client.h" #include "third_party/crashpad/crashpad/client/crashpad_info.h" diff --git a/shell/common/atom_command_line.cc b/shell/common/electron_command_line.cc similarity index 74% rename from shell/common/atom_command_line.cc rename to shell/common/electron_command_line.cc index e29e2114780..4bc0e2e2c1a 100644 --- a/shell/common/atom_command_line.cc +++ b/shell/common/electron_command_line.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/common/atom_command_line.h" +#include "shell/common/electron_command_line.h" #include "base/command_line.h" #include "uv.h" // NOLINT(build/include) @@ -10,10 +10,10 @@ namespace electron { // static -base::CommandLine::StringVector AtomCommandLine::argv_; +base::CommandLine::StringVector ElectronCommandLine::argv_; // static -void AtomCommandLine::Init(int argc, base::CommandLine::CharType** argv) { +void ElectronCommandLine::Init(int argc, base::CommandLine::CharType** argv) { DCHECK(argv_.empty()); // NOTE: uv_setup_args does nothing on Windows, so we don't need to call it. @@ -28,7 +28,7 @@ void AtomCommandLine::Init(int argc, base::CommandLine::CharType** argv) { #if defined(OS_LINUX) // static -void AtomCommandLine::InitializeFromCommandLine() { +void ElectronCommandLine::InitializeFromCommandLine() { argv_ = base::CommandLine::ForCurrentProcess()->argv(); } #endif diff --git a/shell/common/atom_command_line.h b/shell/common/electron_command_line.h similarity index 77% rename from shell/common/atom_command_line.h rename to shell/common/electron_command_line.h index c84f887735c..7a3cdc5b927 100644 --- a/shell/common/atom_command_line.h +++ b/shell/common/electron_command_line.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_COMMON_ATOM_COMMAND_LINE_H_ -#define SHELL_COMMON_ATOM_COMMAND_LINE_H_ +#ifndef SHELL_COMMON_ELECTRON_COMMAND_LINE_H_ +#define SHELL_COMMON_ELECTRON_COMMAND_LINE_H_ #include #include @@ -15,7 +15,7 @@ namespace electron { // Singleton to remember the original "argc" and "argv". -class AtomCommandLine { +class ElectronCommandLine { public: static const base::CommandLine::StringVector& argv() { return argv_; } @@ -30,9 +30,9 @@ class AtomCommandLine { private: static base::CommandLine::StringVector argv_; - DISALLOW_IMPLICIT_CONSTRUCTORS(AtomCommandLine); + DISALLOW_IMPLICIT_CONSTRUCTORS(ElectronCommandLine); }; } // namespace electron -#endif // SHELL_COMMON_ATOM_COMMAND_LINE_H_ +#endif // SHELL_COMMON_ELECTRON_COMMAND_LINE_H_ diff --git a/shell/common/atom_constants.cc b/shell/common/electron_constants.cc similarity index 97% rename from shell/common/atom_constants.cc rename to shell/common/electron_constants.cc index 01426ae0541..48bf7ae523e 100644 --- a/shell/common/atom_constants.cc +++ b/shell/common/electron_constants.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" namespace electron { diff --git a/shell/common/atom_constants.h b/shell/common/electron_constants.h similarity index 91% rename from shell/common/atom_constants.h rename to shell/common/electron_constants.h index 79a74168852..43d8bfe8be6 100644 --- a/shell/common/atom_constants.h +++ b/shell/common/electron_constants.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_COMMON_ATOM_CONSTANTS_H_ -#define SHELL_COMMON_ATOM_CONSTANTS_H_ +#ifndef SHELL_COMMON_ELECTRON_CONSTANTS_H_ +#define SHELL_COMMON_ELECTRON_CONSTANTS_H_ #include "build/build_config.h" #include "electron/buildflags/buildflags.h" @@ -49,4 +49,4 @@ extern const char kPdfViewerUIHost[]; } // namespace electron -#endif // SHELL_COMMON_ATOM_CONSTANTS_H_ +#endif // SHELL_COMMON_ELECTRON_CONSTANTS_H_ diff --git a/shell/common/gin_converters/content_converter.cc b/shell/common/gin_converters/content_converter.cc index 10630ab58d5..59eb8ea6b08 100644 --- a/shell/common/gin_converters/content_converter.cc +++ b/shell/common/gin_converters/content_converter.cc @@ -10,7 +10,7 @@ #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/web_contents.h" #include "content/public/common/context_menu_params.h" -#include "shell/browser/api/atom_api_web_contents.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/web_contents_permission_helper.h" #include "shell/common/gin_converters/blink_converter.h" #include "shell/common/gin_converters/callback_converter.h" diff --git a/shell/common/gin_converters/file_dialog_converter.cc b/shell/common/gin_converters/file_dialog_converter.cc index 1d8c27ebd23..2f12c71a18c 100644 --- a/shell/common/gin_converters/file_dialog_converter.cc +++ b/shell/common/gin_converters/file_dialog_converter.cc @@ -5,7 +5,7 @@ #include "shell/common/gin_converters/file_dialog_converter.h" #include "gin/dictionary.h" -#include "shell/browser/api/atom_api_browser_window.h" +#include "shell/browser/api/electron_api_browser_window.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_converters/native_window_converter.h" diff --git a/shell/common/gin_converters/image_converter.cc b/shell/common/gin_converters/image_converter.cc index 46477bb4d40..a0b73e23c4c 100644 --- a/shell/common/gin_converters/image_converter.cc +++ b/shell/common/gin_converters/image_converter.cc @@ -4,7 +4,7 @@ #include "shell/common/gin_converters/image_converter.h" -#include "shell/common/api/atom_api_native_image.h" +#include "shell/common/api/electron_api_native_image.h" #include "shell/common/gin_converters/file_path_converter.h" #include "ui/gfx/image/image_skia.h" diff --git a/shell/common/gin_converters/native_window_converter.h b/shell/common/gin_converters/native_window_converter.h index d3484a0f0e4..1b9022cbf39 100644 --- a/shell/common/gin_converters/native_window_converter.h +++ b/shell/common/gin_converters/native_window_converter.h @@ -6,7 +6,7 @@ #define SHELL_COMMON_GIN_CONVERTERS_NATIVE_WINDOW_CONVERTER_H_ #include "gin/converter.h" -#include "shell/browser/api/atom_api_top_level_window.h" +#include "shell/browser/api/electron_api_top_level_window.h" namespace gin { diff --git a/shell/common/gin_converters/net_converter.cc b/shell/common/gin_converters/net_converter.cc index ff276fc0397..5a6ad711a5c 100644 --- a/shell/common/gin_converters/net_converter.cc +++ b/shell/common/gin_converters/net_converter.cc @@ -20,7 +20,7 @@ #include "net/http/http_version.h" #include "net/url_request/redirect_info.h" #include "services/network/public/cpp/resource_request.h" -#include "shell/browser/api/atom_api_data_pipe_holder.h" +#include "shell/browser/api/electron_api_data_pipe_holder.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/std_converter.h" #include "shell/common/gin_converters/value_converter.h" diff --git a/shell/common/gin_helper/persistent_dictionary.h b/shell/common/gin_helper/persistent_dictionary.h index c201bf23cb9..f7b049583dc 100644 --- a/shell/common/gin_helper/persistent_dictionary.h +++ b/shell/common/gin_helper/persistent_dictionary.h @@ -12,8 +12,8 @@ namespace gin_helper { // Like Dictionary, but stores object in persistent handle so you can keep it // safely on heap. // -// TODO(zcbenz): The only user of this class is AtomTouchBar, we should migrate -// away from this class. +// TODO(zcbenz): The only user of this class is ElectronTouchBar, we should +// migrate away from this class. class PersistentDictionary { public: PersistentDictionary(); diff --git a/shell/common/gin_helper/trackable_object.cc b/shell/common/gin_helper/trackable_object.cc index 438a565bfa8..b1afef8c908 100644 --- a/shell/common/gin_helper/trackable_object.cc +++ b/shell/common/gin_helper/trackable_object.cc @@ -8,7 +8,7 @@ #include "base/bind.h" #include "base/supports_user_data.h" -#include "shell/browser/atom_browser_main_parts.h" +#include "shell/browser/electron_browser_main_parts.h" #include "shell/common/gin_helper/locker.h" namespace gin_helper { @@ -36,7 +36,7 @@ TrackableObjectBase::TrackableObjectBase() : weak_factory_(this) { DCHECK(gin_helper::Locker::IsBrowserProcess()) << "This class only works for browser process"; - electron::AtomBrowserMainParts::Get()->RegisterDestructionCallback( + electron::ElectronBrowserMainParts::Get()->RegisterDestructionCallback( GetDestroyClosure()); } diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 57a3de0c265..261895353e3 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -23,7 +23,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/common/content_paths.h" #include "electron/buildflags/buildflags.h" -#include "shell/common/atom_command_line.h" +#include "shell/common/electron_command_line.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/event_emitter_caller.h" @@ -264,7 +264,7 @@ void NodeBindings::Initialize() { #if defined(OS_LINUX) // Get real command line in renderer process forked by zygote. if (browser_env_ != BrowserEnvironment::BROWSER) - AtomCommandLine::InitializeFromCommandLine(); + ElectronCommandLine::InitializeFromCommandLine(); #endif // Explicitly register electron's builtin modules. @@ -302,12 +302,12 @@ node::Environment* NodeBindings::CreateEnvironment( node::MultiIsolatePlatform* platform, bool bootstrap_env) { #if defined(OS_WIN) - auto& atom_args = AtomCommandLine::argv(); + auto& atom_args = ElectronCommandLine::argv(); std::vector args(atom_args.size()); std::transform(atom_args.cbegin(), atom_args.cend(), args.begin(), [](auto& a) { return base::WideToUTF8(a); }); #else - auto args = AtomCommandLine::argv(); + auto args = ElectronCommandLine::argv(); #endif // Feed node the path to initialization script. diff --git a/shell/common/resources/mac/MainMenu.xib b/shell/common/resources/mac/MainMenu.xib index 5427dde7f92..4eea6595a15 100644 --- a/shell/common/resources/mac/MainMenu.xib +++ b/shell/common/resources/mac/MainMenu.xib @@ -24,7 +24,7 @@ - AtomApplication + ElectronApplication FirstResponder diff --git a/shell/renderer/api/context_bridge/render_frame_context_bridge_store.h b/shell/renderer/api/context_bridge/render_frame_context_bridge_store.h index 0f375734518..2d0a6c0f4f7 100644 --- a/shell/renderer/api/context_bridge/render_frame_context_bridge_store.h +++ b/shell/renderer/api/context_bridge/render_frame_context_bridge_store.h @@ -10,7 +10,7 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_observer.h" -#include "shell/renderer/atom_render_frame_observer.h" +#include "shell/renderer/electron_render_frame_observer.h" #include "third_party/blink/public/web/web_local_frame.h" namespace electron { diff --git a/shell/renderer/api/atom_api_context_bridge.cc b/shell/renderer/api/electron_api_context_bridge.cc similarity index 99% rename from shell/renderer/api/atom_api_context_bridge.cc rename to shell/renderer/api/electron_api_context_bridge.cc index 7d4fb97385d..c9c7372d1f4 100644 --- a/shell/renderer/api/atom_api_context_bridge.cc +++ b/shell/renderer/api/electron_api_context_bridge.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/renderer/api/atom_api_context_bridge.h" +#include "shell/renderer/api/electron_api_context_bridge.h" #include #include @@ -21,7 +21,7 @@ #include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" #include "shell/renderer/api/context_bridge/render_frame_context_bridge_store.h" -#include "shell/renderer/atom_render_frame_observer.h" +#include "shell/renderer/electron_render_frame_observer.h" #include "third_party/blink/public/web/web_local_frame.h" namespace electron { diff --git a/shell/renderer/api/atom_api_context_bridge.h b/shell/renderer/api/electron_api_context_bridge.h similarity index 81% rename from shell/renderer/api/atom_api_context_bridge.h rename to shell/renderer/api/electron_api_context_bridge.h index 88593e1e2df..9fe9861a0c8 100644 --- a/shell/renderer/api/atom_api_context_bridge.h +++ b/shell/renderer/api/electron_api_context_bridge.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_RENDERER_API_ATOM_API_CONTEXT_BRIDGE_H_ -#define SHELL_RENDERER_API_ATOM_API_CONTEXT_BRIDGE_H_ +#ifndef SHELL_RENDERER_API_ELECTRON_API_CONTEXT_BRIDGE_H_ +#define SHELL_RENDERER_API_ELECTRON_API_CONTEXT_BRIDGE_H_ #include "v8/include/v8.h" @@ -35,4 +35,4 @@ v8::MaybeLocal CreateProxyForAPI( } // namespace electron -#endif // SHELL_RENDERER_API_ATOM_API_CONTEXT_BRIDGE_H_ +#endif // SHELL_RENDERER_API_ELECTRON_API_CONTEXT_BRIDGE_H_ diff --git a/shell/renderer/api/atom_api_renderer_ipc.cc b/shell/renderer/api/electron_api_renderer_ipc.cc similarity index 100% rename from shell/renderer/api/atom_api_renderer_ipc.cc rename to shell/renderer/api/electron_api_renderer_ipc.cc diff --git a/shell/renderer/api/atom_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc similarity index 99% rename from shell/renderer/api/atom_api_spell_check_client.cc rename to shell/renderer/api/electron_api_spell_check_client.cc index 47bbb41e225..e5529e96d6b 100644 --- a/shell/renderer/api/atom_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/renderer/api/atom_api_spell_check_client.h" +#include "shell/renderer/api/electron_api_spell_check_client.h" #include #include diff --git a/shell/renderer/api/atom_api_spell_check_client.h b/shell/renderer/api/electron_api_spell_check_client.h similarity index 95% rename from shell/renderer/api/atom_api_spell_check_client.h rename to shell/renderer/api/electron_api_spell_check_client.h index 131676059a9..1e32be9c003 100644 --- a/shell/renderer/api/atom_api_spell_check_client.h +++ b/shell/renderer/api/electron_api_spell_check_client.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_RENDERER_API_ATOM_API_SPELL_CHECK_CLIENT_H_ -#define SHELL_RENDERER_API_ATOM_API_SPELL_CHECK_CLIENT_H_ +#ifndef SHELL_RENDERER_API_ELECTRON_API_SPELL_CHECK_CLIENT_H_ +#define SHELL_RENDERER_API_ELECTRON_API_SPELL_CHECK_CLIENT_H_ #include #include @@ -111,4 +111,4 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient, } // namespace electron -#endif // SHELL_RENDERER_API_ATOM_API_SPELL_CHECK_CLIENT_H_ +#endif // SHELL_RENDERER_API_ELECTRON_API_SPELL_CHECK_CLIENT_H_ diff --git a/shell/renderer/api/atom_api_web_frame.cc b/shell/renderer/api/electron_api_web_frame.cc similarity index 99% rename from shell/renderer/api/atom_api_web_frame.cc rename to shell/renderer/api/electron_api_web_frame.cc index 2931c56e11a..359b58b98c8 100644 --- a/shell/renderer/api/atom_api_web_frame.cc +++ b/shell/renderer/api/electron_api_web_frame.cc @@ -18,7 +18,7 @@ #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" -#include "shell/renderer/api/atom_api_spell_check_client.h" +#include "shell/renderer/api/electron_api_spell_check_client.h" #include "third_party/blink/public/common/page/page_zoom.h" #include "third_party/blink/public/common/web_cache/web_cache_resource_type_stats.h" #include "third_party/blink/public/platform/web_cache.h" diff --git a/shell/renderer/electron_api_service_impl.cc b/shell/renderer/electron_api_service_impl.cc index 3c20e86d608..a6ad3efedb2 100644 --- a/shell/renderer/electron_api_service_impl.cc +++ b/shell/renderer/electron_api_service_impl.cc @@ -12,13 +12,13 @@ #include "base/macros.h" #include "base/threading/thread_restrictions.h" #include "mojo/public/cpp/system/platform_handle.h" -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #include "shell/common/gin_converters/blink_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/heap_snapshot.h" #include "shell/common/node_includes.h" #include "shell/common/options_switches.h" -#include "shell/renderer/atom_render_frame_observer.h" +#include "shell/renderer/electron_render_frame_observer.h" #include "shell/renderer/renderer_client_base.h" #include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/web_local_frame.h" diff --git a/shell/renderer/atom_autofill_agent.cc b/shell/renderer/electron_autofill_agent.cc similarity index 99% rename from shell/renderer/atom_autofill_agent.cc rename to shell/renderer/electron_autofill_agent.cc index 8c8d20223f9..6c8a20d12bf 100644 --- a/shell/renderer/atom_autofill_agent.cc +++ b/shell/renderer/electron_autofill_agent.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/renderer/atom_autofill_agent.h" +#include "shell/renderer/electron_autofill_agent.h" #include #include diff --git a/shell/renderer/atom_autofill_agent.h b/shell/renderer/electron_autofill_agent.h similarity index 95% rename from shell/renderer/atom_autofill_agent.h rename to shell/renderer/electron_autofill_agent.h index f5e2029531c..9d5a0fb98e5 100644 --- a/shell/renderer/atom_autofill_agent.h +++ b/shell/renderer/electron_autofill_agent.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_RENDERER_ATOM_AUTOFILL_AGENT_H_ -#define SHELL_RENDERER_ATOM_AUTOFILL_AGENT_H_ +#ifndef SHELL_RENDERER_ELECTRON_AUTOFILL_AGENT_H_ +#define SHELL_RENDERER_ELECTRON_AUTOFILL_AGENT_H_ #include @@ -91,4 +91,4 @@ class AutofillAgent : public content::RenderFrameObserver, } // namespace electron -#endif // SHELL_RENDERER_ATOM_AUTOFILL_AGENT_H_ +#endif // SHELL_RENDERER_ELECTRON_AUTOFILL_AGENT_H_ diff --git a/shell/renderer/atom_render_frame_observer.cc b/shell/renderer/electron_render_frame_observer.cc similarity index 89% rename from shell/renderer/atom_render_frame_observer.cc rename to shell/renderer/electron_render_frame_observer.cc index 5dcc1e454e6..0cdbbddd0c0 100644 --- a/shell/renderer/atom_render_frame_observer.cc +++ b/shell/renderer/electron_render_frame_observer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/renderer/atom_render_frame_observer.h" +#include "shell/renderer/electron_render_frame_observer.h" #include #include @@ -43,7 +43,7 @@ scoped_refptr NetResourceProvider(int key) { } // namespace -AtomRenderFrameObserver::AtomRenderFrameObserver( +ElectronRenderFrameObserver::ElectronRenderFrameObserver( content::RenderFrame* frame, RendererClientBase* renderer_client) : content::RenderFrameObserver(frame), @@ -53,11 +53,11 @@ AtomRenderFrameObserver::AtomRenderFrameObserver( net::NetModule::SetResourceProvider(NetResourceProvider); } -void AtomRenderFrameObserver::DidClearWindowObject() { +void ElectronRenderFrameObserver::DidClearWindowObject() { renderer_client_->DidClearWindowObject(render_frame_); } -void AtomRenderFrameObserver::DidCreateScriptContext( +void ElectronRenderFrameObserver::DidCreateScriptContext( v8::Handle context, int world_id) { if (ShouldNotifyClient(world_id)) @@ -98,7 +98,7 @@ void AtomRenderFrameObserver::DidCreateScriptContext( #endif } -void AtomRenderFrameObserver::DraggableRegionsChanged() { +void ElectronRenderFrameObserver::DraggableRegionsChanged() { blink::WebVector webregions = render_frame_->GetWebFrame()->GetDocument().DraggableRegions(); std::vector regions; @@ -116,18 +116,18 @@ void AtomRenderFrameObserver::DraggableRegionsChanged() { browser_ptr->UpdateDraggableRegions(std::move(regions)); } -void AtomRenderFrameObserver::WillReleaseScriptContext( +void ElectronRenderFrameObserver::WillReleaseScriptContext( v8::Local context, int world_id) { if (ShouldNotifyClient(world_id)) renderer_client_->WillReleaseScriptContext(context, render_frame_); } -void AtomRenderFrameObserver::OnDestruct() { +void ElectronRenderFrameObserver::OnDestruct() { delete this; } -void AtomRenderFrameObserver::CreateIsolatedWorldContext() { +void ElectronRenderFrameObserver::CreateIsolatedWorldContext() { auto* frame = render_frame_->GetWebFrame(); blink::WebIsolatedWorldInfo info; // This maps to the name shown in the context combo box in the Console tab @@ -143,15 +143,15 @@ void AtomRenderFrameObserver::CreateIsolatedWorldContext() { frame->ExecuteScriptInIsolatedWorld(World::ISOLATED_WORLD, source); } -bool AtomRenderFrameObserver::IsMainWorld(int world_id) { +bool ElectronRenderFrameObserver::IsMainWorld(int world_id) { return world_id == World::MAIN_WORLD; } -bool AtomRenderFrameObserver::IsIsolatedWorld(int world_id) { +bool ElectronRenderFrameObserver::IsIsolatedWorld(int world_id) { return world_id == World::ISOLATED_WORLD; } -bool AtomRenderFrameObserver::ShouldNotifyClient(int world_id) { +bool ElectronRenderFrameObserver::ShouldNotifyClient(int world_id) { bool allow_node_in_sub_frames = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNodeIntegrationInSubFrames); diff --git a/shell/renderer/atom_render_frame_observer.h b/shell/renderer/electron_render_frame_observer.h similarity index 81% rename from shell/renderer/atom_render_frame_observer.h rename to shell/renderer/electron_render_frame_observer.h index 61184965017..137025b1c15 100644 --- a/shell/renderer/atom_render_frame_observer.h +++ b/shell/renderer/electron_render_frame_observer.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_RENDERER_ATOM_RENDER_FRAME_OBSERVER_H_ -#define SHELL_RENDERER_ATOM_RENDER_FRAME_OBSERVER_H_ +#ifndef SHELL_RENDERER_ELECTRON_RENDER_FRAME_OBSERVER_H_ +#define SHELL_RENDERER_ELECTRON_RENDER_FRAME_OBSERVER_H_ #include @@ -38,10 +38,10 @@ enum World { }; // Helper class to forward the messages to the client. -class AtomRenderFrameObserver : public content::RenderFrameObserver { +class ElectronRenderFrameObserver : public content::RenderFrameObserver { public: - AtomRenderFrameObserver(content::RenderFrame* frame, - RendererClientBase* renderer_client); + ElectronRenderFrameObserver(content::RenderFrame* frame, + RendererClientBase* renderer_client); // content::RenderFrameObserver: void DidClearWindowObject() override; @@ -63,9 +63,9 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver { content::RenderFrame* render_frame_; RendererClientBase* renderer_client_; - DISALLOW_COPY_AND_ASSIGN(AtomRenderFrameObserver); + DISALLOW_COPY_AND_ASSIGN(ElectronRenderFrameObserver); }; } // namespace electron -#endif // SHELL_RENDERER_ATOM_RENDER_FRAME_OBSERVER_H_ +#endif // SHELL_RENDERER_ELECTRON_RENDER_FRAME_OBSERVER_H_ diff --git a/shell/renderer/atom_renderer_client.cc b/shell/renderer/electron_renderer_client.cc similarity index 88% rename from shell/renderer/atom_renderer_client.cc rename to shell/renderer/electron_renderer_client.cc index 3aef1c68d33..8522c432185 100644 --- a/shell/renderer/atom_renderer_client.cc +++ b/shell/renderer/electron_renderer_client.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/renderer/atom_renderer_client.h" +#include "shell/renderer/electron_renderer_client.h" #include #include @@ -18,7 +18,7 @@ #include "shell/common/node_includes.h" #include "shell/common/node_util.h" #include "shell/common/options_switches.h" -#include "shell/renderer/atom_render_frame_observer.h" +#include "shell/renderer/electron_render_frame_observer.h" #include "shell/renderer/web_worker_observer.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_local_frame.h" @@ -34,22 +34,22 @@ bool IsDevToolsExtension(content::RenderFrame* render_frame) { } // namespace -AtomRendererClient::AtomRendererClient() +ElectronRendererClient::ElectronRendererClient() : node_bindings_( NodeBindings::Create(NodeBindings::BrowserEnvironment::RENDERER)), electron_bindings_(new ElectronBindings(uv_default_loop())) {} -AtomRendererClient::~AtomRendererClient() { +ElectronRendererClient::~ElectronRendererClient() { asar::ClearArchives(); } -void AtomRendererClient::RenderFrameCreated( +void ElectronRendererClient::RenderFrameCreated( content::RenderFrame* render_frame) { - new AtomRenderFrameObserver(render_frame, this); + new ElectronRenderFrameObserver(render_frame, this); RendererClientBase::RenderFrameCreated(render_frame); } -void AtomRendererClient::RunScriptsAtDocumentStart( +void ElectronRendererClient::RunScriptsAtDocumentStart( content::RenderFrame* render_frame) { RendererClientBase::RunScriptsAtDocumentStart(render_frame); // Inform the document start pharse. @@ -60,7 +60,7 @@ void AtomRendererClient::RunScriptsAtDocumentStart( "document-start"); } -void AtomRendererClient::RunScriptsAtDocumentEnd( +void ElectronRendererClient::RunScriptsAtDocumentEnd( content::RenderFrame* render_frame) { RendererClientBase::RunScriptsAtDocumentEnd(render_frame); // Inform the document end pharse. @@ -71,7 +71,7 @@ void AtomRendererClient::RunScriptsAtDocumentEnd( "document-end"); } -void AtomRendererClient::DidCreateScriptContext( +void ElectronRendererClient::DidCreateScriptContext( v8::Handle renderer_context, content::RenderFrame* render_frame) { RendererClientBase::DidCreateScriptContext(renderer_context, render_frame); @@ -153,7 +153,7 @@ void AtomRendererClient::DidCreateScriptContext( } } -void AtomRendererClient::WillReleaseScriptContext( +void ElectronRendererClient::WillReleaseScriptContext( v8::Handle context, content::RenderFrame* render_frame) { if (injected_frames_.erase(render_frame) == 0) @@ -187,11 +187,11 @@ void AtomRendererClient::WillReleaseScriptContext( electron_bindings_->EnvironmentDestroyed(env); } -bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame, - const GURL& url, - const std::string& http_method, - bool is_initial_navigation, - bool is_server_redirect) { +bool ElectronRendererClient::ShouldFork(blink::WebLocalFrame* frame, + const GURL& url, + const std::string& http_method, + bool is_initial_navigation, + bool is_server_redirect) { // Handle all the navigations and reloads in browser. // FIXME We only support GET here because http method will be ignored when // the OpenURLFromTab is triggered, which means form posting would not work, @@ -199,7 +199,7 @@ bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame, return http_method == "GET"; } -void AtomRendererClient::DidInitializeWorkerContextOnWorkerThread( +void ElectronRendererClient::DidInitializeWorkerContextOnWorkerThread( v8::Local context) { if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNodeIntegrationInWorker)) { @@ -207,7 +207,7 @@ void AtomRendererClient::DidInitializeWorkerContextOnWorkerThread( } } -void AtomRendererClient::WillDestroyWorkerContextOnWorkerThread( +void ElectronRendererClient::WillDestroyWorkerContextOnWorkerThread( v8::Local context) { if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNodeIntegrationInWorker)) { @@ -215,7 +215,7 @@ void AtomRendererClient::WillDestroyWorkerContextOnWorkerThread( } } -void AtomRendererClient::SetupMainWorldOverrides( +void ElectronRendererClient::SetupMainWorldOverrides( v8::Handle context, content::RenderFrame* render_frame) { // Setup window overrides in the main world context @@ -237,7 +237,7 @@ void AtomRendererClient::SetupMainWorldOverrides( &isolated_bundle_params, &isolated_bundle_args, nullptr); } -void AtomRendererClient::SetupExtensionWorldOverrides( +void ElectronRendererClient::SetupExtensionWorldOverrides( v8::Handle context, content::RenderFrame* render_frame, int world_id) { @@ -265,7 +265,7 @@ void AtomRendererClient::SetupExtensionWorldOverrides( #endif } -node::Environment* AtomRendererClient::GetEnvironment( +node::Environment* ElectronRendererClient::GetEnvironment( content::RenderFrame* render_frame) const { if (injected_frames_.find(render_frame) == injected_frames_.end()) return nullptr; diff --git a/shell/renderer/atom_renderer_client.h b/shell/renderer/electron_renderer_client.h similarity index 88% rename from shell/renderer/atom_renderer_client.h rename to shell/renderer/electron_renderer_client.h index c23710bd3ab..00acca0e445 100644 --- a/shell/renderer/atom_renderer_client.h +++ b/shell/renderer/electron_renderer_client.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_RENDERER_ATOM_RENDERER_CLIENT_H_ -#define SHELL_RENDERER_ATOM_RENDERER_CLIENT_H_ +#ifndef SHELL_RENDERER_ELECTRON_RENDERER_CLIENT_H_ +#define SHELL_RENDERER_ELECTRON_RENDERER_CLIENT_H_ #include #include @@ -21,10 +21,10 @@ namespace electron { class ElectronBindings; class NodeBindings; -class AtomRendererClient : public RendererClientBase { +class ElectronRendererClient : public RendererClientBase { public: - AtomRendererClient(); - ~AtomRendererClient() override; + ElectronRendererClient(); + ~ElectronRendererClient() override; // electron::RendererClientBase: void DidCreateScriptContext(v8::Handle context, @@ -70,9 +70,9 @@ class AtomRendererClient : public RendererClientBase { // assertion, so we have to keep a book of injected web frames. std::set injected_frames_; - DISALLOW_COPY_AND_ASSIGN(AtomRendererClient); + DISALLOW_COPY_AND_ASSIGN(ElectronRendererClient); }; } // namespace electron -#endif // SHELL_RENDERER_ATOM_RENDERER_CLIENT_H_ +#endif // SHELL_RENDERER_ELECTRON_RENDERER_CLIENT_H_ diff --git a/shell/renderer/atom_sandboxed_renderer_client.cc b/shell/renderer/electron_sandboxed_renderer_client.cc similarity index 91% rename from shell/renderer/atom_sandboxed_renderer_client.cc rename to shell/renderer/electron_sandboxed_renderer_client.cc index a781b171033..2c1c9ef64b6 100644 --- a/shell/renderer/atom_sandboxed_renderer_client.cc +++ b/shell/renderer/electron_sandboxed_renderer_client.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/renderer/atom_sandboxed_renderer_client.h" +#include "shell/renderer/electron_sandboxed_renderer_client.h" #include "base/base_paths.h" #include "base/command_line.h" @@ -18,7 +18,7 @@ #include "shell/common/node_includes.h" #include "shell/common/node_util.h" #include "shell/common/options_switches.h" -#include "shell/renderer/atom_render_frame_observer.h" +#include "shell/renderer/electron_render_frame_observer.h" #include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/electron_node/src/node_binding.h" @@ -114,15 +114,15 @@ void InvokeHiddenCallback(v8::Handle context, } // namespace -AtomSandboxedRendererClient::AtomSandboxedRendererClient() { +ElectronSandboxedRendererClient::ElectronSandboxedRendererClient() { // Explicitly register electron's builtin modules. NodeBindings::RegisterBuiltinModules(); metrics_ = base::ProcessMetrics::CreateCurrentProcessMetrics(); } -AtomSandboxedRendererClient::~AtomSandboxedRendererClient() = default; +ElectronSandboxedRendererClient::~ElectronSandboxedRendererClient() = default; -void AtomSandboxedRendererClient::InitializeBindings( +void ElectronSandboxedRendererClient::InitializeBindings( v8::Local binding, v8::Local context, bool is_main_frame) { @@ -143,18 +143,18 @@ void AtomSandboxedRendererClient::InitializeBindings( process.SetReadOnly("isMainFrame", is_main_frame); } -void AtomSandboxedRendererClient::RenderFrameCreated( +void ElectronSandboxedRendererClient::RenderFrameCreated( content::RenderFrame* render_frame) { - new AtomRenderFrameObserver(render_frame, this); + new ElectronRenderFrameObserver(render_frame, this); RendererClientBase::RenderFrameCreated(render_frame); } -void AtomSandboxedRendererClient::RenderViewCreated( +void ElectronSandboxedRendererClient::RenderViewCreated( content::RenderView* render_view) { RendererClientBase::RenderViewCreated(render_view); } -void AtomSandboxedRendererClient::RunScriptsAtDocumentStart( +void ElectronSandboxedRendererClient::RunScriptsAtDocumentStart( content::RenderFrame* render_frame) { RendererClientBase::RunScriptsAtDocumentStart(render_frame); if (injected_frames_.find(render_frame) == injected_frames_.end()) @@ -170,7 +170,7 @@ void AtomSandboxedRendererClient::RunScriptsAtDocumentStart( InvokeHiddenCallback(context, kLifecycleKey, "onDocumentStart"); } -void AtomSandboxedRendererClient::RunScriptsAtDocumentEnd( +void ElectronSandboxedRendererClient::RunScriptsAtDocumentEnd( content::RenderFrame* render_frame) { RendererClientBase::RunScriptsAtDocumentEnd(render_frame); if (injected_frames_.find(render_frame) == injected_frames_.end()) @@ -186,7 +186,7 @@ void AtomSandboxedRendererClient::RunScriptsAtDocumentEnd( InvokeHiddenCallback(context, kLifecycleKey, "onDocumentEnd"); } -void AtomSandboxedRendererClient::DidCreateScriptContext( +void ElectronSandboxedRendererClient::DidCreateScriptContext( v8::Handle context, content::RenderFrame* render_frame) { RendererClientBase::DidCreateScriptContext(context, render_frame); @@ -229,7 +229,7 @@ void AtomSandboxedRendererClient::DidCreateScriptContext( InvokeHiddenCallback(context, kLifecycleKey, "onLoaded"); } -void AtomSandboxedRendererClient::SetupMainWorldOverrides( +void ElectronSandboxedRendererClient::SetupMainWorldOverrides( v8::Handle context, content::RenderFrame* render_frame) { // Setup window overrides in the main world context @@ -252,7 +252,7 @@ void AtomSandboxedRendererClient::SetupMainWorldOverrides( &isolated_bundle_params, &isolated_bundle_args, nullptr); } -void AtomSandboxedRendererClient::SetupExtensionWorldOverrides( +void ElectronSandboxedRendererClient::SetupExtensionWorldOverrides( v8::Handle context, content::RenderFrame* render_frame, int world_id) { @@ -279,7 +279,7 @@ void AtomSandboxedRendererClient::SetupExtensionWorldOverrides( #endif } -void AtomSandboxedRendererClient::WillReleaseScriptContext( +void ElectronSandboxedRendererClient::WillReleaseScriptContext( v8::Handle context, content::RenderFrame* render_frame) { if (injected_frames_.erase(render_frame) == 0) diff --git a/shell/renderer/atom_sandboxed_renderer_client.h b/shell/renderer/electron_sandboxed_renderer_client.h similarity index 82% rename from shell/renderer/atom_sandboxed_renderer_client.h rename to shell/renderer/electron_sandboxed_renderer_client.h index 4a84ae51214..a23c4ba76d8 100644 --- a/shell/renderer/atom_sandboxed_renderer_client.h +++ b/shell/renderer/electron_sandboxed_renderer_client.h @@ -1,8 +1,8 @@ // Copyright (c) 2016 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_RENDERER_ATOM_SANDBOXED_RENDERER_CLIENT_H_ -#define SHELL_RENDERER_ATOM_SANDBOXED_RENDERER_CLIENT_H_ +#ifndef SHELL_RENDERER_ELECTRON_SANDBOXED_RENDERER_CLIENT_H_ +#define SHELL_RENDERER_ELECTRON_SANDBOXED_RENDERER_CLIENT_H_ #include #include @@ -14,10 +14,10 @@ namespace electron { -class AtomSandboxedRendererClient : public RendererClientBase { +class ElectronSandboxedRendererClient : public RendererClientBase { public: - AtomSandboxedRendererClient(); - ~AtomSandboxedRendererClient() override; + ElectronSandboxedRendererClient(); + ~ElectronSandboxedRendererClient() override; void InitializeBindings(v8::Local binding, v8::Local context, @@ -46,9 +46,9 @@ class AtomSandboxedRendererClient : public RendererClientBase { // assertion, so we have to keep a book of injected web frames. std::set injected_frames_; - DISALLOW_COPY_AND_ASSIGN(AtomSandboxedRendererClient); + DISALLOW_COPY_AND_ASSIGN(ElectronSandboxedRendererClient); }; } // namespace electron -#endif // SHELL_RENDERER_ATOM_SANDBOXED_RENDERER_CLIENT_H_ +#endif // SHELL_RENDERER_ELECTRON_SANDBOXED_RENDERER_CLIENT_H_ diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index 907f8d0067a..383e73ef421 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -24,11 +24,11 @@ #include "shell/common/color_util.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/options_switches.h" -#include "shell/renderer/atom_autofill_agent.h" -#include "shell/renderer/atom_render_frame_observer.h" #include "shell/renderer/browser_exposed_renderer_interfaces.h" #include "shell/renderer/content_settings_observer.h" #include "shell/renderer/electron_api_service_impl.h" +#include "shell/renderer/electron_autofill_agent.h" +#include "shell/renderer/electron_render_frame_observer.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/web_custom_element.h" // NOLINT(build/include_alpha) @@ -53,7 +53,7 @@ #endif #if BUILDFLAG(ENABLE_PDF_VIEWER) -#include "shell/common/atom_constants.h" +#include "shell/common/electron_constants.h" #endif // BUILDFLAG(ENABLE_PDF_VIEWER) #if BUILDFLAG(ENABLE_PLUGINS) diff --git a/shell/utility/atom_content_utility_client.cc b/shell/utility/electron_content_utility_client.cc similarity index 87% rename from shell/utility/atom_content_utility_client.cc rename to shell/utility/electron_content_utility_client.cc index 3ba74128a93..20e3efac9a6 100644 --- a/shell/utility/atom_content_utility_client.cc +++ b/shell/utility/electron_content_utility_client.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/utility/atom_content_utility_client.h" +#include "shell/utility/electron_content_utility_client.h" #include @@ -58,19 +58,19 @@ auto RunProxyResolver( } // namespace -AtomContentUtilityClient::AtomContentUtilityClient() +ElectronContentUtilityClient::ElectronContentUtilityClient() : utility_process_running_elevated_(false) { #if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) printing_handler_ = std::make_unique(); #endif } -AtomContentUtilityClient::~AtomContentUtilityClient() = default; +ElectronContentUtilityClient::~ElectronContentUtilityClient() = default; // The guts of this came from the chromium implementation // https://cs.chromium.org/chromium/src/chrome/utility/ // chrome_content_utility_client.cc?sq=package:chromium&dr=CSs&g=0&l=142 -void AtomContentUtilityClient::ExposeInterfacesToBrowser( +void ElectronContentUtilityClient::ExposeInterfacesToBrowser( mojo::BinderMap* binders) { #if defined(OS_WIN) base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -89,7 +89,8 @@ void AtomContentUtilityClient::ExposeInterfacesToBrowser( #endif } -bool AtomContentUtilityClient::OnMessageReceived(const IPC::Message& message) { +bool ElectronContentUtilityClient::OnMessageReceived( + const IPC::Message& message) { if (utility_process_running_elevated_) return false; @@ -101,7 +102,8 @@ bool AtomContentUtilityClient::OnMessageReceived(const IPC::Message& message) { return false; } -mojo::ServiceFactory* AtomContentUtilityClient::GetMainThreadServiceFactory() { +mojo::ServiceFactory* +ElectronContentUtilityClient::GetMainThreadServiceFactory() { static base::NoDestructor factory { #if BUILDFLAG(ENABLE_PRINTING) RunPrintCompositor, @@ -113,7 +115,8 @@ mojo::ServiceFactory* AtomContentUtilityClient::GetMainThreadServiceFactory() { return factory.get(); } -mojo::ServiceFactory* AtomContentUtilityClient::GetIOThreadServiceFactory() { +mojo::ServiceFactory* +ElectronContentUtilityClient::GetIOThreadServiceFactory() { static base::NoDestructor factory{RunProxyResolver}; return factory.get(); } diff --git a/shell/utility/atom_content_utility_client.h b/shell/utility/electron_content_utility_client.h similarity index 73% rename from shell/utility/atom_content_utility_client.h rename to shell/utility/electron_content_utility_client.h index 71fdab08793..867a924bb91 100644 --- a/shell/utility/atom_content_utility_client.h +++ b/shell/utility/electron_content_utility_client.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ -#define SHELL_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ +#ifndef SHELL_UTILITY_ELECTRON_CONTENT_UTILITY_CLIENT_H_ +#define SHELL_UTILITY_ELECTRON_CONTENT_UTILITY_CLIENT_H_ #include #include @@ -20,10 +20,10 @@ namespace electron { -class AtomContentUtilityClient : public content::ContentUtilityClient { +class ElectronContentUtilityClient : public content::ContentUtilityClient { public: - AtomContentUtilityClient(); - ~AtomContentUtilityClient() override; + ElectronContentUtilityClient(); + ~ElectronContentUtilityClient() override; void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override; bool OnMessageReceived(const IPC::Message& message) override; @@ -38,9 +38,9 @@ class AtomContentUtilityClient : public content::ContentUtilityClient { // True if the utility process runs with elevated privileges. bool utility_process_running_elevated_; - DISALLOW_COPY_AND_ASSIGN(AtomContentUtilityClient); + DISALLOW_COPY_AND_ASSIGN(ElectronContentUtilityClient); }; } // namespace electron -#endif // SHELL_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ +#endif // SHELL_UTILITY_ELECTRON_CONTENT_UTILITY_CLIENT_H_