Skip to content

Commit

Permalink
Update {virtual,override} to follow C++11 style in printing.
Browse files Browse the repository at this point in the history
The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override.

This patch was manually generated using a regex and a text editor.

BUG=417463

Review URL: https://codereview.chromium.org/1101023002

Cr-Commit-Position: refs/heads/master@{#327173}
  • Loading branch information
nick-chromium authored and Commit bot committed Apr 27, 2015
1 parent 55ef921 commit bc76161
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 46 deletions.
14 changes: 7 additions & 7 deletions printing/backend/print_backend_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,20 @@ class PrintBackendWin : public PrintBackend {
PrintBackendWin() {}

// PrintBackend implementation.
virtual bool EnumeratePrinters(PrinterList* printer_list) override;
virtual std::string GetDefaultPrinterName() override;
virtual bool GetPrinterSemanticCapsAndDefaults(
bool EnumeratePrinters(PrinterList* printer_list) override;
std::string GetDefaultPrinterName() override;
bool GetPrinterSemanticCapsAndDefaults(
const std::string& printer_name,
PrinterSemanticCapsAndDefaults* printer_info) override;
virtual bool GetPrinterCapsAndDefaults(
bool GetPrinterCapsAndDefaults(
const std::string& printer_name,
PrinterCapsAndDefaults* printer_info) override;
virtual std::string GetPrinterDriverInfo(
std::string GetPrinterDriverInfo(
const std::string& printer_name) override;
virtual bool IsValidPrinter(const std::string& printer_name) override;
bool IsValidPrinter(const std::string& printer_name) override;

protected:
virtual ~PrintBackendWin() {}
~PrintBackendWin() override {}
};

bool PrintBackendWin::EnumeratePrinters(PrinterList* printer_list) {
Expand Down
32 changes: 16 additions & 16 deletions printing/emf_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PRINTING_EXPORT Emf : public Metafile {
// Generates a virtual HDC that will record every GDI commands and compile
// it in a EMF data stream.
Emf();
virtual ~Emf();
~Emf() override;

// Closes metafile.
void Close();
Expand All @@ -54,34 +54,34 @@ class PRINTING_EXPORT Emf : public Metafile {
bool InitFromFile(const base::FilePath& metafile_path);

// Metafile methods.
virtual bool Init() override;
virtual bool InitFromData(const void* src_buffer,
uint32 src_buffer_size) override;
bool Init() override;
bool InitFromData(const void* src_buffer,
uint32 src_buffer_size) override;

// Inserts a custom GDICOMMENT records indicating StartPage/EndPage calls
// (since StartPage and EndPage do not work in a metafile DC). Only valid
// when hdc_ is non-NULL. |page_size|, |content_area|, and |scale_factor| are
// ignored.
virtual bool StartPage(const gfx::Size& page_size,
const gfx::Rect& content_area,
const float& scale_factor) override;
virtual bool FinishPage() override;
virtual bool FinishDocument() override;
bool StartPage(const gfx::Size& page_size,
const gfx::Rect& content_area,
const float& scale_factor) override;
bool FinishPage() override;
bool FinishDocument() override;

virtual uint32 GetDataSize() const override;
virtual bool GetData(void* buffer, uint32 size) const override;
uint32 GetDataSize() const override;
bool GetData(void* buffer, uint32 size) const override;

// Should be passed to Playback to keep the exact same size.
virtual gfx::Rect GetPageBounds(unsigned int page_number) const override;
gfx::Rect GetPageBounds(unsigned int page_number) const override;

virtual unsigned int GetPageCount() const override { return 1; }
unsigned int GetPageCount() const override { return 1; }

virtual HDC context() const override {
HDC context() const override {
return hdc_;
}

virtual bool Playback(HDC hdc, const RECT* rect) const override;
virtual bool SafePlayback(HDC hdc) const override;
bool Playback(HDC hdc, const RECT* rect) const override;
bool SafePlayback(HDC hdc) const override;

HENHMETAFILE emf() const { return emf_; }

Expand Down
4 changes: 2 additions & 2 deletions printing/emf_win_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class EmfPrintingTest : public testing::Test, public PrintingContext::Delegate {
}

// PrintingContext::Delegate methods.
virtual gfx::NativeView GetParentView() override { return NULL; }
virtual std::string GetAppLocale() override { return std::string(); }
gfx::NativeView GetParentView() override { return NULL; }
std::string GetAppLocale() override { return std::string(); }
};

const uint32 EMF_HEADER_SIZE = 128;
Expand Down
6 changes: 3 additions & 3 deletions printing/pdf_metafile_skia.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class PRINTING_EXPORT PdfMetafileSkia : public Metafile {
gfx::NativeDrawingContext context() const override;

#if defined(OS_WIN)
virtual bool Playback(gfx::NativeDrawingContext hdc,
const RECT* rect) const override;
virtual bool SafePlayback(gfx::NativeDrawingContext hdc) const override;
bool Playback(gfx::NativeDrawingContext hdc,
const RECT* rect) const override;
bool SafePlayback(gfx::NativeDrawingContext hdc) const override;
#elif defined(OS_MACOSX)
bool RenderPage(unsigned int page_number,
gfx::NativeDrawingContext context,
Expand Down
4 changes: 2 additions & 2 deletions printing/printing_context_system_dialog_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class PRINTING_EXPORT PrintingContextSytemDialogWin
: public PrintingContextWin {
public:
explicit PrintingContextSytemDialogWin(Delegate* delegate);
virtual ~PrintingContextSytemDialogWin();
~PrintingContextSytemDialogWin() override;

// PrintingContext implementation.
virtual void AskUserForSettings(
void AskUserForSettings(
int max_pages,
bool has_selection,
bool is_scripted,
Expand Down
28 changes: 14 additions & 14 deletions printing/printing_context_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ class PrintSettings;
class PRINTING_EXPORT PrintingContextWin : public PrintingContext {
public:
explicit PrintingContextWin(Delegate* delegate);
virtual ~PrintingContextWin();
~PrintingContextWin() override;

// PrintingContext implementation.
virtual void AskUserForSettings(
void AskUserForSettings(
int max_pages,
bool has_selection,
bool is_scripted,
const PrintSettingsCallback& callback) override;
virtual Result UseDefaultSettings() override;
virtual gfx::Size GetPdfPaperSizeDeviceUnits() override;
virtual Result UpdatePrinterSettings(bool external_preview,
bool show_system_dialog) override;
virtual Result InitWithSettings(const PrintSettings& settings) override;
virtual Result NewDocument(const base::string16& document_name) override;
virtual Result NewPage() override;
virtual Result PageDone() override;
virtual Result DocumentDone() override;
virtual void Cancel() override;
virtual void ReleaseContext() override;
virtual gfx::NativeDrawingContext context() const override;
Result UseDefaultSettings() override;
gfx::Size GetPdfPaperSizeDeviceUnits() override;
Result UpdatePrinterSettings(bool external_preview,
bool show_system_dialog) override;
Result InitWithSettings(const PrintSettings& settings) override;
Result NewDocument(const base::string16& document_name) override;
Result NewPage() override;
Result PageDone() override;
Result DocumentDone() override;
void Cancel() override;
void ReleaseContext() override;
gfx::NativeDrawingContext context() const override;

protected:
static HWND GetRootWindow(gfx::NativeView view);
Expand Down
4 changes: 2 additions & 2 deletions printing/printing_context_win_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class PrintingContextTest : public PrintingTest<testing::Test>,
}

// PrintingContext::Delegate methods.
virtual gfx::NativeView GetParentView() override { return NULL; }
virtual std::string GetAppLocale() override { return std::string(); }
gfx::NativeView GetParentView() override { return NULL; }
std::string GetAppLocale() override { return std::string(); }

protected:
PrintingContext::Result result() const { return result_; }
Expand Down

0 comments on commit bc76161

Please sign in to comment.