diff options
author | scottmg <scottmg@chromium.org> | 2014-10-23 09:56:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-23 16:56:43 +0000 |
commit | 23a0f218f7126e3abc8ce39ca9986411a465d048 (patch) | |
tree | 6b96e176908d83384a8e1087a4045fdfab93dc0f | |
parent | a29c66368d589afa9b922ccd752a3e84132b9194 (diff) | |
download | chromium_src-23a0f218f7126e3abc8ce39ca9986411a465d048.zip chromium_src-23a0f218f7126e3abc8ce39ca9986411a465d048.tar.gz chromium_src-23a0f218f7126e3abc8ce39ca9986411a465d048.tar.bz2 |
Remove IsDIPEnabled from Screen
Appears to be unused.
TBR=ben@chromium.org
R=sky@chromium.org
BUG=143619
Review URL: https://codereview.chromium.org/672823002
Cr-Commit-Position: refs/heads/master@{#300906}
24 files changed, 13 insertions, 74 deletions
diff --git a/ash/display/screen_ash.cc b/ash/display/screen_ash.cc index 125ef82..8c72e1d 100644 --- a/ash/display/screen_ash.cc +++ b/ash/display/screen_ash.cc @@ -71,9 +71,6 @@ class ScreenForShutdown : public gfx::Screen { } // gfx::Screen overrides: - virtual bool IsDIPEnabled() override { - return true; - } virtual gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } @@ -204,10 +201,6 @@ void ScreenAsh::NotifyDisplayRemoved(const gfx::Display& display) { gfx::DisplayObserver, observers_, OnDisplayRemoved(display)); } -bool ScreenAsh::IsDIPEnabled() { - return true; -} - gfx::Point ScreenAsh::GetCursorScreenPoint() { return aura::Env::GetInstance()->last_mouse_location(); } diff --git a/ash/display/screen_ash.h b/ash/display/screen_ash.h index 8b0cb2c..22af08f 100644 --- a/ash/display/screen_ash.h +++ b/ash/display/screen_ash.h @@ -61,7 +61,6 @@ class ASH_EXPORT ScreenAsh : public gfx::Screen { static const gfx::Display& GetDisplayForId(int64 display_id); // gfx::Screen overrides: - virtual bool IsDIPEnabled() override; virtual gfx::Point GetCursorScreenPoint() override; virtual gfx::NativeWindow GetWindowUnderCursor() override; virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) diff --git a/athena/env/athena_env_impl.cc b/athena/env/athena_env_impl.cc index 1a22632..3359dd9 100644 --- a/athena/env/athena_env_impl.cc +++ b/athena/env/athena_env_impl.cc @@ -56,7 +56,6 @@ class ScreenForShutdown : public gfx::Screen { : primary_display_(primary_display) {} // gfx::Screen overrides: - virtual bool IsDIPEnabled() override { return true; } virtual gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } virtual gfx::NativeWindow GetWindowUnderCursor() override { return NULL; } virtual gfx::NativeWindow GetWindowAtScreenPoint( diff --git a/chrome/browser/android/shortcut_helper_unittest.cc b/chrome/browser/android/shortcut_helper_unittest.cc index bb8098d..76e1a5e 100644 --- a/chrome/browser/android/shortcut_helper_unittest.cc +++ b/chrome/browser/android/shortcut_helper_unittest.cc @@ -25,7 +25,6 @@ class FakeScreen : public gfx::Screen { } // gfx::Screen implementation (only what's needed for testing). - virtual bool IsDIPEnabled() override { return true; } virtual gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } virtual gfx::NativeWindow GetWindowUnderCursor() override { return NULL; } virtual gfx::NativeWindow GetWindowAtScreenPoint( diff --git a/chrome/browser/extensions/api/system_display/system_display_apitest.cc b/chrome/browser/extensions/api/system_display/system_display_apitest.cc index b91648d..27716b2 100644 --- a/chrome/browser/extensions/api/system_display/system_display_apitest.cc +++ b/chrome/browser/extensions/api/system_display/system_display_apitest.cc @@ -73,7 +73,6 @@ class MockScreen : public Screen { protected: // Overridden from gfx::Screen: - bool IsDIPEnabled() override { return true; } gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } gfx::NativeWindow GetWindowUnderCursor() override { return gfx::NativeWindow(); diff --git a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc index 2be813b..2c4c273 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc @@ -25,11 +25,6 @@ class TestScreen : public gfx::Screen { ~TestScreen() override {} // Overridden from gfx::Screen: - bool IsDIPEnabled() override { - NOTREACHED(); - return false; - } - gfx::Point GetCursorScreenPoint() override { NOTREACHED(); return gfx::Point(); diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc index 2a10c94..4a931fc 100644 --- a/content/browser/media/capture/web_contents_video_capture_device.cc +++ b/content/browser/media/capture/web_contents_video_capture_device.cc @@ -667,15 +667,13 @@ gfx::Size WebContentsCaptureMachine::ComputeOptimalTargetSize() const { if (rwhv) { const gfx::NativeView view = rwhv->GetNativeView(); gfx::Screen* const screen = gfx::Screen::GetScreenFor(view); - if (screen->IsDIPEnabled()) { - const gfx::Display display = screen->GetDisplayNearestWindow(view); - const float scale = display.device_scale_factor(); - if (scale > 1.0f) { - const gfx::Size shrunk_size( - gfx::ToFlooredSize(gfx::ScaleSize(optimal_size, 1.0f / scale))); - if (shrunk_size.width() > 0 && shrunk_size.height() > 0) - optimal_size = shrunk_size; - } + const gfx::Display display = screen->GetDisplayNearestWindow(view); + const float scale = display.device_scale_factor(); + if (scale > 1.0f) { + const gfx::Size shrunk_size( + gfx::ToFlooredSize(gfx::ScaleSize(optimal_size, 1.0f / scale))); + if (shrunk_size.width() > 0 && shrunk_size.height() > 0) + optimal_size = shrunk_size; } } diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc index e9fa2a2..96fe4ba 100644 --- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc +++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc @@ -472,7 +472,6 @@ class FakeScreen : public gfx::Screen { ~FakeScreen() override {} // gfx::Screen implementation (only what's needed for testing). - bool IsDIPEnabled() override { return true; } gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } gfx::NativeWindow GetWindowUnderCursor() override { return NULL; } gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { diff --git a/extensions/browser/api/capture_web_contents_function.cc b/extensions/browser/api/capture_web_contents_function.cc index 9fbce6b..a888284 100644 --- a/extensions/browser/api/capture_web_contents_function.cc +++ b/extensions/browser/api/capture_web_contents_function.cc @@ -76,12 +76,10 @@ bool CaptureWebContentsFunction::RunAsync() { gfx::Size bitmap_size = view_size; const gfx::NativeView native_view = view->GetNativeView(); gfx::Screen* const screen = gfx::Screen::GetScreenFor(native_view); - if (screen->IsDIPEnabled()) { - const float scale = - screen->GetDisplayNearestWindow(native_view).device_scale_factor(); - if (scale > 1.0f) - bitmap_size = gfx::ToCeiledSize(gfx::ScaleSize(view_size, scale)); - } + const float scale = + screen->GetDisplayNearestWindow(native_view).device_scale_factor(); + if (scale > 1.0f) + bitmap_size = gfx::ToCeiledSize(gfx::ScaleSize(view_size, scale)); host->CopyFromBackingStore( gfx::Rect(view_size), diff --git a/mojo/aura/screen_mojo.cc b/mojo/aura/screen_mojo.cc index b07c320..098df39 100644 --- a/mojo/aura/screen_mojo.cc +++ b/mojo/aura/screen_mojo.cc @@ -17,11 +17,6 @@ ScreenMojo* ScreenMojo::Create() { ScreenMojo::~ScreenMojo() { } -bool ScreenMojo::IsDIPEnabled() { - NOTIMPLEMENTED(); - return true; -} - gfx::Point ScreenMojo::GetCursorScreenPoint() { NOTIMPLEMENTED(); return gfx::Point(); diff --git a/mojo/aura/screen_mojo.h b/mojo/aura/screen_mojo.h index 2fab17f..b825f9e 100644 --- a/mojo/aura/screen_mojo.h +++ b/mojo/aura/screen_mojo.h @@ -24,7 +24,6 @@ class ScreenMojo : public gfx::Screen { protected: // gfx::Screen overrides: - bool IsDIPEnabled() override; gfx::Point GetCursorScreenPoint() override; gfx::NativeWindow GetWindowUnderCursor() override; gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; diff --git a/ui/aura/test/test_screen.cc b/ui/aura/test/test_screen.cc index 63e44b9..1b0f9ff 100644 --- a/ui/aura/test/test_screen.cc +++ b/ui/aura/test/test_screen.cc @@ -109,10 +109,6 @@ gfx::Transform TestScreen::GetUIScaleTransform() const { return ui_scale; } -bool TestScreen::IsDIPEnabled() { - return true; -} - void TestScreen::OnWindowBoundsChanged( Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { DCHECK_EQ(host_->window(), window); diff --git a/ui/aura/test/test_screen.h b/ui/aura/test/test_screen.h index 7b1f98b..c7a01a6 100644 --- a/ui/aura/test/test_screen.h +++ b/ui/aura/test/test_screen.h @@ -49,7 +49,6 @@ class TestScreen : public gfx::Screen, virtual void OnWindowDestroying(Window* window) override; // gfx::Screen overrides: - virtual bool IsDIPEnabled() override; virtual gfx::Point GetCursorScreenPoint() override; virtual gfx::NativeWindow GetWindowUnderCursor() override; virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) diff --git a/ui/base/layout.cc b/ui/base/layout.cc index aa3aecf..59b913b 100644 --- a/ui/base/layout.cc +++ b/ui/base/layout.cc @@ -122,11 +122,8 @@ ScopedSetSupportedScaleFactors::~ScopedSetSupportedScaleFactors() { #if !defined(OS_MACOSX) float GetScaleFactorForNativeView(gfx::NativeView view) { gfx::Screen* screen = gfx::Screen::GetScreenFor(view); - if (screen->IsDIPEnabled()) { - gfx::Display display = screen->GetDisplayNearestWindow(view); - return display.device_scale_factor(); - } - return 1.0f; + gfx::Display display = screen->GetDisplayNearestWindow(view); + return display.device_scale_factor(); } #endif // !defined(OS_MACOSX) diff --git a/ui/gfx/screen.h b/ui/gfx/screen.h index e6a38a6..a05866a 100644 --- a/ui/gfx/screen.h +++ b/ui/gfx/screen.h @@ -50,9 +50,6 @@ class GFX_EXPORT Screen { Screen(); virtual ~Screen(); - // Returns true if DIP is enabled. - virtual bool IsDIPEnabled() = 0; - // Returns the current absolute position of the mouse pointer. virtual gfx::Point GetCursorScreenPoint() = 0; diff --git a/ui/gfx/screen_android.cc b/ui/gfx/screen_android.cc index 4f04353..d48b0b1 100644 --- a/ui/gfx/screen_android.cc +++ b/ui/gfx/screen_android.cc @@ -15,8 +15,6 @@ class ScreenAndroid : public Screen { public: ScreenAndroid() {} - virtual bool IsDIPEnabled() override { return true; } - virtual gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } virtual gfx::NativeWindow GetWindowUnderCursor() override { diff --git a/ui/gfx/screen_ios.mm b/ui/gfx/screen_ios.mm index ac5ccc4..e05568e 100644 --- a/ui/gfx/screen_ios.mm +++ b/ui/gfx/screen_ios.mm @@ -12,10 +12,6 @@ namespace { class ScreenIos : public gfx::Screen { - virtual bool IsDIPEnabled() override { - return true; - } - virtual gfx::Point GetCursorScreenPoint() override { NOTIMPLEMENTED(); return gfx::Point(0, 0); diff --git a/ui/gfx/screen_mac.mm b/ui/gfx/screen_mac.mm index 45f3f45..2bb90e6 100644 --- a/ui/gfx/screen_mac.mm +++ b/ui/gfx/screen_mac.mm @@ -91,8 +91,6 @@ class ScreenMac : public gfx::Screen { ScreenMac::DisplayReconfigurationCallBack, this); } - bool IsDIPEnabled() override { return true; } - gfx::Point GetCursorScreenPoint() override { NSPoint mouseLocation = [NSEvent mouseLocation]; // Flip coordinates to gfx (0,0 in top-left corner) using primary screen. diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc index ae07bbe..8840038 100644 --- a/ui/gfx/screen_win.cc +++ b/ui/gfx/screen_win.cc @@ -93,10 +93,6 @@ ScreenWin::~ScreenWin() { SingletonHwnd::GetInstance()->RemoveObserver(this); } -bool ScreenWin::IsDIPEnabled() { - return GetDPIScale() > 1.0; -} - gfx::Point ScreenWin::GetCursorScreenPoint() { POINT pt; GetCursorPos(&pt); diff --git a/ui/gfx/screen_win.h b/ui/gfx/screen_win.h index 7d7d2b0..1c82f22 100644 --- a/ui/gfx/screen_win.h +++ b/ui/gfx/screen_win.h @@ -21,7 +21,6 @@ class GFX_EXPORT ScreenWin : public Screen, protected: // Overridden from gfx::Screen: - virtual bool IsDIPEnabled() override; virtual gfx::Point GetCursorScreenPoint() override; virtual gfx::NativeWindow GetWindowUnderCursor() override; virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) diff --git a/ui/views/widget/desktop_aura/desktop_screen_win.cc b/ui/views/widget/desktop_aura/desktop_screen_win.cc index aede179..a8e088c 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_win.cc +++ b/ui/views/widget/desktop_aura/desktop_screen_win.cc @@ -26,10 +26,6 @@ DesktopScreenWin::~DesktopScreenWin() { //////////////////////////////////////////////////////////////////////////////// // DesktopScreenWin, gfx::ScreenWin implementation: -bool DesktopScreenWin::IsDIPEnabled() { - return true; -} - gfx::Display DesktopScreenWin::GetDisplayMatching( const gfx::Rect& match_rect) const { return GetDisplayNearestPoint(match_rect.CenterPoint()); diff --git a/ui/views/widget/desktop_aura/desktop_screen_win.h b/ui/views/widget/desktop_aura/desktop_screen_win.h index 0ba1f5d..59776a6 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_win.h +++ b/ui/views/widget/desktop_aura/desktop_screen_win.h @@ -17,7 +17,6 @@ public: private: // Overridden from gfx::ScreenWin: - virtual bool IsDIPEnabled() override; virtual gfx::Display GetDisplayMatching( const gfx::Rect& match_rect) const override; virtual HWND GetHWNDFromNativeView(gfx::NativeView window) const override; diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc index bb253cf..083e900 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc @@ -112,10 +112,6 @@ DesktopScreenX11::~DesktopScreenX11() { //////////////////////////////////////////////////////////////////////////////// // DesktopScreenX11, gfx::Screen implementation: -bool DesktopScreenX11::IsDIPEnabled() { - return true; -} - gfx::Point DesktopScreenX11::GetCursorScreenPoint() { TRACE_EVENT0("views", "DesktopScreenX11::GetCursorScreenPoint()"); diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.h b/ui/views/widget/desktop_aura/desktop_screen_x11.h index 1fc32d1..c97c9d9 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_x11.h +++ b/ui/views/widget/desktop_aura/desktop_screen_x11.h @@ -31,7 +31,6 @@ class VIEWS_EXPORT DesktopScreenX11 : public gfx::Screen, virtual ~DesktopScreenX11(); // Overridden from gfx::Screen: - virtual bool IsDIPEnabled() override; virtual gfx::Point GetCursorScreenPoint() override; virtual gfx::NativeWindow GetWindowUnderCursor() override; virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) |