Chromium Code Reviews| Index: ui/views/widget/desktop_native_widget_helper_aura.h |
| diff --git a/ui/views/widget/desktop_native_widget_helper_aura.h b/ui/views/widget/desktop_native_widget_helper_aura.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ff556216b22edd15269b4a9bc8d20caffa95d9a2 |
| --- /dev/null |
| +++ b/ui/views/widget/desktop_native_widget_helper_aura.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_VIEWS_WIDGET_DESKTOP_NATIVE_WIDGET_HELPER_AURA_H_ |
| +#define UI_VIEWS_WIDGET_DESKTOP_NATIVE_WIDGET_HELPER_AURA_H_ |
| +#pragma once |
| + |
| +#include "ui/aura/root_window_observer.h" |
| +#include "ui/gfx/rect.h" |
| +#include "ui/views/widget/widget.h" |
| + |
| +namespace aura { |
| +class RootWindow; |
| +} |
| + |
| +namespace views { |
| +class NativeWidgetAura; |
| + |
| +// TODO(erg): Rename file and document |
| +class DesktopNatitveWidgetHelperAura : public aura::RootWindowObserver { |
| + public: |
| + DesktopNatitveWidgetHelperAura(NativeWidgetAura* widget); |
|
Ben Goodger (Google)
2012/04/17 15:42:55
explicit
Native
|
| + ~DesktopNatitveWidgetHelperAura(); |
| + |
| + aura::RootWindow* root_window() { return root_window_.get(); } |
| + |
| + // Called at the start of InitNativeWidget; determines whether we should |
| + // set up a root_window_ for this widget. |
| + void PreInitialize(const Widget::InitParams& params); |
| + |
| + // Passes through a message to show the RootWindow, if it exists. |
| + void ShowRootWindow(); |
| + |
| + // If this NativeWidgetAura has its own RootWindow, sets the position at the |
| + // |root_window_|, and returns modified bounds to set the origin to |
| + // zero. Otherwise, pass through in_bounds. |
|
Ben Goodger (Google)
2012/04/17 15:42:55
Otherwise, returns |bounds|.
|
| + gfx::Rect ModifyAndSetBounds(gfx::Rect bounds); |
| + |
| + // Overridden from aura::RootWindowObserver: |
| + virtual void OnRootWindowResized(const aura::RootWindow* root, |
| + const gfx::Size& old_size) OVERRIDE; |
| + virtual void OnRootWindowHostClosed(const aura::RootWindow* root) OVERRIDE; |
| + |
| + private: |
| + // A weak pointer back to our owning widget. |
| + NativeWidgetAura* widget_; |
| + |
| + // Optionally, a RootWindow that we attach ourselves to. |
| + scoped_ptr<aura::RootWindow> root_window_; |
| +}; |
|
Ben Goodger (Google)
2012/04/17 15:42:55
DISALLOW_COP
|
| + |
| +} // namespace views |
| + |
| +#endif // UI_VIEWS_WIDGET_DESKTOP_NATIVE_WIDGET_HELPER_AURA_H_ |