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

Unified Diff: chrome/browser/download/download_browsertest.cc

Issue 665253002: Standardize usage of virtual/override/final in chrome/browser/download/ (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/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index a59e2f6daf44ab87568f691c00949bcba5f88f93..31ce5a2725f2c94877b2789a244aa598eee17625 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -119,7 +119,7 @@ class CreatedObserver : public content::DownloadManager::Observer {
waiting_(false) {
manager->AddObserver(this);
}
- virtual ~CreatedObserver() {
+ ~CreatedObserver() override {
if (manager_)
manager_->RemoveObserver(this);
}
@@ -135,8 +135,8 @@ class CreatedObserver : public content::DownloadManager::Observer {
}
private:
- virtual void OnDownloadCreated(content::DownloadManager* manager,
- content::DownloadItem* item) override {
+ void OnDownloadCreated(content::DownloadManager* manager,
+ content::DownloadItem* item) override {
DCHECK_EQ(manager_, manager);
if (waiting_)
base::MessageLoopForUI::current()->Quit();
@@ -157,7 +157,7 @@ class PercentWaiter : public content::DownloadItem::Observer {
prev_percent_(0) {
item_->AddObserver(this);
}
- virtual ~PercentWaiter() {
+ ~PercentWaiter() override {
if (item_)
item_->RemoveObserver(this);
}
@@ -173,7 +173,7 @@ class PercentWaiter : public content::DownloadItem::Observer {
}
private:
- virtual void OnDownloadUpdated(content::DownloadItem* item) override {
+ void OnDownloadUpdated(content::DownloadItem* item) override {
DCHECK_EQ(item_, item);
if (!error_ &&
((prev_percent_ > item_->PercentComplete()) ||
@@ -187,7 +187,7 @@ class PercentWaiter : public content::DownloadItem::Observer {
base::MessageLoopForUI::current()->Quit();
}
- virtual void OnDownloadDestroyed(content::DownloadItem* item) override {
+ void OnDownloadDestroyed(content::DownloadItem* item) override {
DCHECK_EQ(item_, item);
item_->RemoveObserver(this);
item_ = NULL;
@@ -216,10 +216,10 @@ class DownloadTestObserverResumable : public content::DownloadTestObserver {
transitions_left_(transition_count) {
Init();
}
- virtual ~DownloadTestObserverResumable() {}
+ ~DownloadTestObserverResumable() override {}
private:
- virtual bool IsDownloadInFinalState(DownloadItem* download) override {
+ bool IsDownloadInFinalState(DownloadItem* download) override {
bool is_resumable_now = download->CanResume();
if (!was_previously_resumable_ && is_resumable_now)
--transitions_left_;
@@ -288,20 +288,15 @@ class MockAbortExtensionInstallPrompt : public ExtensionInstallPrompt {
}
// Simulate a user abort on an extension installation.
- virtual void ConfirmInstall(
- Delegate* delegate,
- const Extension* extension,
- const ShowDialogCallback& show_dialog_callback) override {
+ void ConfirmInstall(Delegate* delegate,
+ const Extension* extension,
+ const ShowDialogCallback& show_dialog_callback) override {
delegate->InstallUIAbort(true);
base::MessageLoopForUI::current()->Quit();
}
- virtual void OnInstallSuccess(const Extension* extension,
- SkBitmap* icon) override {
- }
- virtual void OnInstallFailure(
- const extensions::CrxInstallerError& error) override {
- }
+ void OnInstallSuccess(const Extension* extension, SkBitmap* icon) override {}
+ void OnInstallFailure(const extensions::CrxInstallerError& error) override {}
};
// Mock that simulates a permissions dialog where the user allows
@@ -313,19 +308,14 @@ class MockAutoConfirmExtensionInstallPrompt : public ExtensionInstallPrompt {
: ExtensionInstallPrompt(web_contents) {}
// Proceed without confirmation prompt.
- virtual void ConfirmInstall(
- Delegate* delegate,
- const Extension* extension,
- const ShowDialogCallback& show_dialog_callback) override {
+ void ConfirmInstall(Delegate* delegate,
+ const Extension* extension,
+ const ShowDialogCallback& show_dialog_callback) override {
delegate->InstallUIProceed();
}
- virtual void OnInstallSuccess(const Extension* extension,
- SkBitmap* icon) override {
- }
- virtual void OnInstallFailure(
- const extensions::CrxInstallerError& error) override {
- }
+ void OnInstallSuccess(const Extension* extension, SkBitmap* icon) override {}
+ void OnInstallFailure(const extensions::CrxInstallerError& error) override {}
};
static DownloadManager* DownloadManagerForBrowser(Browser* browser) {
@@ -381,7 +371,7 @@ class HistoryObserver : public DownloadHistory::Observer {
GetDownloadHistory()->AddObserver(this);
}
- virtual ~HistoryObserver() {
+ ~HistoryObserver() override {
DownloadService* service = DownloadServiceFactory::GetForBrowserContext(
profile_);
if (service && service->GetDownloadHistory())
@@ -392,9 +382,8 @@ class HistoryObserver : public DownloadHistory::Observer {
callback_ = callback;
}
- virtual void OnDownloadStored(
- content::DownloadItem* item,
- const history::DownloadRow& info) override {
+ void OnDownloadStored(content::DownloadItem* item,
+ const history::DownloadRow& info) override {
if (!callback_.is_null() && (!callback_.Run(info)))
return;
@@ -403,7 +392,7 @@ class HistoryObserver : public DownloadHistory::Observer {
base::MessageLoopForUI::current()->Quit();
}
- virtual void OnDownloadHistoryDestroyed() override {
+ void OnDownloadHistoryDestroyed() override {
DownloadServiceFactory::GetForBrowserContext(profile_)->
GetDownloadHistory()->RemoveObserver(this);
}
@@ -450,21 +439,21 @@ class DownloadTest : public InProcessBrowserTest {
DownloadTest() {}
- virtual void SetUpOnMainThread() override {
+ void SetUpOnMainThread() override {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true));
ASSERT_TRUE(InitialSetup());
}
- virtual void TearDownOnMainThread() override {
+ void TearDownOnMainThread() override {
// Needs to be torn down on the main thread. file_activity_observer_ holds a
// reference to the ChromeDownloadManagerDelegate which should be destroyed
// on the UI thread.
file_activity_observer_.reset();
}
- virtual void SetUpCommandLine(CommandLine* command_line) override {
+ void SetUpCommandLine(CommandLine* command_line) override {
command_line->AppendSwitch(switches::kDisablePluginsDiscovery);
}
« no previous file with comments | « chrome/browser/download/download_browsertest.h ('k') | chrome/browser/download/download_completion_blocker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698