Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: chrome/browser/ui/tabs/tab_strip_model_unittest.cc

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/tabs/tab_strip_model_unittest.cc
diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
index b787255969eca253e2a8e00510a09d6d77891315..529a724b2cf1af58d6ff8bd4f50c2d3f864ad806 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
@@ -59,7 +59,7 @@ class DeleteWebContentsOnDestroyedObserver
tab_strip_(tab_strip) {
}
- virtual void WebContentsDestroyed() override {
+ void WebContentsDestroyed() override {
WebContents* tab_to_delete = tab_to_delete_;
tab_to_delete_ = NULL;
TabStripModel* tab_strip_to_delete = tab_strip_;
@@ -78,11 +78,11 @@ class DeleteWebContentsOnDestroyedObserver
class TabStripDummyDelegate : public TestTabStripModelDelegate {
public:
TabStripDummyDelegate() : run_unload_(false) {}
- virtual ~TabStripDummyDelegate() {}
+ ~TabStripDummyDelegate() override {}
void set_run_unload_listener(bool value) { run_unload_ = value; }
- virtual bool RunUnloadListenerBeforeClosing(WebContents* contents) override {
+ bool RunUnloadListenerBeforeClosing(WebContents* contents) override {
return run_unload_;
}
@@ -98,7 +98,7 @@ const char kTabStripModelTestIDUserDataKey[] = "TabStripModelTestIDUserData";
class TabStripModelTestIDUserData : public base::SupportsUserData::Data {
public:
explicit TabStripModelTestIDUserData(int id) : id_(id) {}
- virtual ~TabStripModelTestIDUserData() {}
+ ~TabStripModelTestIDUserData() override {}
int id() { return id_; }
private:
@@ -113,18 +113,15 @@ class DummySingleWebContentsDialogManager
web_modal::SingleWebContentsDialogManagerDelegate* delegate)
: delegate_(delegate),
dialog_(dialog) {}
- virtual ~DummySingleWebContentsDialogManager() {}
+ ~DummySingleWebContentsDialogManager() override {}
- virtual void Show() override {}
- virtual void Hide() override {}
- virtual void Close() override {
- delegate_->WillClose(dialog_);
- }
- virtual void Focus() override {}
- virtual void Pulse() override {}
- virtual void HostChanged(
- web_modal::WebContentsModalDialogHost* new_host) override {}
- virtual NativeWebContentsModalDialog dialog() override { return dialog_; }
+ void Show() override {}
+ void Hide() override {}
+ void Close() override { delegate_->WillClose(dialog_); }
+ void Focus() override {}
+ void Pulse() override {}
+ void HostChanged(web_modal::WebContentsModalDialogHost* new_host) override {}
+ NativeWebContentsModalDialog dialog() override { return dialog_; }
private:
web_modal::SingleWebContentsDialogManagerDelegate* delegate_;
@@ -143,15 +140,15 @@ class TabBlockedStateTestBrowser
tab_strip_model_->AddObserver(this);
}
- virtual ~TabBlockedStateTestBrowser() {
+ ~TabBlockedStateTestBrowser() override {
tab_strip_model_->RemoveObserver(this);
}
private:
// TabStripModelObserver
- virtual void TabInsertedAt(WebContents* contents,
- int index,
- bool foreground) override {
+ void TabInsertedAt(WebContents* contents,
+ int index,
+ bool foreground) override {
web_modal::WebContentsModalDialogManager* manager =
web_modal::WebContentsModalDialogManager::FromWebContents(contents);
if (manager)
@@ -159,8 +156,8 @@ class TabBlockedStateTestBrowser
}
// WebContentsModalDialogManagerDelegate
- virtual void SetWebContentsBlocked(content::WebContents* contents,
- bool blocked) override {
+ void SetWebContentsBlocked(content::WebContents* contents,
+ bool blocked) override {
int index = tab_strip_model_->GetIndexOfWebContents(contents);
ASSERT_GE(index, 0);
tab_strip_model_->SetTabBlocked(index, blocked);
@@ -269,7 +266,7 @@ class MockTabStripModelObserver : public TabStripModelObserver {
: empty_(true),
deleted_(false),
model_(model) {}
- virtual ~MockTabStripModelObserver() {}
+ ~MockTabStripModelObserver() override {}
enum TabStripModelObserverAction {
INSERT,
@@ -348,79 +345,71 @@ class MockTabStripModelObserver : public TabStripModelObserver {
}
// TabStripModelObserver implementation:
- virtual void TabInsertedAt(WebContents* contents,
- int index,
- bool foreground) override {
+ void TabInsertedAt(WebContents* contents,
+ int index,
+ bool foreground) override {
empty_ = false;
State s(contents, index, INSERT);
s.foreground = foreground;
states_.push_back(s);
}
- virtual void ActiveTabChanged(WebContents* old_contents,
- WebContents* new_contents,
- int index,
- int reason) override {
+ void ActiveTabChanged(WebContents* old_contents,
+ WebContents* new_contents,
+ int index,
+ int reason) override {
State s(new_contents, index, ACTIVATE);
s.src_contents = old_contents;
s.change_reason = reason;
states_.push_back(s);
}
- virtual void TabSelectionChanged(
- TabStripModel* tab_strip_model,
- const ui::ListSelectionModel& old_model) override {
+ void TabSelectionChanged(TabStripModel* tab_strip_model,
+ const ui::ListSelectionModel& old_model) override {
State s(model()->GetActiveWebContents(), model()->active_index(), SELECT);
s.src_contents = model()->GetWebContentsAt(old_model.active());
s.src_index = old_model.active();
states_.push_back(s);
}
- virtual void TabMoved(WebContents* contents,
- int from_index,
- int to_index) override {
+ void TabMoved(WebContents* contents, int from_index, int to_index) override {
State s(contents, to_index, MOVE);
s.src_index = from_index;
states_.push_back(s);
}
- virtual void TabClosingAt(TabStripModel* tab_strip_model,
- WebContents* contents,
- int index) override {
+ void TabClosingAt(TabStripModel* tab_strip_model,
+ WebContents* contents,
+ int index) override {
states_.push_back(State(contents, index, CLOSE));
}
- virtual void TabDetachedAt(WebContents* contents, int index) override {
+ void TabDetachedAt(WebContents* contents, int index) override {
states_.push_back(State(contents, index, DETACH));
}
- virtual void TabDeactivated(WebContents* contents) override {
+ void TabDeactivated(WebContents* contents) override {
states_.push_back(State(contents, model()->active_index(), DEACTIVATE));
}
- virtual void TabChangedAt(WebContents* contents,
- int index,
- TabChangeType change_type) override {
+ void TabChangedAt(WebContents* contents,
+ int index,
+ TabChangeType change_type) override {
states_.push_back(State(contents, index, CHANGE));
}
- virtual void TabReplacedAt(TabStripModel* tab_strip_model,
- WebContents* old_contents,
- WebContents* new_contents,
- int index) override {
+ void TabReplacedAt(TabStripModel* tab_strip_model,
+ WebContents* old_contents,
+ WebContents* new_contents,
+ int index) override {
State s(new_contents, index, REPLACED);
s.src_contents = old_contents;
states_.push_back(s);
}
- virtual void TabPinnedStateChanged(WebContents* contents,
- int index) override {
+ void TabPinnedStateChanged(WebContents* contents, int index) override {
states_.push_back(State(contents, index, PINNED));
}
- virtual void TabStripEmpty() override {
- empty_ = true;
- }
- virtual void WillCloseAllTabs() override {
+ void TabStripEmpty() override { empty_ = true; }
+ void WillCloseAllTabs() override {
states_.push_back(State(NULL, -1, CLOSE_ALL));
}
- virtual void CloseAllTabsCanceled() override {
+ void CloseAllTabsCanceled() override {
states_.push_back(State(NULL, -1, CLOSE_ALL_CANCELED));
}
- virtual void TabStripModelDeleted() override {
- deleted_ = true;
- }
+ void TabStripModelDeleted() override { deleted_ = true; }
void ClearStates() {
states_.clear();

Powered by Google App Engine
This is Rietveld 408576698