diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 00:09:04 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 00:09:04 +0000 |
commit | d3f5bbc1736289a4f2d44a971acdb2dd0ffa1504 (patch) | |
tree | 9b76581261e298180ea3fa2e94c06e0198cd3a82 /ui/views | |
parent | 3bd858679bb3fdeb04224179099b5bc059433bec (diff) | |
download | chromium_src-d3f5bbc1736289a4f2d44a971acdb2dd0ffa1504.zip chromium_src-d3f5bbc1736289a4f2d44a971acdb2dd0ffa1504.tar.gz chromium_src-d3f5bbc1736289a4f2d44a971acdb2dd0ffa1504.tar.bz2 |
Notification for device scale factor change
BUG=105165
TEST=updated compositor test to cover OnDeviceScaleFactorChagned.
Review URL: https://chromiumcodereview.appspot.com/10391165
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/view.cc | 4 | ||||
-rw-r--r-- | ui/views/view.h | 1 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 4 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.h | 1 |
4 files changed, 10 insertions, 0 deletions
diff --git a/ui/views/view.cc b/ui/views/view.cc index f5dd39b..cbcb45c 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc @@ -1230,6 +1230,10 @@ void View::OnPaintLayer(gfx::Canvas* canvas) { PaintCommon(canvas); } +void View::OnDeviceScaleFactorChanged(float device_scale_factor) { + // Repainting with new scale factor will paint the content at the right scale. +} + void View::ReorderLayers() { View* v = this; while (v && !v->layer()) diff --git a/ui/views/view.h b/ui/views/view.h index fc4a27f..8492d95 100644 --- a/ui/views/view.h +++ b/ui/views/view.h @@ -996,6 +996,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, // Overridden from ui::LayerDelegate: virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; + virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; // Finds the layer that this view paints to (it may belong to an ancestor // view), then reorders the immediate children of that layer to match the diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index b63e8fd..a71b3d7 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -784,6 +784,10 @@ void NativeWidgetAura::OnPaint(gfx::Canvas* canvas) { delegate_->OnNativeWidgetPaint(canvas); } +void NativeWidgetAura::OnDeviceScaleFactorChanged(float device_scale_factor) { + // Repainting with new scale factor will paint the content at the right scale. +} + void NativeWidgetAura::OnWindowDestroying() { delegate_->OnNativeWidgetDestroying(); diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h index c9a1480..7d89a77 100644 --- a/ui/views/widget/native_widget_aura.h +++ b/ui/views/widget/native_widget_aura.h @@ -144,6 +144,7 @@ class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, virtual bool CanFocus() OVERRIDE; virtual void OnCaptureLost() OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; + virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; virtual void OnWindowDestroying() OVERRIDE; virtual void OnWindowDestroyed() OVERRIDE; virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE; |