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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 class InputMethod; | 53 class InputMethod; |
54 class Layer; | 54 class Layer; |
55 class NativeTheme; | 55 class NativeTheme; |
56 class OSExchangeData; | 56 class OSExchangeData; |
57 class ThemeProvider; | 57 class ThemeProvider; |
58 } | 58 } |
59 | 59 |
60 namespace views { | 60 namespace views { |
61 | 61 |
62 class DesktopWindowTreeHost; | 62 class DesktopWindowTreeHost; |
63 class InputMethod; | |
64 class NativeWidget; | 63 class NativeWidget; |
65 class NonClientFrameView; | 64 class NonClientFrameView; |
66 class TooltipManager; | 65 class TooltipManager; |
67 class View; | 66 class View; |
68 class WidgetDelegate; | 67 class WidgetDelegate; |
69 class WidgetObserver; | 68 class WidgetObserver; |
70 class WidgetRemovalsObserver; | 69 class WidgetRemovalsObserver; |
71 | 70 |
72 namespace internal { | 71 namespace internal { |
73 class NativeWidgetPrivate; | 72 class NativeWidgetPrivate; |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 const ui::NativeTheme* GetNativeTheme() const; | 561 const ui::NativeTheme* GetNativeTheme() const; |
563 | 562 |
564 // Returns the FocusManager for this widget. | 563 // Returns the FocusManager for this widget. |
565 // Note that all widgets in a widget hierarchy share the same focus manager. | 564 // Note that all widgets in a widget hierarchy share the same focus manager. |
566 FocusManager* GetFocusManager(); | 565 FocusManager* GetFocusManager(); |
567 const FocusManager* GetFocusManager() const; | 566 const FocusManager* GetFocusManager() const; |
568 | 567 |
569 // Returns the focused text input client within this widget. | 568 // Returns the focused text input client within this widget. |
570 ui::TextInputClient* GetFocusedTextInputClient(); | 569 ui::TextInputClient* GetFocusedTextInputClient(); |
571 | 570 |
572 // Returns the InputMethod for this widget. | |
573 // Note that all widgets in a widget hierarchy share the same input method. | |
574 InputMethod* GetInputMethod(); | |
575 const InputMethod* GetInputMethod() const; | |
576 | |
577 // Returns the ui::InputMethod for this widget. | 571 // Returns the ui::InputMethod for this widget. |
578 // TODO(yukishiino): Rename this method to GetInputMethod once we remove | 572 ui::InputMethod* GetInputMethod(); |
579 // views::InputMethod. | |
580 ui::InputMethod* GetHostInputMethod(); | |
581 | 573 |
582 // Starts a drag operation for the specified view. This blocks until the drag | 574 // Starts a drag operation for the specified view. This blocks until the drag |
583 // operation completes. |view| can be NULL. | 575 // operation completes. |view| can be NULL. |
584 // If the view is non-NULL it can be accessed during the drag by calling | 576 // If the view is non-NULL it can be accessed during the drag by calling |
585 // dragged_view(). If the view has not been deleted during the drag, | 577 // dragged_view(). If the view has not been deleted during the drag, |
586 // OnDragDone() is called on it. |location| is in the widget's coordinate | 578 // OnDragDone() is called on it. |location| is in the widget's coordinate |
587 // system. | 579 // system. |
588 void RunShellDrag(View* view, | 580 void RunShellDrag(View* view, |
589 const ui::OSExchangeData& data, | 581 const ui::OSExchangeData& data, |
590 const gfx::Point& location, | 582 const gfx::Point& location, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 void OnNativeWidgetEndUserBoundsChange() override; | 787 void OnNativeWidgetEndUserBoundsChange() override; |
796 bool HasFocusManager() const override; | 788 bool HasFocusManager() const override; |
797 void OnNativeWidgetPaint(const ui::PaintContext& context) override; | 789 void OnNativeWidgetPaint(const ui::PaintContext& context) override; |
798 int GetNonClientComponent(const gfx::Point& point) override; | 790 int GetNonClientComponent(const gfx::Point& point) override; |
799 void OnKeyEvent(ui::KeyEvent* event) override; | 791 void OnKeyEvent(ui::KeyEvent* event) override; |
800 void OnMouseEvent(ui::MouseEvent* event) override; | 792 void OnMouseEvent(ui::MouseEvent* event) override; |
801 void OnMouseCaptureLost() override; | 793 void OnMouseCaptureLost() override; |
802 void OnScrollEvent(ui::ScrollEvent* event) override; | 794 void OnScrollEvent(ui::ScrollEvent* event) override; |
803 void OnGestureEvent(ui::GestureEvent* event) override; | 795 void OnGestureEvent(ui::GestureEvent* event) override; |
804 bool ExecuteCommand(int command_id) override; | 796 bool ExecuteCommand(int command_id) override; |
805 InputMethod* GetInputMethodDirect() override; | |
806 const std::vector<ui::Layer*>& GetRootLayers() override; | 797 const std::vector<ui::Layer*>& GetRootLayers() override; |
807 bool HasHitTestMask() const override; | 798 bool HasHitTestMask() const override; |
808 void GetHitTestMask(gfx::Path* mask) const override; | 799 void GetHitTestMask(gfx::Path* mask) const override; |
809 Widget* AsWidget() override; | 800 Widget* AsWidget() override; |
810 const Widget* AsWidget() const override; | 801 const Widget* AsWidget() const override; |
811 bool SetInitialFocus(ui::WindowShowState show_state) override; | 802 bool SetInitialFocus(ui::WindowShowState show_state) override; |
812 | 803 |
813 // Overridden from ui::EventSource: | 804 // Overridden from ui::EventSource: |
814 ui::EventProcessor* GetEventProcessor() override; | 805 ui::EventProcessor* GetEventProcessor() override; |
815 | 806 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 void SetInitialBounds(const gfx::Rect& bounds); | 850 void SetInitialBounds(const gfx::Rect& bounds); |
860 | 851 |
861 // Sizes and positions the frameless window just after it is created. | 852 // Sizes and positions the frameless window just after it is created. |
862 void SetInitialBoundsForFramelessWindow(const gfx::Rect& bounds); | 853 void SetInitialBoundsForFramelessWindow(const gfx::Rect& bounds); |
863 | 854 |
864 // Returns the bounds and "show" state from the delegate. Returns true if | 855 // Returns the bounds and "show" state from the delegate. Returns true if |
865 // the delegate wants to use a specified bounds. | 856 // the delegate wants to use a specified bounds. |
866 bool GetSavedWindowPlacement(gfx::Rect* bounds, | 857 bool GetSavedWindowPlacement(gfx::Rect* bounds, |
867 ui::WindowShowState* show_state); | 858 ui::WindowShowState* show_state); |
868 | 859 |
869 // Creates and initializes a new InputMethod and returns it, otherwise null. | |
870 scoped_ptr<InputMethod> CreateInputMethod(); | |
871 | |
872 // Sets a different InputMethod instance to this widget. The instance | |
873 // must not be initialized, the ownership will be assumed by the widget. | |
874 // It's only for testing purpose. | |
875 void ReplaceInputMethod(InputMethod* input_method); | |
876 | |
877 internal::NativeWidgetPrivate* native_widget_; | 860 internal::NativeWidgetPrivate* native_widget_; |
878 | 861 |
879 base::ObserverList<WidgetObserver> observers_; | 862 base::ObserverList<WidgetObserver> observers_; |
880 | 863 |
881 base::ObserverList<WidgetRemovalsObserver> removals_observers_; | 864 base::ObserverList<WidgetRemovalsObserver> removals_observers_; |
882 | 865 |
883 // Non-owned pointer to the Widget's delegate. If a NULL delegate is supplied | 866 // Non-owned pointer to the Widget's delegate. If a NULL delegate is supplied |
884 // to Init() a default WidgetDelegate is created. | 867 // to Init() a default WidgetDelegate is created. |
885 WidgetDelegate* widget_delegate_; | 868 WidgetDelegate* widget_delegate_; |
886 | 869 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 | 914 |
932 // The restored bounds used for the initial show. This is only used if | 915 // The restored bounds used for the initial show. This is only used if |
933 // |saved_show_state_| is maximized. | 916 // |saved_show_state_| is maximized. |
934 gfx::Rect initial_restored_bounds_; | 917 gfx::Rect initial_restored_bounds_; |
935 | 918 |
936 // Focus is automatically set to the view provided by the delegate | 919 // Focus is automatically set to the view provided by the delegate |
937 // when the widget is shown. Set this value to false to override | 920 // when the widget is shown. Set this value to false to override |
938 // initial focus for the widget. | 921 // initial focus for the widget. |
939 bool focus_on_creation_; | 922 bool focus_on_creation_; |
940 | 923 |
941 mutable scoped_ptr<InputMethod> input_method_; | |
942 | |
943 // See |is_top_level()| accessor. | 924 // See |is_top_level()| accessor. |
944 bool is_top_level_; | 925 bool is_top_level_; |
945 | 926 |
946 // Tracks whether native widget has been initialized. | 927 // Tracks whether native widget has been initialized. |
947 bool native_widget_initialized_; | 928 bool native_widget_initialized_; |
948 | 929 |
949 // Whether native widget has been destroyed. | 930 // Whether native widget has been destroyed. |
950 bool native_widget_destroyed_; | 931 bool native_widget_destroyed_; |
951 | 932 |
952 // TODO(beng): Remove NativeWidgetGtk's dependence on these: | 933 // TODO(beng): Remove NativeWidgetGtk's dependence on these: |
(...skipping 25 matching lines...) Expand all Loading... |
978 bool movement_disabled_; | 959 bool movement_disabled_; |
979 | 960 |
980 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; | 961 ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_; |
981 | 962 |
982 DISALLOW_COPY_AND_ASSIGN(Widget); | 963 DISALLOW_COPY_AND_ASSIGN(Widget); |
983 }; | 964 }; |
984 | 965 |
985 } // namespace views | 966 } // namespace views |
986 | 967 |
987 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 968 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |