1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef MOJO_VIEWS_NATIVE_WIDGET_VIEW_MANAGER_H_ 6 #define MOJO_VIEWS_NATIVE_WIDGET_VIEW_MANAGER_H_ 7 8 #include "mojo/aura/window_tree_host_mojo_delegate.h" 9 #include "mojo/services/public/cpp/view_manager/view_observer.h" 10 #include "ui/views/widget/native_widget_aura.h" 11 12 namespace aura { 13 namespace client { 14 class DefaultCaptureClient; 15 } 16 } 17 18 namespace ui { 19 namespace internal { 20 class InputMethodDelegate; 21 } 22 } 23 24 namespace wm { 25 class FocusController; 26 } 27 28 namespace mojo { 29 30 class WindowTreeHostMojo; 31 32 class NativeWidgetViewManager : public views::NativeWidgetAura, 33 public WindowTreeHostMojoDelegate, 34 public ViewObserver { 35 public: 36 NativeWidgetViewManager(views::internal::NativeWidgetDelegate* delegate, 37 View* view); 38 virtual ~NativeWidgetViewManager(); 39 40 private: 41 // Overridden from internal::NativeWidgetAura: 42 virtual void InitNativeWidget( 43 const views::Widget::InitParams& in_params) OVERRIDE; 44 45 // WindowTreeHostMojoDelegate: 46 virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE; 47 48 // ViewObserver: 49 virtual void OnViewDestroyed(View* view) OVERRIDE; 50 virtual void OnViewBoundsChanged(View* view, 51 const gfx::Rect& old_bounds, 52 const gfx::Rect& new_bounds) OVERRIDE; 53 virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE; 54 55 scoped_ptr<WindowTreeHostMojo> window_tree_host_; 56 57 scoped_ptr<wm::FocusController> focus_client_; 58 59 scoped_ptr<ui::internal::InputMethodDelegate> ime_filter_; 60 61 View* view_; 62 63 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; 64 65 DISALLOW_COPY_AND_ASSIGN(NativeWidgetViewManager); 66 }; 67 68 } // namespace mojo 69 70 #endif // MOJO_VIEWS_NATIVE_WIDGET_VIEW_MANAGER_H_ 71