OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_WIDGET_NATIVE_WINDOW_H_ | 5 #ifndef VIEWS_WIDGET_NATIVE_WINDOW_H_ |
6 #define VIEWS_WIDGET_NATIVE_WINDOW_H_ | 6 #define VIEWS_WIDGET_NATIVE_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/accessibility/accessibility_types.h" | 9 #include "ui/base/accessibility/accessibility_types.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class NativeWidget; | 22 class NativeWidget; |
23 class NonClientFrameView; | 23 class NonClientFrameView; |
24 | 24 |
25 //////////////////////////////////////////////////////////////////////////////// | 25 //////////////////////////////////////////////////////////////////////////////// |
26 // NativeWindow interface | 26 // NativeWindow interface |
27 // | 27 // |
28 // An interface implemented by an object that encapsulates a native window. | 28 // An interface implemented by an object that encapsulates a native window. |
29 // | 29 // |
30 class NativeWindow { | 30 class NativeWindow { |
31 public: | 31 public: |
32 enum ShowState { | |
33 SHOW_RESTORED, | |
34 SHOW_MAXIMIZED, | |
35 SHOW_INACTIVE | |
36 }; | |
37 | |
38 virtual ~NativeWindow() {} | 32 virtual ~NativeWindow() {} |
39 | 33 |
40 // Creates an appropriate default NativeWindow implementation for the current | 34 // Creates an appropriate default NativeWindow implementation for the current |
41 // OS/circumstance. | 35 // OS/circumstance. |
42 static NativeWindow* CreateNativeWindow( | 36 static NativeWindow* CreateNativeWindow( |
43 internal::NativeWindowDelegate* delegate); | 37 internal::NativeWindowDelegate* delegate); |
44 | 38 |
45 virtual Window* GetWindow() = 0; | 39 virtual Window* GetWindow() = 0; |
46 virtual const Window* GetWindow() const = 0; | 40 virtual const Window* GetWindow() const = 0; |
47 | 41 |
48 virtual NativeWidget* AsNativeWidget() = 0; | 42 virtual NativeWidget* AsNativeWidget() = 0; |
49 virtual const NativeWidget* AsNativeWidget() const = 0; | 43 virtual const NativeWidget* AsNativeWidget() const = 0; |
50 | 44 |
51 protected: | 45 protected: |
52 friend class Window; | 46 friend class Window; |
53 | 47 |
54 // Returns the bounds of the window in screen coordinates for its non- | |
55 // maximized state, regardless of whether or not it is currently maximized. | |
56 virtual gfx::Rect GetRestoredBounds() const = 0; | |
57 | |
58 // Shows the window. | |
59 virtual void ShowNativeWindow(ShowState state) = 0; | |
60 | |
61 // Makes the NativeWindow modal. | 48 // Makes the NativeWindow modal. |
62 virtual void BecomeModal() = 0; | 49 virtual void BecomeModal() = 0; |
63 | |
64 // Enables or disables the close button for the window. | |
65 virtual void EnableClose(bool enable) = 0; | |
66 }; | 50 }; |
67 | 51 |
68 } // namespace views | 52 } // namespace views |
69 | 53 |
70 #endif // VIEWS_WIDGET_NATIVE_WINDOW_H_ | 54 #endif // VIEWS_WIDGET_NATIVE_WINDOW_H_ |
OLD | NEW |