Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / mojo / views / native_widget_view_manager.h
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 ui {
13 namespace internal {
14 class InputMethodDelegate;
15 }
16 }
17
18 namespace wm {
19 class FocusController;
20 class ScopedCaptureClient;
21 }
22
23 namespace mojo {
24
25 class WindowTreeHostMojo;
26
27 class NativeWidgetViewManager : public views::NativeWidgetAura,
28                                 public WindowTreeHostMojoDelegate,
29                                 public ViewObserver {
30  public:
31   NativeWidgetViewManager(views::internal::NativeWidgetDelegate* delegate,
32                           View* view);
33   virtual ~NativeWidgetViewManager();
34
35  private:
36   // Overridden from internal::NativeWidgetAura:
37   virtual void InitNativeWidget(
38       const views::Widget::InitParams& in_params) OVERRIDE;
39
40   // WindowTreeHostMojoDelegate:
41   virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE;
42
43   // ViewObserver:
44   virtual void OnViewDestroyed(View* view) OVERRIDE;
45   virtual void OnViewBoundsChanged(View* view,
46                                    const gfx::Rect& old_bounds,
47                                    const gfx::Rect& new_bounds) OVERRIDE;
48   virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE;
49
50   scoped_ptr<WindowTreeHostMojo> window_tree_host_;
51
52   scoped_ptr<wm::FocusController> focus_client_;
53
54   scoped_ptr<ui::internal::InputMethodDelegate> ime_filter_;
55
56   View* view_;
57
58   scoped_ptr<wm::ScopedCaptureClient> capture_client_;
59
60   DISALLOW_COPY_AND_ASSIGN(NativeWidgetViewManager);
61 };
62
63 }  // namespace mojo
64
65 #endif  // MOJO_VIEWS_NATIVE_WIDGET_VIEW_MANAGER_H_