#include "chrome/browser/download/download_target_determiner.h"
#include "chrome/browser/download/download_test_file_activity_observer.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
+#include "chrome/browser/extensions/extension_install_prompt_show_params.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/history/download_row.h"
#include "chrome/browser/history/history_service.h"
waiting_(false) {
manager->AddObserver(this);
}
- virtual ~CreatedObserver() {
+ ~CreatedObserver() override {
if (manager_)
manager_->RemoveObserver(this);
}
}
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();
prev_percent_(0) {
item_->AddObserver(this);
}
- virtual ~PercentWaiter() {
+ ~PercentWaiter() override {
if (item_)
item_->RemoveObserver(this);
}
}
private:
- virtual void OnDownloadUpdated(content::DownloadItem* item) OVERRIDE {
+ void OnDownloadUpdated(content::DownloadItem* item) override {
DCHECK_EQ(item_, item);
if (!error_ &&
((prev_percent_ > item_->PercentComplete()) ||
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;
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_;
}
// 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
: 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) {
GetDownloadHistory()->AddObserver(this);
}
- virtual ~HistoryObserver() {
+ ~HistoryObserver() override {
DownloadService* service = DownloadServiceFactory::GetForBrowserContext(
profile_);
if (service && service->GetDownloadHistory())
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;
base::MessageLoopForUI::current()->Quit();
}
- virtual void OnDownloadHistoryDestroyed() OVERRIDE {
+ void OnDownloadHistoryDestroyed() override {
DownloadServiceFactory::GetForBrowserContext(profile_)->
GetDownloadHistory()->RemoveObserver(this);
}
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);
}
}
};
- DownloadFilesCheckErrors(ARRAYSIZE_UNSAFE(download_info), download_info);
+ DownloadFilesCheckErrors(arraysize(download_info), download_info);
}
IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadErrorsFile) {
}
};
- DownloadInsertFilesErrorCheckErrors(ARRAYSIZE_UNSAFE(error_info), error_info);
+ DownloadInsertFilesErrorCheckErrors(arraysize(error_info), error_info);
}
IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadErrorReadonlyFolder) {
}
};
- DownloadFilesToReadonlyFolder(ARRAYSIZE_UNSAFE(download_info), download_info);
+ DownloadFilesToReadonlyFolder(arraysize(download_info), download_info);
}
// Test that we show a dangerous downloads warning for a dangerous file
}
virtual ~DisableSafeBrowsingOnInProgressDownload() {}
- virtual bool IsDownloadInFinalState(DownloadItem* download) OVERRIDE {
+ virtual bool IsDownloadInFinalState(DownloadItem* download) override {
if (download->GetState() != DownloadItem::IN_PROGRESS ||
download->GetTargetFilePath().empty())
return false;