refactor: replace deprecated DISALLOW_COPY_AND_ASSIGN (#31633)
This commit is contained in:
parent
2a2a1a834c
commit
65a980c673
231 changed files with 918 additions and 576 deletions
|
@ -42,6 +42,10 @@ class AutofillPopupChildView : public views::View {
|
|||
SetFocusBehavior(FocusBehavior::ALWAYS);
|
||||
}
|
||||
|
||||
// disable copy
|
||||
AutofillPopupChildView(const AutofillPopupChildView&) = delete;
|
||||
AutofillPopupChildView& operator=(const AutofillPopupChildView&) = delete;
|
||||
|
||||
private:
|
||||
~AutofillPopupChildView() override {}
|
||||
|
||||
|
@ -49,8 +53,6 @@ class AutofillPopupChildView : public views::View {
|
|||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
||||
|
||||
std::u16string suggestion_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AutofillPopupChildView);
|
||||
};
|
||||
|
||||
class AutofillPopupView : public views::WidgetDelegateView,
|
||||
|
|
|
@ -19,6 +19,10 @@ class ViewsDelegate : public views::ViewsDelegate {
|
|||
ViewsDelegate();
|
||||
~ViewsDelegate() override;
|
||||
|
||||
// disable copy
|
||||
ViewsDelegate(const ViewsDelegate&) = delete;
|
||||
ViewsDelegate& operator=(const ViewsDelegate&) = delete;
|
||||
|
||||
protected:
|
||||
// views::ViewsDelegate:
|
||||
void SaveWindowPlacement(const views::Widget* window,
|
||||
|
@ -71,8 +75,6 @@ class ViewsDelegate : public views::ViewsDelegate {
|
|||
|
||||
base::WeakPtrFactory<ViewsDelegate> weak_factory_{this};
|
||||
#endif
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ViewsDelegate);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -21,6 +21,10 @@ class FramelessView : public views::NonClientFrameView {
|
|||
FramelessView();
|
||||
~FramelessView() override;
|
||||
|
||||
// disable copy
|
||||
FramelessView(const FramelessView&) = delete;
|
||||
FramelessView& operator=(const FramelessView&) = delete;
|
||||
|
||||
virtual void Init(NativeWindowViews* window, views::Widget* frame);
|
||||
|
||||
// Returns whether the |point| is on frameless window's resizing border.
|
||||
|
@ -49,9 +53,6 @@ class FramelessView : public views::NonClientFrameView {
|
|||
views::Widget* frame_ = nullptr;
|
||||
|
||||
friend class NativeWindowsViews;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(FramelessView);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -33,6 +33,11 @@ class GlobalMenuBarRegistrarX11 {
|
|||
GlobalMenuBarRegistrarX11();
|
||||
~GlobalMenuBarRegistrarX11();
|
||||
|
||||
// disable copy
|
||||
GlobalMenuBarRegistrarX11(const GlobalMenuBarRegistrarX11&) = delete;
|
||||
GlobalMenuBarRegistrarX11& operator=(const GlobalMenuBarRegistrarX11&) =
|
||||
delete;
|
||||
|
||||
// Sends the actual message.
|
||||
void RegisterXWindow(x11::Window window);
|
||||
void UnregisterXWindow(x11::Window window);
|
||||
|
@ -53,8 +58,6 @@ class GlobalMenuBarRegistrarX11 {
|
|||
// x11::Window which want to be registered, but haven't yet been because
|
||||
// we're waiting for the proxy to become available.
|
||||
std::set<x11::Window> live_windows_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarRegistrarX11);
|
||||
};
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_GLOBAL_MENU_BAR_REGISTRAR_X11_H_
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
#include "shell/browser/ui/electron_menu_model.h"
|
||||
#include "ui/base/glib/glib_signal.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
|
@ -41,6 +40,10 @@ class GlobalMenuBarX11 {
|
|||
explicit GlobalMenuBarX11(NativeWindowViews* window);
|
||||
virtual ~GlobalMenuBarX11();
|
||||
|
||||
// disable copy
|
||||
GlobalMenuBarX11(const GlobalMenuBarX11&) = delete;
|
||||
GlobalMenuBarX11& operator=(const GlobalMenuBarX11&) = delete;
|
||||
|
||||
// Creates the object path for DbusmenuServer which is attached to |window|.
|
||||
static std::string GetPathForWindow(x11::Window window);
|
||||
|
||||
|
@ -73,8 +76,6 @@ class GlobalMenuBarX11 {
|
|||
x11::Window xwindow_;
|
||||
|
||||
DbusmenuServer* server_ = nullptr;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -41,6 +41,10 @@ class DevToolsWindowDelegate : public views::ClientView,
|
|||
}
|
||||
~DevToolsWindowDelegate() override = default;
|
||||
|
||||
// disable copy
|
||||
DevToolsWindowDelegate(const DevToolsWindowDelegate&) = delete;
|
||||
DevToolsWindowDelegate& operator=(const DevToolsWindowDelegate&) = delete;
|
||||
|
||||
// views::WidgetDelegate:
|
||||
views::View* GetInitiallyFocusedView() override { return view_; }
|
||||
std::u16string GetWindowTitle() const override { return shell_->GetTitle(); }
|
||||
|
@ -64,8 +68,6 @@ class DevToolsWindowDelegate : public views::ClientView,
|
|||
views::View* view_;
|
||||
views::Widget* widget_;
|
||||
ui::ImageModel icon_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DevToolsWindowDelegate);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -63,8 +63,6 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView,
|
|||
bool devtools_visible_ = false;
|
||||
views::WidgetDelegate* devtools_window_delegate_ = nullptr;
|
||||
std::u16string title_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewViews);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -26,6 +26,10 @@ class MenuBar : public views::AccessiblePaneView,
|
|||
MenuBar(NativeWindow* window, RootView* root_view);
|
||||
~MenuBar() override;
|
||||
|
||||
// disable copy
|
||||
MenuBar(const MenuBar&) = delete;
|
||||
MenuBar& operator=(const MenuBar&) = delete;
|
||||
|
||||
// Replaces current menu with a new one.
|
||||
void SetMenu(ElectronMenuModel* menu_model);
|
||||
|
||||
|
@ -84,8 +88,6 @@ class MenuBar : public views::AccessiblePaneView,
|
|||
RootView* root_view_;
|
||||
ElectronMenuModel* menu_model_ = nullptr;
|
||||
bool accelerator_installed_ = false;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MenuBar);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -25,6 +25,10 @@ class MenuDelegate : public views::MenuDelegate {
|
|||
explicit MenuDelegate(MenuBar* menu_bar);
|
||||
~MenuDelegate() override;
|
||||
|
||||
// disable copy
|
||||
MenuDelegate(const MenuDelegate&) = delete;
|
||||
MenuDelegate& operator=(const MenuDelegate&) = delete;
|
||||
|
||||
void RunMenu(ElectronMenuModel* model,
|
||||
views::Button* button,
|
||||
ui::MenuSourceType source_type);
|
||||
|
@ -72,8 +76,6 @@ class MenuDelegate : public views::MenuDelegate {
|
|||
bool hold_first_switch_ = false;
|
||||
|
||||
base::ObserverList<Observer>::Unchecked observers_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MenuDelegate);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -15,13 +15,15 @@ class MenuModelAdapter : public views::MenuModelAdapter {
|
|||
explicit MenuModelAdapter(ElectronMenuModel* menu_model);
|
||||
~MenuModelAdapter() override;
|
||||
|
||||
// disable copy
|
||||
MenuModelAdapter(const MenuModelAdapter&) = delete;
|
||||
MenuModelAdapter& operator=(const MenuModelAdapter&) = delete;
|
||||
|
||||
protected:
|
||||
bool GetAccelerator(int id, ui::Accelerator* accelerator) const override;
|
||||
|
||||
private:
|
||||
ElectronMenuModel* menu_model_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -18,6 +18,10 @@ class NativeFrameView : public views::NativeFrameView {
|
|||
static const char kViewClassName[];
|
||||
NativeFrameView(NativeWindow* window, views::Widget* widget);
|
||||
|
||||
// disable copy
|
||||
NativeFrameView(const NativeFrameView&) = delete;
|
||||
NativeFrameView& operator=(const NativeFrameView&) = delete;
|
||||
|
||||
protected:
|
||||
// views::View:
|
||||
gfx::Size GetMinimumSize() const override;
|
||||
|
@ -26,8 +30,6 @@ class NativeFrameView : public views::NativeFrameView {
|
|||
|
||||
private:
|
||||
NativeWindow* window_; // weak ref.
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NativeFrameView);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -27,6 +27,10 @@ class RootView : public views::View {
|
|||
explicit RootView(NativeWindow* window);
|
||||
~RootView() override;
|
||||
|
||||
// disable copy
|
||||
RootView(const RootView&) = delete;
|
||||
RootView& operator=(const RootView&) = delete;
|
||||
|
||||
void SetMenu(ElectronMenuModel* menu_model);
|
||||
bool HasMenu() const;
|
||||
int GetMenuBarHeight() const;
|
||||
|
@ -61,8 +65,6 @@ class RootView : public views::View {
|
|||
accelerator_util::AcceleratorTable accelerator_table_;
|
||||
|
||||
std::unique_ptr<views::ViewTracker> last_focused_view_tracker_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(RootView);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -21,6 +21,10 @@ class SubmenuButton : public views::MenuButton {
|
|||
const SkColor& background_color);
|
||||
~SubmenuButton() override;
|
||||
|
||||
// disable copy
|
||||
SubmenuButton(const SubmenuButton&) = delete;
|
||||
SubmenuButton& operator=(const SubmenuButton&) = delete;
|
||||
|
||||
void SetAcceleratorVisibility(bool visible);
|
||||
void SetUnderlineColor(SkColor color);
|
||||
|
||||
|
@ -50,8 +54,6 @@ class SubmenuButton : public views::MenuButton {
|
|||
int text_height_ = 0;
|
||||
SkColor underline_color_ = SK_ColorBLACK;
|
||||
SkColor background_color_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(SubmenuButton);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -81,8 +81,6 @@ class WinFrameView : public FramelessView {
|
|||
// May be null if the caption button container is destroyed before the frame
|
||||
// view. Always check for validity before using!
|
||||
WinCaptionButtonContainer* caption_button_container_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WinFrameView);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue