Files
electron/shell/browser/electron_autofill_driver_factory.h
Samuel Attard 3e1666be08 chore: remove dead C++ code from shell/ (#50513)
Removes unreferenced code found via codebase sweep. Each category below may
indicate a missing feature rather than truly-unused code — see PR description.

Dead class (1):
  ElectronNavigationUIData — never instantiated; ElectronBrowserClient uses
  upstream ExtensionNavigationUIData directly

Unused methods (7):
  CertificateManagerModel: ImportUserCert, ImportCACerts, ImportServerCert,
    Delete, is_user_db_available (only PKCS12 path is used)
  AutofillDriverFactory::AddDriverForFrame + CreationCallback type
  ZoomLevelDelegate::SetDefaultZoomLevelPref
  gtk_util: GetOpenLabel, GetSaveLabel

Unused members (2):
  AutofillPopup::selected_index_
  InspectableWebContents::synced_setting_names_

Declaration fixes (6):
  menu_util.h: BuildMenuItemWithImage signature corrected (GtkWidget* → gfx::Image&)
  win_frame_view.h: GetReadableFeatureColor (impl removed, decl left behind)
  frameless_view.h: friend class NativeWindowsViews (typo, class does not exist)
  Forward decls: WebDialogHelper, ChromeContentRendererClient,
    ElectronNativeWindowObserver, ValueStoreFactory
2026-03-30 10:36:00 -07:00

54 lines
1.7 KiB
C++

// Copyright (c) 2019 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_FACTORY_H_
#define ELECTRON_SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_FACTORY_H_
#include <memory>
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
#include "shell/common/api/api.mojom.h"
#include "third_party/abseil-cpp/absl/container/flat_hash_map.h"
namespace electron {
class AutofillDriver;
class AutofillDriverFactory
: private content::WebContentsObserver,
public content::WebContentsUserData<AutofillDriverFactory> {
public:
~AutofillDriverFactory() override;
static void BindAutofillDriver(
mojo::PendingAssociatedReceiver<mojom::ElectronAutofillDriver>
pending_receiver,
content::RenderFrameHost* render_frame_host);
AutofillDriver* DriverForFrame(content::RenderFrameHost* render_frame_host);
void DeleteDriverForFrame(content::RenderFrameHost* render_frame_host);
void CloseAllPopups();
WEB_CONTENTS_USER_DATA_KEY_DECL();
private:
// content::WebContentsObserver:
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
explicit AutofillDriverFactory(content::WebContents* web_contents);
friend class content::WebContentsUserData<AutofillDriverFactory>;
absl::flat_hash_map<content::RenderFrameHost*,
std::unique_ptr<AutofillDriver>>
driver_map_;
};
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_FACTORY_H_