| 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
| 6 | 6 |
| 7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 InputMethod* View::GetInputMethod() { | 1094 InputMethod* View::GetInputMethod() { |
| 1095 Widget* widget = GetWidget(); | 1095 Widget* widget = GetWidget(); |
| 1096 return widget ? widget->GetInputMethod() : NULL; | 1096 return widget ? widget->GetInputMethod() : NULL; |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 const InputMethod* View::GetInputMethod() const { | 1099 const InputMethod* View::GetInputMethod() const { |
| 1100 const Widget* widget = GetWidget(); | 1100 const Widget* widget = GetWidget(); |
| 1101 return widget ? widget->GetInputMethod() : NULL; | 1101 return widget ? widget->GetInputMethod() : NULL; |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 scoped_ptr<ui::EventTargeter> | 1104 scoped_ptr<ViewTargeter> |
| 1105 View::SetEventTargeter(scoped_ptr<ui::EventTargeter> targeter) { | 1105 View::SetEventTargeter(scoped_ptr<ViewTargeter> targeter) { |
| 1106 scoped_ptr<ui::EventTargeter> old_targeter = targeter_.Pass(); | 1106 scoped_ptr<ViewTargeter> old_targeter = targeter_.Pass(); |
| 1107 targeter_ = targeter.Pass(); | 1107 targeter_ = targeter.Pass(); |
| 1108 return old_targeter.Pass(); | 1108 return old_targeter.Pass(); |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 bool View::CanAcceptEvent(const ui::Event& event) { | 1111 bool View::CanAcceptEvent(const ui::Event& event) { |
| 1112 return IsDrawn(); | 1112 return IsDrawn(); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 ui::EventTarget* View::GetParentTarget() { | 1115 ui::EventTarget* View::GetParentTarget() { |
| 1116 return parent_; | 1116 return parent_; |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2494 // Message the RootView to do the drag and drop. That way if we're removed | 2494 // Message the RootView to do the drag and drop. That way if we're removed |
| 2495 // the RootView can detect it and avoid calling us back. | 2495 // the RootView can detect it and avoid calling us back. |
| 2496 gfx::Point widget_location(event.location()); | 2496 gfx::Point widget_location(event.location()); |
| 2497 ConvertPointToWidget(this, &widget_location); | 2497 ConvertPointToWidget(this, &widget_location); |
| 2498 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2498 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2499 // WARNING: we may have been deleted. | 2499 // WARNING: we may have been deleted. |
| 2500 return true; | 2500 return true; |
| 2501 } | 2501 } |
| 2502 | 2502 |
| 2503 } // namespace views | 2503 } // namespace views |
| OLD | NEW |