Chromium Code Reviews| 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 #ifndef UI_VIEWS_WIDGET_WIDGET_H_ | 5 #ifndef UI_VIEWS_WIDGET_WIDGET_H_ |
| 6 #define UI_VIEWS_WIDGET_WIDGET_H_ | 6 #define UI_VIEWS_WIDGET_WIDGET_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <stack> | 9 #include <stack> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 589 int operation, | 589 int operation, |
| 590 ui::DragDropTypes::DragEventSource source); | 590 ui::DragDropTypes::DragEventSource source); |
| 591 | 591 |
| 592 // Returns the view that requested the current drag operation via | 592 // Returns the view that requested the current drag operation via |
| 593 // RunShellDrag(), or NULL if there is no such view or drag operation. | 593 // RunShellDrag(), or NULL if there is no such view or drag operation. |
| 594 View* dragged_view() { | 594 View* dragged_view() { |
| 595 return const_cast<View*>(const_cast<const Widget*>(this)->dragged_view()); | 595 return const_cast<View*>(const_cast<const Widget*>(this)->dragged_view()); |
| 596 } | 596 } |
| 597 const View* dragged_view() const { return dragged_view_; } | 597 const View* dragged_view() const { return dragged_view_; } |
| 598 | 598 |
| 599 // Unit tests may temporarily set |dragged_view| to simulate a drag. | |
| 600 void set_dragged_view(View* dragged_view) { dragged_view_ = dragged_view; } | |
|
sky
2016/03/01 03:58:48
Exposing api like this, especially when it doesn't
varkha
2016/03/01 04:03:34
I've tried that (making it private and making Tool
varkha
2016/03/01 04:58:53
Done. Just needed to mention that the friend test
| |
| 601 | |
| 599 // Adds the specified |rect| in client area coordinates to the rectangle to be | 602 // Adds the specified |rect| in client area coordinates to the rectangle to be |
| 600 // redrawn. | 603 // redrawn. |
| 601 virtual void SchedulePaintInRect(const gfx::Rect& rect); | 604 virtual void SchedulePaintInRect(const gfx::Rect& rect); |
| 602 | 605 |
| 603 // Sets the currently visible cursor. If |cursor| is NULL, the cursor used | 606 // Sets the currently visible cursor. If |cursor| is NULL, the cursor used |
| 604 // before the current is restored. | 607 // before the current is restored. |
| 605 void SetCursor(gfx::NativeCursor cursor); | 608 void SetCursor(gfx::NativeCursor cursor); |
| 606 | 609 |
| 607 // Returns true if and only if mouse events are enabled. | 610 // Returns true if and only if mouse events are enabled. |
| 608 bool IsMouseEventsEnabled() const; | 611 bool IsMouseEventsEnabled() const; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 968 bool movement_disabled_; | 971 bool movement_disabled_; |
| 969 | 972 |
| 970 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; | 973 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; |
| 971 | 974 |
| 972 DISALLOW_COPY_AND_ASSIGN(Widget); | 975 DISALLOW_COPY_AND_ASSIGN(Widget); |
| 973 }; | 976 }; |
| 974 | 977 |
| 975 } // namespace views | 978 } // namespace views |
| 976 | 979 |
| 977 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 980 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
| OLD | NEW |