| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_NATIVE_WIDGET_HELPER_AURA_H_ | |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_NATIVE_WIDGET_HELPER_AURA_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ui/aura/root_window_observer.h" | |
| 10 #include "ui/gfx/rect.h" | |
| 11 #include "ui/views/views_export.h" | |
| 12 #include "ui/views/widget/native_widget_helper_aura.h" | |
| 13 #include "ui/views/widget/widget.h" | |
| 14 | |
| 15 namespace aura { | |
| 16 class RootWindow; | |
| 17 } | |
| 18 | |
| 19 namespace views { | |
| 20 class NativeWidgetAura; | |
| 21 | |
| 22 // Implementation of non-Ash desktop integration code, allowing | |
| 23 // NativeWidgetAuras to work in a traditional desktop environment. | |
| 24 class VIEWS_EXPORT DesktopNativeWidgetHelperAura | |
| 25 : public NativeWidgetHelperAura, | |
| 26 public aura::RootWindowObserver { | |
| 27 public: | |
| 28 explicit DesktopNativeWidgetHelperAura(NativeWidgetAura* widget); | |
| 29 virtual ~DesktopNativeWidgetHelperAura(); | |
| 30 | |
| 31 // Overridden from aura::NativeWidgetHelperAura: | |
| 32 virtual void PreInitialize(const Widget::InitParams& params) OVERRIDE; | |
| 33 virtual void ShowRootWindow() OVERRIDE; | |
| 34 virtual aura::RootWindow* GetRootWindow() OVERRIDE; | |
| 35 virtual gfx::Rect ModifyAndSetBounds(gfx::Rect bounds) OVERRIDE; | |
| 36 | |
| 37 // Overridden from aura::RootWindowObserver: | |
| 38 virtual void OnRootWindowResized(const aura::RootWindow* root, | |
| 39 const gfx::Size& old_size) OVERRIDE; | |
| 40 virtual void OnRootWindowHostClosed(const aura::RootWindow* root) OVERRIDE; | |
| 41 | |
| 42 private: | |
| 43 // A weak pointer back to our owning widget. | |
| 44 NativeWidgetAura* widget_; | |
| 45 | |
| 46 // Optionally, a RootWindow that we attach ourselves to. | |
| 47 scoped_ptr<aura::RootWindow> root_window_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetHelperAura); | |
| 50 }; | |
| 51 | |
| 52 } // namespace views | |
| 53 | |
| 54 #endif // UI_VIEWS_WIDGET_DESKTOP_NATIVE_WIDGET_HELPER_AURA_H_ | |
| OLD | NEW |