OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/view.h" | 5 #include "ui/views/view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 } | 1223 } |
1224 } | 1224 } |
1225 } | 1225 } |
1226 | 1226 |
1227 void View::OnPaintLayer(gfx::Canvas* canvas) { | 1227 void View::OnPaintLayer(gfx::Canvas* canvas) { |
1228 if (!layer() || !layer()->fills_bounds_opaquely()) | 1228 if (!layer() || !layer()->fills_bounds_opaquely()) |
1229 canvas->DrawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); | 1229 canvas->DrawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); |
1230 PaintCommon(canvas); | 1230 PaintCommon(canvas); |
1231 } | 1231 } |
1232 | 1232 |
| 1233 void View::OnDeviceScaleFactorChanged(float device_scale_factor) { |
| 1234 // Repainting with new scale factor will paint the content at the right scale. |
| 1235 } |
| 1236 |
1233 void View::ReorderLayers() { | 1237 void View::ReorderLayers() { |
1234 View* v = this; | 1238 View* v = this; |
1235 while (v && !v->layer()) | 1239 while (v && !v->layer()) |
1236 v = v->parent(); | 1240 v = v->parent(); |
1237 | 1241 |
1238 // Forward to widget in case we're in a NativeWidgetAura. | 1242 // Forward to widget in case we're in a NativeWidgetAura. |
1239 if (!v) { | 1243 if (!v) { |
1240 if (GetWidget()) | 1244 if (GetWidget()) |
1241 GetWidget()->ReorderLayers(); | 1245 GetWidget()->ReorderLayers(); |
1242 } else { | 1246 } else { |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 gfx::Point widget_location(event.location()); | 2069 gfx::Point widget_location(event.location()); |
2066 ConvertPointToWidget(this, &widget_location); | 2070 ConvertPointToWidget(this, &widget_location); |
2067 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); | 2071 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); |
2068 return true; | 2072 return true; |
2069 #else | 2073 #else |
2070 return false; | 2074 return false; |
2071 #endif // !defined(OS_MACOSX) | 2075 #endif // !defined(OS_MACOSX) |
2072 } | 2076 } |
2073 | 2077 |
2074 } // namespace views | 2078 } // namespace views |
OLD | NEW |