OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_WIDGET_WIDGET_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_H_ |
6 #define VIEWS_WIDGET_WIDGET_H_ | 6 #define VIEWS_WIDGET_WIDGET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 | 10 |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 virtual InputMethod* GetInputMethodDirect() OVERRIDE; | 595 virtual InputMethod* GetInputMethodDirect() OVERRIDE; |
596 virtual Widget* AsWidget() OVERRIDE; | 596 virtual Widget* AsWidget() OVERRIDE; |
597 virtual const Widget* AsWidget() const OVERRIDE; | 597 virtual const Widget* AsWidget() const OVERRIDE; |
598 | 598 |
599 // Overridden from FocusTraversable: | 599 // Overridden from FocusTraversable: |
600 virtual FocusSearch* GetFocusSearch() OVERRIDE; | 600 virtual FocusSearch* GetFocusSearch() OVERRIDE; |
601 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; | 601 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; |
602 virtual View* GetFocusTraversableParentView() OVERRIDE; | 602 virtual View* GetFocusTraversableParentView() OVERRIDE; |
603 | 603 |
604 protected: | 604 protected: |
605 // TODO(beng): Remove NativeWidgetGtk's dependence on the mouse state flags. | |
606 friend class NativeWidgetGtk; | |
607 | |
608 // Creates the RootView to be used within this Widget. Subclasses may override | 605 // Creates the RootView to be used within this Widget. Subclasses may override |
609 // to create custom RootViews that do specialized event processing. | 606 // to create custom RootViews that do specialized event processing. |
610 // TODO(beng): Investigate whether or not this is needed. | 607 // TODO(beng): Investigate whether or not this is needed. |
611 virtual internal::RootView* CreateRootView(); | 608 virtual internal::RootView* CreateRootView(); |
612 | 609 |
613 // Provided to allow the NativeWidget implementations to destroy the RootView | 610 // Provided to allow the NativeWidget implementations to destroy the RootView |
614 // _before_ the focus manager/tooltip manager. | 611 // _before_ the focus manager/tooltip manager. |
615 // TODO(beng): remove once we fold those objects onto this one. | 612 // TODO(beng): remove once we fold those objects onto this one. |
616 void DestroyRootView(); | 613 void DestroyRootView(); |
617 | 614 |
618 // TODO(beng): Remove NativeWidgetGtk's dependence on these: | 615 private: |
619 // TODO(msw): Make this mouse state member private. | 616 // TODO(beng): Remove NativeWidgetGtk's dependence on the mouse state flags. |
620 // If true, the mouse is currently down. | 617 friend class NativeWidgetGtk; |
621 bool is_mouse_button_pressed_; | |
622 | 618 |
623 // TODO(beng): Remove NativeWidgetGtk's dependence on these: | |
624 // TODO(msw): Make these mouse state members private. | |
625 // The following are used to detect duplicate mouse move events and not | |
626 // deliver them. Displaying a window may result in the system generating | |
627 // duplicate move events even though the mouse hasn't moved. | |
628 bool last_mouse_event_was_move_; | |
629 gfx::Point last_mouse_event_position_; | |
630 | |
631 private: | |
632 friend class NativeTextfieldViewsTest; | 619 friend class NativeTextfieldViewsTest; |
633 friend class NativeComboboxViewsTest; | 620 friend class NativeComboboxViewsTest; |
634 friend class ScopedEvent; | 621 friend class ScopedEvent; |
635 | 622 |
636 // Returns whether capture should be released on mouse release. | 623 // Returns whether capture should be released on mouse release. |
637 virtual bool ShouldReleaseCaptureOnMouseReleased() const; | 624 virtual bool ShouldReleaseCaptureOnMouseReleased() const; |
638 | 625 |
639 // Persists the window's restored position and "show" state using the | 626 // Persists the window's restored position and "show" state using the |
640 // window delegate. | 627 // window delegate. |
641 void SaveWindowPlacement(); | 628 void SaveWindowPlacement(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 | 712 |
726 // See |is_top_level()| accessor. | 713 // See |is_top_level()| accessor. |
727 bool is_top_level_; | 714 bool is_top_level_; |
728 | 715 |
729 // Factory used to create Compositors. Settable by tests. | 716 // Factory used to create Compositors. Settable by tests. |
730 static ui::Compositor*(*compositor_factory_)(); | 717 static ui::Compositor*(*compositor_factory_)(); |
731 | 718 |
732 // Tracks whether native widget has been initialized. | 719 // Tracks whether native widget has been initialized. |
733 bool native_widget_initialized_; | 720 bool native_widget_initialized_; |
734 | 721 |
| 722 // TODO(beng): Remove NativeWidgetGtk's dependence on these: |
| 723 // If true, the mouse is currently down. |
| 724 bool is_mouse_button_pressed_; |
| 725 |
| 726 // TODO(beng): Remove NativeWidgetGtk's dependence on these: |
| 727 // The following are used to detect duplicate mouse move events and not |
| 728 // deliver them. Displaying a window may result in the system generating |
| 729 // duplicate move events even though the mouse hasn't moved. |
| 730 bool last_mouse_event_was_move_; |
| 731 gfx::Point last_mouse_event_position_; |
| 732 |
735 DISALLOW_COPY_AND_ASSIGN(Widget); | 733 DISALLOW_COPY_AND_ASSIGN(Widget); |
736 }; | 734 }; |
737 | 735 |
738 } // namespace views | 736 } // namespace views |
739 | 737 |
740 #endif // VIEWS_WIDGET_WIDGET_H_ | 738 #endif // VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |