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
|
@ -9,7 +9,6 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/nix/xdg_util.h"
|
||||
#include "ui/base/glib/glib_signal.h"
|
||||
|
@ -44,6 +43,10 @@ class AppIndicatorIcon : public views::StatusIconLinux {
|
|||
const std::u16string& tool_tip);
|
||||
~AppIndicatorIcon() override;
|
||||
|
||||
// disable copy
|
||||
AppIndicatorIcon(const AppIndicatorIcon&) = delete;
|
||||
AppIndicatorIcon& operator=(const AppIndicatorIcon&) = delete;
|
||||
|
||||
// Indicates whether libappindicator so could be opened.
|
||||
static bool CouldOpen();
|
||||
|
||||
|
@ -105,8 +108,6 @@ class AppIndicatorIcon : public views::StatusIconLinux {
|
|||
int icon_change_count_ = 0;
|
||||
|
||||
base::WeakPtrFactory<AppIndicatorIcon> weak_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AppIndicatorIcon);
|
||||
};
|
||||
|
||||
} // namespace gtkui
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#define SHELL_BROWSER_UI_GTK_APP_INDICATOR_ICON_MENU_H_
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/macros.h"
|
||||
#include "ui/base/glib/glib_signal.h"
|
||||
|
||||
typedef struct _GtkMenu GtkMenu;
|
||||
|
@ -26,6 +25,10 @@ class AppIndicatorIconMenu {
|
|||
explicit AppIndicatorIconMenu(ui::MenuModel* model);
|
||||
virtual ~AppIndicatorIconMenu();
|
||||
|
||||
// disable copy
|
||||
AppIndicatorIconMenu(const AppIndicatorIconMenu&) = delete;
|
||||
AppIndicatorIconMenu& operator=(const AppIndicatorIconMenu&) = delete;
|
||||
|
||||
// Sets a menu item at the top of |gtk_menu_| as a replacement for the app
|
||||
// indicator icon's click action. |callback| is called when the menu item
|
||||
// is activated.
|
||||
|
@ -65,8 +68,6 @@ class AppIndicatorIconMenu {
|
|||
GtkWidget* gtk_menu_ = nullptr;
|
||||
|
||||
bool block_activation_ = false;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AppIndicatorIconMenu);
|
||||
};
|
||||
|
||||
} // namespace gtkui
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "ui/base/glib/glib_integers.h"
|
||||
#include "ui/base/glib/glib_signal.h"
|
||||
#include "ui/views/linux_ui/status_icon_linux.h"
|
||||
|
@ -34,6 +33,10 @@ class GtkStatusIcon : public views::StatusIconLinux {
|
|||
GtkStatusIcon(const gfx::ImageSkia& image, const std::u16string& tool_tip);
|
||||
~GtkStatusIcon() override;
|
||||
|
||||
// disable copy
|
||||
GtkStatusIcon(const GtkStatusIcon&) = delete;
|
||||
GtkStatusIcon& operator=(const GtkStatusIcon&) = delete;
|
||||
|
||||
// Overridden from views::StatusIconLinux:
|
||||
void SetIcon(const gfx::ImageSkia& image) override;
|
||||
void SetToolTip(const std::u16string& tool_tip) override;
|
||||
|
@ -53,8 +56,6 @@ class GtkStatusIcon : public views::StatusIconLinux {
|
|||
::GtkStatusIcon* gtk_status_icon_;
|
||||
|
||||
std::unique_ptr<AppIndicatorIconMenu> menu_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(GtkStatusIcon);
|
||||
};
|
||||
|
||||
} // namespace gtkui
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue