| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 if (!native_widget_->HasCapture()) { | 926 if (!native_widget_->HasCapture()) { |
| 927 native_widget_->SetCapture(); | 927 native_widget_->SetCapture(); |
| 928 | 928 |
| 929 // Early return if setting capture was unsuccessful. | 929 // Early return if setting capture was unsuccessful. |
| 930 if (!native_widget_->HasCapture()) | 930 if (!native_widget_->HasCapture()) |
| 931 return; | 931 return; |
| 932 } | 932 } |
| 933 | 933 |
| 934 if (internal::NativeWidgetPrivate::IsMouseButtonDown()) | 934 if (internal::NativeWidgetPrivate::IsMouseButtonDown()) |
| 935 is_mouse_button_pressed_ = true; | 935 is_mouse_button_pressed_ = true; |
| 936 root_view_->SetMouseHandler(view, auto_release_capture_); | 936 root_view_->SetMouseHandler(view); |
| 937 } | 937 } |
| 938 | 938 |
| 939 void Widget::ReleaseCapture() { | 939 void Widget::ReleaseCapture() { |
| 940 if (native_widget_->HasCapture()) | 940 if (native_widget_->HasCapture()) |
| 941 native_widget_->ReleaseCapture(); | 941 native_widget_->ReleaseCapture(); |
| 942 } | 942 } |
| 943 | 943 |
| 944 bool Widget::HasCapture() { | 944 bool Widget::HasCapture() { |
| 945 return native_widget_->HasCapture(); | 945 return native_widget_->HasCapture(); |
| 946 } | 946 } |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1468 |
| 1469 //////////////////////////////////////////////////////////////////////////////// | 1469 //////////////////////////////////////////////////////////////////////////////// |
| 1470 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1470 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1471 | 1471 |
| 1472 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1472 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1473 return this; | 1473 return this; |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 } // namespace internal | 1476 } // namespace internal |
| 1477 } // namespace views | 1477 } // namespace views |
| OLD | NEW |