summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authordroger <droger@chromium.org>2015-01-20 12:55:48 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-20 20:56:48 +0000
commitb4a495753c1c291ca0209c2765e6562a723c5959 (patch)
treedf348a53239913c631f33432339e8597efdfe7ed /ui/gfx
parent4a193b718a4a09e74ed11f6642e32b55e9e0e955 (diff)
downloadchromium_src-b4a495753c1c291ca0209c2765e6562a723c5959.zip
chromium_src-b4a495753c1c291ca0209c2765e6562a723c5959.tar.gz
chromium_src-b4a495753c1c291ca0209c2765e6562a723c5959.tar.bz2
Enable strict-virtual-specifiers for iOS builds.
This CL cleans up the remaining errors and enables the compile time check in common.gypi. BUG=417463 Review URL: https://codereview.chromium.org/840813009 Cr-Commit-Position: refs/heads/master@{#312269}
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/image/image.cc14
-rw-r--r--ui/gfx/image/image_ios_unittest.mm6
-rw-r--r--ui/gfx/platform_font_ios.h24
-rw-r--r--ui/gfx/screen_ios.mm26
4 files changed, 30 insertions, 40 deletions
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc
index 46c1a44..170c514 100644
--- a/ui/gfx/image/image.cc
+++ b/ui/gfx/image/image.cc
@@ -288,22 +288,16 @@ class ImageRepCocoaTouch : public ImageRep {
CHECK(image);
}
- virtual ~ImageRepCocoaTouch() {
+ ~ImageRepCocoaTouch() override {
base::mac::NSObjectRelease(image_);
image_ = nil;
}
- virtual int Width() const override {
- return Size().width();
- }
+ int Width() const override { return Size().width(); }
- virtual int Height() const override {
- return Size().height();
- }
+ int Height() const override { return Size().height(); }
- virtual gfx::Size Size() const override {
- return internal::UIImageSize(image_);
- }
+ gfx::Size Size() const override { return internal::UIImageSize(image_); }
UIImage* image() const { return image_; }
diff --git a/ui/gfx/image/image_ios_unittest.mm b/ui/gfx/image/image_ios_unittest.mm
index 789fe72..a9558b0 100644
--- a/ui/gfx/image/image_ios_unittest.mm
+++ b/ui/gfx/image/image_ios_unittest.mm
@@ -46,13 +46,13 @@ UIImage* UIImageWithSizeAndScale(CGFloat width, CGFloat height, CGFloat scale) {
class ImageIOSTest : public testing::Test {
public:
ImageIOSTest() {}
- virtual ~ImageIOSTest() {}
+ ~ImageIOSTest() override {}
- virtual void SetUp() override {
+ void SetUp() override {
original_scale_factors_ = gfx::ImageSkia::GetSupportedScales();
}
- virtual void TearDown() override {
+ void TearDown() override {
gfx::ImageSkia::SetSupportedScales(original_scale_factors_);
}
diff --git a/ui/gfx/platform_font_ios.h b/ui/gfx/platform_font_ios.h
index 8d2e7a1..ca3f131 100644
--- a/ui/gfx/platform_font_ios.h
+++ b/ui/gfx/platform_font_ios.h
@@ -17,21 +17,21 @@ class PlatformFontIOS : public PlatformFont {
int font_size);
// Overridden from PlatformFont:
- virtual Font DeriveFont(int size_delta, int style) const override;
- virtual int GetHeight() const override;
- virtual int GetBaseline() const override;
- virtual int GetCapHeight() const override;
- virtual int GetExpectedTextWidth(int length) const override;
- virtual int GetStyle() const override;
- virtual std::string GetFontName() const override;
- virtual std::string GetActualFontNameForTesting() const override;
- virtual int GetFontSize() const override;
- virtual const FontRenderParams& GetFontRenderParams() override;
- virtual NativeFont GetNativeFont() const override;
+ Font DeriveFont(int size_delta, int style) const override;
+ int GetHeight() const override;
+ int GetBaseline() const override;
+ int GetCapHeight() const override;
+ int GetExpectedTextWidth(int length) const override;
+ int GetStyle() const override;
+ std::string GetFontName() const override;
+ std::string GetActualFontNameForTesting() const override;
+ int GetFontSize() const override;
+ const FontRenderParams& GetFontRenderParams() override;
+ NativeFont GetNativeFont() const override;
private:
PlatformFontIOS(const std::string& font_name, int font_size, int style);
- virtual ~PlatformFontIOS() {}
+ ~PlatformFontIOS() override {}
// Initialize the object with the specified parameters.
void InitWithNameSizeAndStyle(const std::string& font_name,
diff --git a/ui/gfx/screen_ios.mm b/ui/gfx/screen_ios.mm
index e05568e..6ace9c8 100644
--- a/ui/gfx/screen_ios.mm
+++ b/ui/gfx/screen_ios.mm
@@ -12,23 +12,22 @@
namespace {
class ScreenIos : public gfx::Screen {
- virtual gfx::Point GetCursorScreenPoint() override {
+ gfx::Point GetCursorScreenPoint() override {
NOTIMPLEMENTED();
return gfx::Point(0, 0);
}
- virtual gfx::NativeWindow GetWindowUnderCursor() override {
+ gfx::NativeWindow GetWindowUnderCursor() override {
NOTIMPLEMENTED();
return gfx::NativeWindow();
}
- virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
- override {
+ gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override {
NOTIMPLEMENTED();
return gfx::NativeWindow();
}
- virtual int GetNumDisplays() const override {
+ int GetNumDisplays() const override {
#if TARGET_IPHONE_SIMULATOR
// UIScreen does not reliably return correct results on the simulator.
return 1;
@@ -37,34 +36,31 @@ class ScreenIos : public gfx::Screen {
#endif
}
- virtual std::vector<gfx::Display> GetAllDisplays() const override {
+ std::vector<gfx::Display> GetAllDisplays() const override {
NOTIMPLEMENTED();
return std::vector<gfx::Display>(1, GetPrimaryDisplay());
}
// Returns the display nearest the specified window.
- virtual gfx::Display GetDisplayNearestWindow(
- gfx::NativeView view) const override {
+ gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override {
NOTIMPLEMENTED();
return gfx::Display();
}
// Returns the the display nearest the specified point.
- virtual gfx::Display GetDisplayNearestPoint(
- const gfx::Point& point) const override {
+ gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override {
NOTIMPLEMENTED();
return gfx::Display();
}
// Returns the display that most closely intersects the provided bounds.
- virtual gfx::Display GetDisplayMatching(
- const gfx::Rect& match_rect) const override {
+ gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override {
NOTIMPLEMENTED();
return gfx::Display();
}
// Returns the primary display.
- virtual gfx::Display GetPrimaryDisplay() const override {
+ gfx::Display GetPrimaryDisplay() const override {
UIScreen* mainScreen = [UIScreen mainScreen];
CHECK(mainScreen);
gfx::Display display(0, gfx::Rect(mainScreen.bounds));
@@ -72,11 +68,11 @@ class ScreenIos : public gfx::Screen {
return display;
}
- virtual void AddObserver(gfx::DisplayObserver* observer) override {
+ void AddObserver(gfx::DisplayObserver* observer) override {
// no display change on iOS.
}
- virtual void RemoveObserver(gfx::DisplayObserver* observer) override {
+ void RemoveObserver(gfx::DisplayObserver* observer) override {
// no display change on iOS.
}
};