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/widget/widget.h" | 5 #include "ui/views/widget/widget.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1173 |
1174 bool Widget::OnNativeWidgetPaintAccelerated(const gfx::Rect& dirty_region) { | 1174 bool Widget::OnNativeWidgetPaintAccelerated(const gfx::Rect& dirty_region) { |
1175 ui::Compositor* compositor = GetCompositor(); | 1175 ui::Compositor* compositor = GetCompositor(); |
1176 if (!compositor) | 1176 if (!compositor) |
1177 return false; | 1177 return false; |
1178 | 1178 |
1179 compositor->ScheduleRedrawRect(dirty_region); | 1179 compositor->ScheduleRedrawRect(dirty_region); |
1180 return true; | 1180 return true; |
1181 } | 1181 } |
1182 | 1182 |
1183 void Widget::OnNativeWidgetPaint(gfx::Canvas* canvas) { | 1183 void Widget::OnNativeWidgetPaint(const ui::PaintContext& context) { |
1184 // On Linux Aura, we can get here during Init() because of the | 1184 // On Linux Aura, we can get here during Init() because of the |
1185 // SetInitialBounds call. | 1185 // SetInitialBounds call. |
1186 if (!native_widget_initialized_) | 1186 if (!native_widget_initialized_) |
1187 return; | 1187 return; |
1188 GetRootView()->Paint(ui::PaintContext(canvas, GetLayer()->PaintRect())); | 1188 GetRootView()->Paint(context); |
1189 } | 1189 } |
1190 | 1190 |
1191 int Widget::GetNonClientComponent(const gfx::Point& point) { | 1191 int Widget::GetNonClientComponent(const gfx::Point& point) { |
1192 int component = non_client_view_ ? | 1192 int component = non_client_view_ ? |
1193 non_client_view_->NonClientHitTest(point) : | 1193 non_client_view_->NonClientHitTest(point) : |
1194 HTNOWHERE; | 1194 HTNOWHERE; |
1195 | 1195 |
1196 if (movement_disabled_ && (component == HTCAPTION || component == HTSYSMENU)) | 1196 if (movement_disabled_ && (component == HTCAPTION || component == HTSYSMENU)) |
1197 return HTNOWHERE; | 1197 return HTNOWHERE; |
1198 | 1198 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 | 1538 |
1539 //////////////////////////////////////////////////////////////////////////////// | 1539 //////////////////////////////////////////////////////////////////////////////// |
1540 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1540 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1541 | 1541 |
1542 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1542 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1543 return this; | 1543 return this; |
1544 } | 1544 } |
1545 | 1545 |
1546 } // namespace internal | 1546 } // namespace internal |
1547 } // namespace views | 1547 } // namespace views |
OLD | NEW |