| 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_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |    5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 
|    6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |    6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 
|    7  |    7  | 
|    8 #include "base/memory/weak_ptr.h" |    8 #include "base/memory/weak_ptr.h" | 
|    9 #include "ui/aura/client/activation_change_observer.h" |    9 #include "ui/aura/client/activation_change_observer.h" | 
|   10 #include "ui/aura/client/activation_delegate.h" |   10 #include "ui/aura/client/activation_delegate.h" | 
|   11 #include "ui/aura/client/drag_drop_delegate.h" |   11 #include "ui/aura/client/drag_drop_delegate.h" | 
|   12 #include "ui/aura/client/focus_change_observer.h" |   12 #include "ui/aura/client/focus_change_observer.h" | 
|   13 #include "ui/aura/window_delegate.h" |   13 #include "ui/aura/window_delegate.h" | 
|   14 #include "ui/aura/window_tree_host_observer.h" |   14 #include "ui/aura/window_tree_host_observer.h" | 
|   15 #include "ui/base/cursor/cursor.h" |   15 #include "ui/base/cursor/cursor.h" | 
|   16 #include "ui/views/ime/input_method_delegate.h" |   16 #include "ui/views/ime/input_method_delegate.h" | 
|   17 #include "ui/views/widget/native_widget_private.h" |   17 #include "ui/views/widget/native_widget_private.h" | 
 |   18 #include "ui/wm/core/compound_event_filter.h" | 
|   18  |   19  | 
|   19 namespace aura { |   20 namespace aura { | 
|   20 class WindowEventDispatcher; |   21 class WindowEventDispatcher; | 
|   21 class WindowTreeHost; |   22 class WindowTreeHost; | 
|   22 namespace client { |   23 namespace client { | 
|   23 class DragDropClient; |   24 class DragDropClient; | 
|   24 class FocusClient; |   25 class FocusClient; | 
|   25 class ScreenPositionClient; |   26 class ScreenPositionClient; | 
|   26 class WindowTreeClient; |   27 class WindowTreeClient; | 
|   27 } |   28 } | 
|   28 } |   29 } | 
|   29  |   30  | 
|   30 namespace views { |   31 namespace wm { | 
|   31  |  | 
|   32 namespace corewm { |  | 
|   33 class CompoundEventFilter; |   32 class CompoundEventFilter; | 
|   34 class CursorManager; |   33 class CursorManager; | 
|   35 class FocusController; |   34 class FocusController; | 
|   36 class InputMethodEventFilter; |   35 class InputMethodEventFilter; | 
|   37 class ShadowController; |   36 class ShadowController; | 
|   38 class TooltipController; |  | 
|   39 class VisibilityController; |   37 class VisibilityController; | 
|   40 class WindowModalityController; |   38 class WindowModalityController; | 
|   41 } |   39 } | 
|   42  |   40  | 
 |   41 namespace views { | 
 |   42 namespace corewm { | 
 |   43 class TooltipController; | 
 |   44 } | 
|   43 class DesktopCaptureClient; |   45 class DesktopCaptureClient; | 
|   44 class DesktopDispatcherClient; |   46 class DesktopDispatcherClient; | 
|   45 class DesktopEventClient; |   47 class DesktopEventClient; | 
|   46 class DesktopNativeCursorManager; |   48 class DesktopNativeCursorManager; | 
|   47 class DesktopWindowTreeHost; |   49 class DesktopWindowTreeHost; | 
|   48 class DropHelper; |   50 class DropHelper; | 
|   49 class FocusManagerEventHandler; |   51 class FocusManagerEventHandler; | 
|   50 class TooltipManagerAura; |   52 class TooltipManagerAura; | 
|   51 class WindowReorderer; |   53 class WindowReorderer; | 
|   52  |   54  | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
|   70   // Called by our DesktopWindowTreeHost after it has deleted native resources; |   72   // Called by our DesktopWindowTreeHost after it has deleted native resources; | 
|   71   // this is the signal that we should start our shutdown. |   73   // this is the signal that we should start our shutdown. | 
|   72   virtual void OnHostClosed(); |   74   virtual void OnHostClosed(); | 
|   73  |   75  | 
|   74   // TODO(beng): remove this method and replace with an implementation of |   76   // TODO(beng): remove this method and replace with an implementation of | 
|   75   //             WindowDestroying() that takes the window being destroyed. |   77   //             WindowDestroying() that takes the window being destroyed. | 
|   76   // Called from ~DesktopWindowTreeHost. This takes the WindowEventDispatcher |   78   // Called from ~DesktopWindowTreeHost. This takes the WindowEventDispatcher | 
|   77   // as by the time we get here |dispatcher_| is NULL. |   79   // as by the time we get here |dispatcher_| is NULL. | 
|   78   virtual void OnDesktopWindowTreeHostDestroyed(aura::WindowTreeHost* host); |   80   virtual void OnDesktopWindowTreeHostDestroyed(aura::WindowTreeHost* host); | 
|   79  |   81  | 
|   80   corewm::InputMethodEventFilter* input_method_event_filter() { |   82   wm::InputMethodEventFilter* input_method_event_filter() { | 
|   81     return input_method_event_filter_.get(); |   83     return input_method_event_filter_.get(); | 
|   82   } |   84   } | 
|   83   corewm::CompoundEventFilter* root_window_event_filter() { |   85   wm::CompoundEventFilter* root_window_event_filter() { | 
|   84     return root_window_event_filter_; |   86     return root_window_event_filter_; | 
|   85   } |   87   } | 
|   86   aura::WindowTreeHost* host() { |   88   aura::WindowTreeHost* host() { | 
|   87     return host_.get(); |   89     return host_.get(); | 
|   88   } |   90   } | 
|   89  |   91  | 
|   90   // Overridden from NativeWidget: |   92   // Overridden from NativeWidget: | 
|   91   virtual ui::EventHandler* GetEventHandler() OVERRIDE; |   93   virtual ui::EventHandler* GetEventHandler() OVERRIDE; | 
|   92  |   94  | 
|   93   // Ensures that the correct window is activated/deactivated based on whether |   95   // Ensures that the correct window is activated/deactivated based on whether | 
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  265   // Child of the root, contains |content_window_|. |  267   // Child of the root, contains |content_window_|. | 
|  266   aura::Window* content_window_container_; |  268   aura::Window* content_window_container_; | 
|  267  |  269  | 
|  268   // Child of |content_window_container_|. This is the return value from |  270   // Child of |content_window_container_|. This is the return value from | 
|  269   // GetNativeView(). |  271   // GetNativeView(). | 
|  270   // WARNING: this may be NULL, in particular during shutdown it becomes NULL. |  272   // WARNING: this may be NULL, in particular during shutdown it becomes NULL. | 
|  271   aura::Window* content_window_; |  273   aura::Window* content_window_; | 
|  272  |  274  | 
|  273   internal::NativeWidgetDelegate* native_widget_delegate_; |  275   internal::NativeWidgetDelegate* native_widget_delegate_; | 
|  274  |  276  | 
|  275   scoped_ptr<corewm::FocusController> focus_client_; |  277   scoped_ptr<wm::FocusController> focus_client_; | 
|  276   scoped_ptr<DesktopDispatcherClient> dispatcher_client_; |  278   scoped_ptr<DesktopDispatcherClient> dispatcher_client_; | 
|  277   scoped_ptr<aura::client::ScreenPositionClient> position_client_; |  279   scoped_ptr<aura::client::ScreenPositionClient> position_client_; | 
|  278   scoped_ptr<aura::client::DragDropClient> drag_drop_client_; |  280   scoped_ptr<aura::client::DragDropClient> drag_drop_client_; | 
|  279   scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; |  281   scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; | 
|  280   scoped_ptr<DesktopEventClient> event_client_; |  282   scoped_ptr<DesktopEventClient> event_client_; | 
|  281   scoped_ptr<FocusManagerEventHandler> focus_manager_event_handler_; |  283   scoped_ptr<FocusManagerEventHandler> focus_manager_event_handler_; | 
|  282  |  284  | 
|  283   // Toplevel event filter which dispatches to other event filters. |  285   // Toplevel event filter which dispatches to other event filters. | 
|  284   corewm::CompoundEventFilter* root_window_event_filter_; |  286   wm::CompoundEventFilter* root_window_event_filter_; | 
|  285  |  287  | 
|  286   scoped_ptr<corewm::InputMethodEventFilter> input_method_event_filter_; |  288   scoped_ptr<wm::InputMethodEventFilter> input_method_event_filter_; | 
|  287  |  289  | 
|  288   scoped_ptr<DropHelper> drop_helper_; |  290   scoped_ptr<DropHelper> drop_helper_; | 
|  289   int last_drop_operation_; |  291   int last_drop_operation_; | 
|  290  |  292  | 
|  291   scoped_ptr<corewm::TooltipController> tooltip_controller_; |  293   scoped_ptr<corewm::TooltipController> tooltip_controller_; | 
|  292   scoped_ptr<TooltipManagerAura> tooltip_manager_; |  294   scoped_ptr<TooltipManagerAura> tooltip_manager_; | 
|  293  |  295  | 
|  294   scoped_ptr<views::corewm::VisibilityController> visibility_controller_; |  296   scoped_ptr<wm::VisibilityController> visibility_controller_; | 
|  295  |  297  | 
|  296   scoped_ptr<views::corewm::WindowModalityController> |  298   scoped_ptr<wm::WindowModalityController> | 
|  297       window_modality_controller_; |  299       window_modality_controller_; | 
|  298  |  300  | 
|  299   // See comments in OnLostActive(). |  301   // See comments in OnLostActive(). | 
|  300   bool restore_focus_on_activate_; |  302   bool restore_focus_on_activate_; | 
|  301  |  303  | 
|  302   gfx::NativeCursor cursor_; |  304   gfx::NativeCursor cursor_; | 
|  303   // We must manually reference count the number of users of |cursor_manager_| |  305   // We must manually reference count the number of users of |cursor_manager_| | 
|  304   // because the cursors created by |cursor_manager_| are shared among the |  306   // because the cursors created by |cursor_manager_| are shared among the | 
|  305   // DNWAs. We can't just stuff this in a LazyInstance because we need to |  307   // DNWAs. We can't just stuff this in a LazyInstance because we need to | 
|  306   // destroy this as the last DNWA happens; we can't put it off until |  308   // destroy this as the last DNWA happens; we can't put it off until | 
|  307   // (potentially) after we tear down the X11 connection because that's a |  309   // (potentially) after we tear down the X11 connection because that's a | 
|  308   // crash. |  310   // crash. | 
|  309   static int cursor_reference_count_; |  311   static int cursor_reference_count_; | 
|  310   static views::corewm::CursorManager* cursor_manager_; |  312   static wm::CursorManager* cursor_manager_; | 
|  311   static views::DesktopNativeCursorManager* native_cursor_manager_; |  313   static views::DesktopNativeCursorManager* native_cursor_manager_; | 
|  312  |  314  | 
|  313   scoped_ptr<corewm::ShadowController> shadow_controller_; |  315   scoped_ptr<wm::ShadowController> shadow_controller_; | 
|  314  |  316  | 
|  315   // Reorders child windows of |window_| associated with a view based on the |  317   // Reorders child windows of |window_| associated with a view based on the | 
|  316   // order of the associated views in the widget's view hierarchy. |  318   // order of the associated views in the widget's view hierarchy. | 
|  317   scoped_ptr<WindowReorderer> window_reorderer_; |  319   scoped_ptr<WindowReorderer> window_reorderer_; | 
|  318  |  320  | 
|  319   // See class documentation for Widget in widget.h for a note about type. |  321   // See class documentation for Widget in widget.h for a note about type. | 
|  320   Widget::InitParams::Type widget_type_; |  322   Widget::InitParams::Type widget_type_; | 
|  321  |  323  | 
|  322   DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); |  324   DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAura); | 
|  323 }; |  325 }; | 
|  324  |  326  | 
|  325 }  // namespace views |  327 }  // namespace views | 
|  326  |  328  | 
|  327 #endif  // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ |  329 #endif  // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_WIDGET_AURA_H_ | 
| OLD | NEW |