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.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 } | 1276 } |
1277 | 1277 |
1278 //////////////////////////////////////////////////////////////////////////////// | 1278 //////////////////////////////////////////////////////////////////////////////// |
1279 // Widget, private: | 1279 // Widget, private: |
1280 | 1280 |
1281 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { | 1281 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { |
1282 return true; | 1282 return true; |
1283 } | 1283 } |
1284 | 1284 |
1285 void Widget::SetInactiveRenderingDisabled(bool value) { | 1285 void Widget::SetInactiveRenderingDisabled(bool value) { |
| 1286 if (value == disable_inactive_rendering_) |
| 1287 return; |
| 1288 |
1286 disable_inactive_rendering_ = value; | 1289 disable_inactive_rendering_ = value; |
1287 // We need to always notify the NonClientView so that it can trigger a paint. | |
1288 // TODO: what's really needed is a way to know when either the active state | |
1289 // changes or |disable_inactive_rendering_| changes. | |
1290 if (non_client_view_) | 1290 if (non_client_view_) |
1291 non_client_view_->SetInactiveRenderingDisabled(value); | 1291 non_client_view_->SetInactiveRenderingDisabled(value); |
1292 native_widget_->SetInactiveRenderingDisabled(value); | 1292 native_widget_->SetInactiveRenderingDisabled(value); |
1293 } | 1293 } |
1294 | 1294 |
1295 void Widget::SaveWindowPlacement() { | 1295 void Widget::SaveWindowPlacement() { |
1296 // The window delegate does the actual saving for us. It seems like (judging | 1296 // The window delegate does the actual saving for us. It seems like (judging |
1297 // by go/crash) that in some circumstances we can end up here after | 1297 // by go/crash) that in some circumstances we can end up here after |
1298 // WM_DESTROY, at which point the window delegate is likely gone. So just | 1298 // WM_DESTROY, at which point the window delegate is likely gone. So just |
1299 // bail. | 1299 // bail. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 | 1383 |
1384 //////////////////////////////////////////////////////////////////////////////// | 1384 //////////////////////////////////////////////////////////////////////////////// |
1385 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1385 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1386 | 1386 |
1387 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1387 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1388 return this; | 1388 return this; |
1389 } | 1389 } |
1390 | 1390 |
1391 } // namespace internal | 1391 } // namespace internal |
1392 } // namespace views | 1392 } // namespace views |
OLD | NEW |