Commit bcd20a2a authored by Jongmok Kim's avatar Jongmok Kim Committed by Commit Bot

[tabs] Inline DISALLOW_COPY_AND_ASSIGN in c/b/u/tabs

Uses explicit deletion instead, removes use of base/macros.h.

Bug: 1010217
Change-Id: Id7efbf60060e975843f53dc363763f369195f488
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2326515
Commit-Queue: Connie Wan <connily@chromium.org>
Reviewed-by: default avatarConnie Wan <connily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794580}
parent adf21fee
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <stddef.h> #include <stddef.h>
#include "base/macros.h"
#include "chrome/browser/ui/tabs/existing_base_sub_menu_model.h" #include "chrome/browser/ui/tabs/existing_base_sub_menu_model.h"
class TabStripModel; class TabStripModel;
...@@ -21,6 +20,9 @@ class ExistingTabGroupSubMenuModel : public ExistingBaseSubMenuModel { ...@@ -21,6 +20,9 @@ class ExistingTabGroupSubMenuModel : public ExistingBaseSubMenuModel {
ExistingTabGroupSubMenuModel(ui::SimpleMenuModel::Delegate* parent_delegate, ExistingTabGroupSubMenuModel(ui::SimpleMenuModel::Delegate* parent_delegate,
TabStripModel* model, TabStripModel* model,
int context_index); int context_index);
ExistingTabGroupSubMenuModel(const ExistingTabGroupSubMenuModel&) = delete;
ExistingTabGroupSubMenuModel& operator=(const ExistingTabGroupSubMenuModel&) =
delete;
~ExistingTabGroupSubMenuModel() override = default; ~ExistingTabGroupSubMenuModel() override = default;
// Whether the submenu should be shown in the provided context. True iff // Whether the submenu should be shown in the provided context. True iff
...@@ -44,8 +46,6 @@ class ExistingTabGroupSubMenuModel : public ExistingBaseSubMenuModel { ...@@ -44,8 +46,6 @@ class ExistingTabGroupSubMenuModel : public ExistingBaseSubMenuModel {
static bool ShouldShowGroup(TabStripModel* model, static bool ShouldShowGroup(TabStripModel* model,
int context_index, int context_index,
tab_groups::TabGroupId group); tab_groups::TabGroupId group);
DISALLOW_COPY_AND_ASSIGN(ExistingTabGroupSubMenuModel);
}; };
#endif // CHROME_BROWSER_UI_TABS_EXISTING_TAB_GROUP_SUB_MENU_MODEL_H_ #endif // CHROME_BROWSER_UI_TABS_EXISTING_TAB_GROUP_SUB_MENU_MODEL_H_
...@@ -18,6 +18,9 @@ class ExistingWindowSubMenuModel : public ExistingBaseSubMenuModel { ...@@ -18,6 +18,9 @@ class ExistingWindowSubMenuModel : public ExistingBaseSubMenuModel {
ExistingWindowSubMenuModel(ui::SimpleMenuModel::Delegate* parent_delegate, ExistingWindowSubMenuModel(ui::SimpleMenuModel::Delegate* parent_delegate,
TabStripModel* model, TabStripModel* model,
int context_index); int context_index);
ExistingWindowSubMenuModel(const ExistingWindowSubMenuModel&) = delete;
ExistingWindowSubMenuModel& operator=(const ExistingWindowSubMenuModel&) =
delete;
~ExistingWindowSubMenuModel() override; ~ExistingWindowSubMenuModel() override;
// ui::SimpleMenuModel // ui::SimpleMenuModel
...@@ -37,8 +40,6 @@ class ExistingWindowSubMenuModel : public ExistingBaseSubMenuModel { ...@@ -37,8 +40,6 @@ class ExistingWindowSubMenuModel : public ExistingBaseSubMenuModel {
// ExistingBaseSubMenuModel // ExistingBaseSubMenuModel
void ExecuteNewCommand(int event_flags) override; void ExecuteNewCommand(int event_flags) override;
void ExecuteExistingCommand(int command_index) override; void ExecuteExistingCommand(int command_index) override;
DISALLOW_COPY_AND_ASSIGN(ExistingWindowSubMenuModel);
}; };
#endif // CHROME_BROWSER_UI_TABS_EXISTING_WINDOW_SUB_MENU_MODEL_H_ #endif // CHROME_BROWSER_UI_TABS_EXISTING_WINDOW_SUB_MENU_MODEL_H_
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ #ifndef CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_
#define CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ #define CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_
#include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
class TabStripModel; class TabStripModel;
...@@ -15,6 +14,8 @@ class TabStripModel; ...@@ -15,6 +14,8 @@ class TabStripModel;
class HoverTabSelector { class HoverTabSelector {
public: public:
explicit HoverTabSelector(TabStripModel* tab_strip_model); explicit HoverTabSelector(TabStripModel* tab_strip_model);
HoverTabSelector(const HoverTabSelector&) = delete;
HoverTabSelector& operator=(const HoverTabSelector&) = delete;
~HoverTabSelector(); ~HoverTabSelector();
// Begin a delayed tab transition to the tab at |index|. Only starts // Begin a delayed tab transition to the tab at |index|. Only starts
...@@ -38,8 +39,6 @@ class HoverTabSelector { ...@@ -38,8 +39,6 @@ class HoverTabSelector {
// Factory for creating tab transition tasks. // Factory for creating tab transition tasks.
base::WeakPtrFactory<HoverTabSelector> weak_factory_{this}; base::WeakPtrFactory<HoverTabSelector> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(HoverTabSelector);
}; };
#endif // CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ #endif // CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_H_ #define CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_H_
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
#include "chrome/browser/ui/browser_list_observer.h" #include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
...@@ -26,6 +25,8 @@ class PinnedTabService : public content::NotificationObserver, ...@@ -26,6 +25,8 @@ class PinnedTabService : public content::NotificationObserver,
public KeyedService { public KeyedService {
public: public:
explicit PinnedTabService(Profile* profile); explicit PinnedTabService(Profile* profile);
PinnedTabService(const PinnedTabService&) = delete;
PinnedTabService& operator=(const PinnedTabService&) = delete;
~PinnedTabService() override; ~PinnedTabService() override;
private: private:
...@@ -57,8 +58,6 @@ class PinnedTabService : public content::NotificationObserver, ...@@ -57,8 +58,6 @@ class PinnedTabService : public content::NotificationObserver,
bool need_to_write_pinned_tabs_ = true; bool need_to_write_pinned_tabs_ = true;
content::NotificationRegistrar registrar_; content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(PinnedTabService);
}; };
#endif // CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_H_ #endif // CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_H_
...@@ -27,6 +27,8 @@ class BrowserRemovalWaiter : public BrowserListObserver { ...@@ -27,6 +27,8 @@ class BrowserRemovalWaiter : public BrowserListObserver {
explicit BrowserRemovalWaiter(const Browser* browser) : browser_(browser) { explicit BrowserRemovalWaiter(const Browser* browser) : browser_(browser) {
BrowserList::AddObserver(this); BrowserList::AddObserver(this);
} }
BrowserRemovalWaiter(const BrowserRemovalWaiter&) = delete;
BrowserRemovalWaiter& operator=(const BrowserRemovalWaiter&) = delete;
~BrowserRemovalWaiter() override = default; ~BrowserRemovalWaiter() override = default;
void WaitForRemoval() { void WaitForRemoval() {
...@@ -47,8 +49,6 @@ class BrowserRemovalWaiter : public BrowserListObserver { ...@@ -47,8 +49,6 @@ class BrowserRemovalWaiter : public BrowserListObserver {
const Browser* const browser_; const Browser* const browser_;
scoped_refptr<content::MessageLoopRunner> message_loop_runner_; scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
DISALLOW_COPY_AND_ASSIGN(BrowserRemovalWaiter);
}; };
using PinnedTabServiceBrowserTest = InProcessBrowserTest; using PinnedTabServiceBrowserTest = InProcessBrowserTest;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <vector> #include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "base/macros.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/tabs/pinned_tab_codec.h" #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
...@@ -36,6 +35,8 @@ PinnedTabService* BuildForProfile(Profile* profile) { ...@@ -36,6 +35,8 @@ PinnedTabService* BuildForProfile(Profile* profile) {
class PinnedTabServiceTest : public BrowserWithTestWindowTest { class PinnedTabServiceTest : public BrowserWithTestWindowTest {
public: public:
PinnedTabServiceTest() : pinned_tab_service_(nullptr) {} PinnedTabServiceTest() : pinned_tab_service_(nullptr) {}
PinnedTabServiceTest(const PinnedTabServiceTest&) = delete;
PinnedTabServiceTest& operator=(const PinnedTabServiceTest&) = delete;
protected: protected:
TestingProfile* CreateProfile() override { TestingProfile* CreateProfile() override {
...@@ -46,8 +47,6 @@ class PinnedTabServiceTest : public BrowserWithTestWindowTest { ...@@ -46,8 +47,6 @@ class PinnedTabServiceTest : public BrowserWithTestWindowTest {
private: private:
PinnedTabService* pinned_tab_service_; PinnedTabService* pinned_tab_service_;
DISALLOW_COPY_AND_ASSIGN(PinnedTabServiceTest);
}; };
// Makes sure closing a popup triggers writing pinned tabs. // Makes sure closing a popup triggers writing pinned tabs.
......
...@@ -18,12 +18,11 @@ class TabActivitySimulator::TestWebContentsObserver ...@@ -18,12 +18,11 @@ class TabActivitySimulator::TestWebContentsObserver
: public content::WebContentsObserver { : public content::WebContentsObserver {
public: public:
explicit TestWebContentsObserver(content::WebContents* web_contents); explicit TestWebContentsObserver(content::WebContents* web_contents);
TestWebContentsObserver(const TestWebContentsObserver&) = delete;
TestWebContentsObserver& operator=(const TestWebContentsObserver&) = delete;
// content::WebContentsObserver: // content::WebContentsObserver:
void WebContentsDestroyed() override; void WebContentsDestroyed() override;
private:
DISALLOW_COPY_AND_ASSIGN(TestWebContentsObserver);
}; };
TabActivitySimulator::TestWebContentsObserver::TestWebContentsObserver( TabActivitySimulator::TestWebContentsObserver::TestWebContentsObserver(
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/macros.h"
#include "ui/base/page_transition_types.h" #include "ui/base/page_transition_types.h"
class GURL; class GURL;
...@@ -26,6 +25,8 @@ class TabActivitySimulator { ...@@ -26,6 +25,8 @@ class TabActivitySimulator {
class TestWebContentsObserver; class TestWebContentsObserver;
TabActivitySimulator(); TabActivitySimulator();
TabActivitySimulator(const TabActivitySimulator&) = delete;
TabActivitySimulator& operator=(const TabActivitySimulator&) = delete;
~TabActivitySimulator(); ~TabActivitySimulator();
// Simulates a navigation to |url| using the given transition type. // Simulates a navigation to |url| using the given transition type.
...@@ -53,8 +54,6 @@ class TabActivitySimulator { ...@@ -53,8 +54,6 @@ class TabActivitySimulator {
private: private:
// Owns the observers we've created. // Owns the observers we've created.
std::vector<std::unique_ptr<TestWebContentsObserver>> observers_; std::vector<std::unique_ptr<TestWebContentsObserver>> observers_;
DISALLOW_COPY_AND_ASSIGN(TabActivitySimulator);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_ACTIVITY_SIMULATOR_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_ACTIVITY_SIMULATOR_H_
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_ #ifndef CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_
#define CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_ #define CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_
#include "base/macros.h"
#include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_sub_menu_model.h" #include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_sub_menu_model.h"
#include "ui/base/models/simple_menu_model.h" #include "ui/base/models/simple_menu_model.h"
...@@ -25,6 +24,8 @@ class TabMenuModel : public ui::SimpleMenuModel { ...@@ -25,6 +24,8 @@ class TabMenuModel : public ui::SimpleMenuModel {
TabMenuModel(ui::SimpleMenuModel::Delegate* delegate, TabMenuModel(ui::SimpleMenuModel::Delegate* delegate,
TabStripModel* tab_strip, TabStripModel* tab_strip,
int index); int index);
TabMenuModel(const TabMenuModel&) = delete;
TabMenuModel& operator=(const TabMenuModel&) = delete;
~TabMenuModel() override; ~TabMenuModel() override;
private: private:
...@@ -36,8 +37,6 @@ class TabMenuModel : public ui::SimpleMenuModel { ...@@ -36,8 +37,6 @@ class TabMenuModel : public ui::SimpleMenuModel {
// Send tab to self submenu. // Send tab to self submenu.
std::unique_ptr<send_tab_to_self::SendTabToSelfSubMenuModel> std::unique_ptr<send_tab_to_self::SendTabToSelfSubMenuModel>
send_tab_to_self_sub_menu_model_; send_tab_to_self_sub_menu_model_;
DISALLOW_COPY_AND_ASSIGN(TabMenuModel);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/auto_reset.h" #include "base/auto_reset.h"
#include "base/containers/flat_map.h" #include "base/containers/flat_map.h"
#include "base/macros.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/numerics/ranges.h" #include "base/numerics/ranges.h"
...@@ -123,6 +122,11 @@ class RenderWidgetHostVisibilityTracker ...@@ -123,6 +122,11 @@ class RenderWidgetHostVisibilityTracker
"TabSwitchVisibilityRequest", this); "TabSwitchVisibilityRequest", this);
} }
RenderWidgetHostVisibilityTracker(const RenderWidgetHostVisibilityTracker&) =
delete;
RenderWidgetHostVisibilityTracker& operator=(
const RenderWidgetHostVisibilityTracker&) = delete;
~RenderWidgetHostVisibilityTracker() override { ~RenderWidgetHostVisibilityTracker() override {
if (host_) if (host_)
host_->RemoveObserver(this); host_->RemoveObserver(this);
...@@ -150,8 +154,6 @@ class RenderWidgetHostVisibilityTracker ...@@ -150,8 +154,6 @@ class RenderWidgetHostVisibilityTracker
content::RenderWidgetHost* host_ = nullptr; content::RenderWidgetHost* host_ = nullptr;
base::ElapsedTimer timer_; base::ElapsedTimer timer_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostVisibilityTracker);
}; };
} // namespace } // namespace
...@@ -164,6 +166,8 @@ class RenderWidgetHostVisibilityTracker ...@@ -164,6 +166,8 @@ class RenderWidgetHostVisibilityTracker
class TabStripModel::WebContentsData : public content::WebContentsObserver { class TabStripModel::WebContentsData : public content::WebContentsObserver {
public: public:
explicit WebContentsData(std::unique_ptr<WebContents> a_contents); explicit WebContentsData(std::unique_ptr<WebContents> a_contents);
WebContentsData(const WebContentsData&) = delete;
WebContentsData& operator=(const WebContentsData&) = delete;
// Changes the WebContents that this WebContentsData tracks. // Changes the WebContents that this WebContentsData tracks.
std::unique_ptr<WebContents> ReplaceWebContents( std::unique_ptr<WebContents> ReplaceWebContents(
...@@ -225,8 +229,6 @@ class TabStripModel::WebContentsData : public content::WebContentsObserver { ...@@ -225,8 +229,6 @@ class TabStripModel::WebContentsData : public content::WebContentsObserver {
// - The exact shape of the group-related changes to the TabStripModel API // - The exact shape of the group-related changes to the TabStripModel API
// (and the relevant bits of the extension API) are TBD. // (and the relevant bits of the extension API) are TBD.
base::Optional<tab_groups::TabGroupId> group_ = base::nullopt; base::Optional<tab_groups::TabGroupId> group_ = base::nullopt;
DISALLOW_COPY_AND_ASSIGN(WebContentsData);
}; };
TabStripModel::WebContentsData::WebContentsData( TabStripModel::WebContentsData::WebContentsData(
...@@ -257,6 +259,8 @@ struct TabStripModel::DetachedWebContents { ...@@ -257,6 +259,8 @@ struct TabStripModel::DetachedWebContents {
: contents(std::move(contents)), : contents(std::move(contents)),
index_before_any_removals(index_before_any_removals), index_before_any_removals(index_before_any_removals),
index_at_time_of_removal(index_at_time_of_removal) {} index_at_time_of_removal(index_at_time_of_removal) {}
DetachedWebContents(const DetachedWebContents&) = delete;
DetachedWebContents& operator=(const DetachedWebContents&) = delete;
~DetachedWebContents() = default; ~DetachedWebContents() = default;
DetachedWebContents(DetachedWebContents&&) = default; DetachedWebContents(DetachedWebContents&&) = default;
...@@ -271,9 +275,6 @@ struct TabStripModel::DetachedWebContents { ...@@ -271,9 +275,6 @@ struct TabStripModel::DetachedWebContents {
// tabs are being simultaneously removed, the index reflects previously // tabs are being simultaneously removed, the index reflects previously
// removed tabs in this batch. // removed tabs in this batch.
const int index_at_time_of_removal; const int index_at_time_of_removal;
private:
DISALLOW_COPY_AND_ASSIGN(DetachedWebContents);
}; };
// Holds all state necessary to send notifications for detached tabs. Will // Holds all state necessary to send notifications for detached tabs. Will
...@@ -285,6 +286,8 @@ struct TabStripModel::DetachNotifications { ...@@ -285,6 +286,8 @@ struct TabStripModel::DetachNotifications {
: initially_active_web_contents(initially_active_web_contents), : initially_active_web_contents(initially_active_web_contents),
selection_model(selection_model), selection_model(selection_model),
will_delete(will_delete) {} will_delete(will_delete) {}
DetachNotifications(const DetachNotifications&) = delete;
DetachNotifications& operator=(const DetachNotifications&) = delete;
~DetachNotifications() = default; ~DetachNotifications() = default;
// The WebContents that was active prior to any detaches happening. // The WebContents that was active prior to any detaches happening.
...@@ -305,9 +308,6 @@ struct TabStripModel::DetachNotifications { ...@@ -305,9 +308,6 @@ struct TabStripModel::DetachNotifications {
// Whether to delete the WebContents after sending notifications. // Whether to delete the WebContents after sending notifications.
const bool will_delete; const bool will_delete;
private:
DISALLOW_COPY_AND_ASSIGN(DetachNotifications);
}; };
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "components/tab_groups/tab_group_id.h" #include "components/tab_groups/tab_group_id.h"
...@@ -67,15 +66,14 @@ class TabStripModelDelegate { ...@@ -67,15 +66,14 @@ class TabStripModelDelegate {
// TabStripModelDelegate, or perhaps even move this code elsewhere. // TabStripModelDelegate, or perhaps even move this code elsewhere.
struct NewStripContents { struct NewStripContents {
NewStripContents(); NewStripContents();
NewStripContents(const NewStripContents&) = delete;
NewStripContents& operator=(const NewStripContents&) = delete;
~NewStripContents(); ~NewStripContents();
NewStripContents(NewStripContents&&); NewStripContents(NewStripContents&&);
// The WebContents to add. // The WebContents to add.
std::unique_ptr<content::WebContents> web_contents; std::unique_ptr<content::WebContents> web_contents;
// A bitmask of TabStripModel::AddTabTypes to apply to the added contents. // A bitmask of TabStripModel::AddTabTypes to apply to the added contents.
int add_types = 0; int add_types = 0;
private:
DISALLOW_COPY_AND_ASSIGN(NewStripContents);
}; };
virtual Browser* CreateNewStripWithContents( virtual Browser* CreateNewStripWithContents(
std::vector<NewStripContents> contentses, std::vector<NewStripContents> contentses,
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "chrome/browser/ui/tabs/tab_change_type.h" #include "chrome/browser/ui/tabs/tab_change_type.h"
#include "components/tab_groups/tab_group_id.h" #include "components/tab_groups/tab_group_id.h"
...@@ -141,6 +140,8 @@ class TabStripModelChange { ...@@ -141,6 +140,8 @@ class TabStripModelChange {
explicit TabStripModelChange(Remove delta); explicit TabStripModelChange(Remove delta);
explicit TabStripModelChange(Replace delta); explicit TabStripModelChange(Replace delta);
explicit TabStripModelChange(Move delta); explicit TabStripModelChange(Move delta);
TabStripModelChange(const TabStripModelChange&) = delete;
TabStripModelChange& operator=(const TabStripModelChange&) = delete;
~TabStripModelChange(); ~TabStripModelChange();
Type type() const { return type_; } Type type() const { return type_; }
...@@ -154,8 +155,6 @@ class TabStripModelChange { ...@@ -154,8 +155,6 @@ class TabStripModelChange {
const Type type_ = kSelectionOnly; const Type type_ = kSelectionOnly;
std::unique_ptr<Delta> delta_; std::unique_ptr<Delta> delta_;
DISALLOW_COPY_AND_ASSIGN(TabStripModelChange);
}; };
// Struct to carry changes on selection/activation. // Struct to carry changes on selection/activation.
...@@ -243,6 +242,9 @@ class TabStripModelObserver { ...@@ -243,6 +242,9 @@ class TabStripModelObserver {
kCloseAllCompleted = 1, kCloseAllCompleted = 1,
}; };
TabStripModelObserver(const TabStripModelObserver&) = delete;
TabStripModelObserver& operator=(const TabStripModelObserver&) = delete;
// |change| is a series of changes in tabstrip model. |change| consists // |change| is a series of changes in tabstrip model. |change| consists
// of changes with same type and those changes may have caused selection or // of changes with same type and those changes may have caused selection or
// activation changes. |selection| is determined by comparing the state of // activation changes. |selection| is determined by comparing the state of
...@@ -337,8 +339,6 @@ class TabStripModelObserver { ...@@ -337,8 +339,6 @@ class TabStripModelObserver {
private: private:
std::set<TabStripModel*> observed_models_; std::set<TabStripModel*> observed_models_;
DISALLOW_COPY_AND_ASSIGN(TabStripModelObserver);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_OBSERVER_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_OBSERVER_H_
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_ORDER_CONTROLLER_H_ #ifndef CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_ORDER_CONTROLLER_H_
#define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_ORDER_CONTROLLER_H_ #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_ORDER_CONTROLLER_H_
#include "base/macros.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
#include "ui/base/page_transition_types.h" #include "ui/base/page_transition_types.h"
...@@ -20,6 +19,9 @@ class TabStripModel; ...@@ -20,6 +19,9 @@ class TabStripModel;
class TabStripModelOrderController : public TabStripModelObserver { class TabStripModelOrderController : public TabStripModelObserver {
public: public:
explicit TabStripModelOrderController(TabStripModel* model); explicit TabStripModelOrderController(TabStripModel* model);
TabStripModelOrderController(const TabStripModelOrderController&) = delete;
TabStripModelOrderController& operator=(const TabStripModelOrderController&) =
delete;
~TabStripModelOrderController() override; ~TabStripModelOrderController() override;
// Determine where to place a newly opened tab by using the supplied // Determine where to place a newly opened tab by using the supplied
...@@ -43,8 +45,6 @@ class TabStripModelOrderController : public TabStripModelObserver { ...@@ -43,8 +45,6 @@ class TabStripModelOrderController : public TabStripModelObserver {
int GetValidIndex(int index, int removing_index) const; int GetValidIndex(int index, int removing_index) const;
TabStripModel* model_; TabStripModel* model_;
DISALLOW_COPY_AND_ASSIGN(TabStripModelOrderController);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_ORDER_CONTROLLER_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_ORDER_CONTROLLER_H_
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <vector> #include <vector>
#include "base/macros.h"
#include "chrome/browser/ui/browser_tab_strip_tracker.h" #include "chrome/browser/ui/browser_tab_strip_tracker.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
...@@ -45,6 +44,9 @@ class TabStripModelStatsRecorder : public TabStripModelObserver { ...@@ -45,6 +44,9 @@ class TabStripModelStatsRecorder : public TabStripModelObserver {
}; };
TabStripModelStatsRecorder(); TabStripModelStatsRecorder();
TabStripModelStatsRecorder(const TabStripModelStatsRecorder&) = delete;
TabStripModelStatsRecorder& operator=(const TabStripModelStatsRecorder&) =
delete;
~TabStripModelStatsRecorder() override; ~TabStripModelStatsRecorder() override;
private: private:
...@@ -67,8 +69,6 @@ class TabStripModelStatsRecorder : public TabStripModelObserver { ...@@ -67,8 +69,6 @@ class TabStripModelStatsRecorder : public TabStripModelObserver {
std::vector<content::WebContents*> active_tab_history_; std::vector<content::WebContents*> active_tab_history_;
BrowserTabStripTracker browser_tab_strip_tracker_; BrowserTabStripTracker browser_tab_strip_tracker_;
DISALLOW_COPY_AND_ASSIGN(TabStripModelStatsRecorder);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_STATS_RECORDER_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_STATS_RECORDER_H_
...@@ -59,6 +59,9 @@ class TabStripModelTestIDUserData : public base::SupportsUserData::Data { ...@@ -59,6 +59,9 @@ class TabStripModelTestIDUserData : public base::SupportsUserData::Data {
class MockTabStripModelObserver : public TabStripModelObserver { class MockTabStripModelObserver : public TabStripModelObserver {
public: public:
MockTabStripModelObserver() = default; MockTabStripModelObserver() = default;
MockTabStripModelObserver(const MockTabStripModelObserver&) = delete;
MockTabStripModelObserver& operator=(const MockTabStripModelObserver&) =
delete;
~MockTabStripModelObserver() override = default; ~MockTabStripModelObserver() override = default;
enum TabStripModelObserverAction { enum TabStripModelObserverAction {
...@@ -330,8 +333,6 @@ class MockTabStripModelObserver : public TabStripModelObserver { ...@@ -330,8 +333,6 @@ class MockTabStripModelObserver : public TabStripModelObserver {
private: private:
std::vector<State> states_; std::vector<State> states_;
std::map<tab_groups::TabGroupId, TabGroupUpdate> group_updates_; std::map<tab_groups::TabGroupId, TabGroupUpdate> group_updates_;
DISALLOW_COPY_AND_ASSIGN(MockTabStripModelObserver);
}; };
const char* const MockTabStripModelObserver::State::kActionNames[]{ const char* const MockTabStripModelObserver::State::kActionNames[]{
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_UI_TABS_TAB_STYLE_H_ #ifndef CHROME_BROWSER_UI_TABS_TAB_STYLE_H_
#define CHROME_BROWSER_UI_TABS_TAB_STYLE_H_ #define CHROME_BROWSER_UI_TABS_TAB_STYLE_H_
#include "base/macros.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/font_list.h" #include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
...@@ -79,6 +78,8 @@ class TabStyle { ...@@ -79,6 +78,8 @@ class TabStyle {
SkColor background_color; SkColor background_color;
}; };
TabStyle(const TabStyle&) = delete;
TabStyle& operator=(const TabStyle&) = delete;
virtual ~TabStyle(); virtual ~TabStyle();
// Gets the specific |path_type| associated with the specific |tab|. // Gets the specific |path_type| associated with the specific |tab|.
...@@ -156,9 +157,6 @@ class TabStyle { ...@@ -156,9 +157,6 @@ class TabStyle {
// Returns how far from the leading and trailing edges of a tab the contents // Returns how far from the leading and trailing edges of a tab the contents
// should actually be laid out. // should actually be laid out.
static int GetContentsHorizontalInsetSize(); static int GetContentsHorizontalInsetSize();
private:
DISALLOW_COPY_AND_ASSIGN(TabStyle);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_STYLE_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_STYLE_H_
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define CHROME_BROWSER_UI_TABS_TAB_SWITCH_EVENT_LATENCY_RECORDER_H_ #define CHROME_BROWSER_UI_TABS_TAB_SWITCH_EVENT_LATENCY_RECORDER_H_
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -18,6 +17,9 @@ class TabSwitchEventLatencyRecorder { ...@@ -18,6 +17,9 @@ class TabSwitchEventLatencyRecorder {
enum class EventType { kMouse, kKeyboard, kTouch, kWheel, kOther }; enum class EventType { kMouse, kKeyboard, kTouch, kWheel, kOther };
TabSwitchEventLatencyRecorder(); TabSwitchEventLatencyRecorder();
TabSwitchEventLatencyRecorder(const TabSwitchEventLatencyRecorder&) = delete;
TabSwitchEventLatencyRecorder& operator=(
const TabSwitchEventLatencyRecorder&) = delete;
// Starts timing the tab switch input event latency. If this is called again // Starts timing the tab switch input event latency. If this is called again
// without a following OnWillChangeActiveTab, this will overwrite the // without a following OnWillChangeActiveTab, this will overwrite the
...@@ -37,8 +39,6 @@ class TabSwitchEventLatencyRecorder { ...@@ -37,8 +39,6 @@ class TabSwitchEventLatencyRecorder {
private: private:
base::TimeTicks input_event_timestamp_ = base::TimeTicks(); base::TimeTicks input_event_timestamp_ = base::TimeTicks();
base::Optional<EventType> event_type_ = base::nullopt; base::Optional<EventType> event_type_ = base::nullopt;
DISALLOW_COPY_AND_ASSIGN(TabSwitchEventLatencyRecorder);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_SWITCH_EVENT_LATENCY_RECORDER_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_SWITCH_EVENT_LATENCY_RECORDER_H_
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <map> #include <map>
#include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "components/ukm/test_ukm_recorder.h" #include "components/ukm/test_ukm_recorder.h"
...@@ -27,6 +26,8 @@ using SourceUkmMetricMap = ...@@ -27,6 +26,8 @@ using SourceUkmMetricMap =
class UkmEntryChecker { class UkmEntryChecker {
public: public:
UkmEntryChecker(); UkmEntryChecker();
UkmEntryChecker(const UkmEntryChecker&) = delete;
UkmEntryChecker& operator=(const UkmEntryChecker&) = delete;
~UkmEntryChecker(); ~UkmEntryChecker();
// Expects that the next untested entry for |entry_name| matches the value // Expects that the next untested entry for |entry_name| matches the value
...@@ -72,8 +73,6 @@ class UkmEntryChecker { ...@@ -72,8 +73,6 @@ class UkmEntryChecker {
// |num_entries_| records the number of entries that have been expected via // |num_entries_| records the number of entries that have been expected via
// calls to ExpectNewEntries() or similar. // calls to ExpectNewEntries() or similar.
std::map<std::string, size_t> num_entries_; std::map<std::string, size_t> num_entries_;
DISALLOW_COPY_AND_ASSIGN(UkmEntryChecker);
}; };
#endif // CHROME_BROWSER_UI_TABS_TAB_UKM_TEST_HELPER_H_ #endif // CHROME_BROWSER_UI_TABS_TAB_UKM_TEST_HELPER_H_
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define CHROME_BROWSER_UI_TABS_TEST_TAB_STRIP_MODEL_DELEGATE_H_ #define CHROME_BROWSER_UI_TABS_TEST_TAB_STRIP_MODEL_DELEGATE_H_
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h"
#include "components/tab_groups/tab_group_id.h" #include "components/tab_groups/tab_group_id.h"
...@@ -19,6 +18,9 @@ class WebContents; ...@@ -19,6 +18,9 @@ class WebContents;
class TestTabStripModelDelegate : public TabStripModelDelegate { class TestTabStripModelDelegate : public TabStripModelDelegate {
public: public:
TestTabStripModelDelegate(); TestTabStripModelDelegate();
TestTabStripModelDelegate(const TestTabStripModelDelegate&) = delete;
TestTabStripModelDelegate& operator=(const TestTabStripModelDelegate&) =
delete;
~TestTabStripModelDelegate() override; ~TestTabStripModelDelegate() override;
// Overridden from TabStripModelDelegate: // Overridden from TabStripModelDelegate:
...@@ -44,9 +46,6 @@ class TestTabStripModelDelegate : public TabStripModelDelegate { ...@@ -44,9 +46,6 @@ class TestTabStripModelDelegate : public TabStripModelDelegate {
content::WebContents* contents) override; content::WebContents* contents) override;
bool RunUnloadListenerBeforeClosing(content::WebContents* contents) override; bool RunUnloadListenerBeforeClosing(content::WebContents* contents) override;
bool ShouldDisplayFavicon(content::WebContents* web_contents) const override; bool ShouldDisplayFavicon(content::WebContents* web_contents) const override;
private:
DISALLOW_COPY_AND_ASSIGN(TestTabStripModelDelegate);
}; };
#endif // CHROME_BROWSER_UI_TABS_TEST_TAB_STRIP_MODEL_DELEGATE_H_ #endif // CHROME_BROWSER_UI_TABS_TEST_TAB_STRIP_MODEL_DELEGATE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment