OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 ASH_SHELL_TOPLEVEL_WINDOW_H_ | 5 #ifndef ASH_SHELL_TOPLEVEL_WINDOW_H_ |
6 #define ASH_SHELL_TOPLEVEL_WINDOW_H_ | 6 #define ASH_SHELL_TOPLEVEL_WINDOW_H_ |
7 | 7 |
8 #include "ui/views/widget/widget_delegate.h" | 8 #include "ui/views/widget/widget_delegate.h" |
9 | 9 |
10 namespace ash { | 10 namespace ash { |
11 namespace shell { | 11 namespace shell { |
12 | 12 |
13 class ToplevelWindow : public views::WidgetDelegateView { | 13 class ToplevelWindow : public views::WidgetDelegateView { |
14 public: | 14 public: |
15 struct CreateParams { | 15 struct CreateParams { |
16 CreateParams(); | 16 CreateParams(); |
17 | 17 |
18 bool can_resize; | 18 bool can_resize; |
19 bool can_maximize; | 19 bool can_maximize; |
20 }; | 20 }; |
21 static views::Widget* CreateToplevelWindow( | 21 static views::Widget* CreateToplevelWindow( |
22 const CreateParams& params); | 22 const CreateParams& params); |
23 | 23 |
24 // Clears saved show state and bounds used to position | 24 // Clears saved show state and bounds used to position |
25 // a new window. | 25 // a new window. |
26 static void ClearSavedStateForTest(); | 26 static void ClearSavedStateForTest(); |
27 | 27 |
28 private: | 28 private: |
29 explicit ToplevelWindow(const CreateParams& params); | 29 explicit ToplevelWindow(const CreateParams& params); |
30 virtual ~ToplevelWindow(); | 30 ~ToplevelWindow() override; |
31 | 31 |
32 // Overridden from views::View: | 32 // Overridden from views::View: |
33 virtual void OnPaint(gfx::Canvas* canvas) override; | 33 void OnPaint(gfx::Canvas* canvas) override; |
34 | 34 |
35 // Overridden from views::WidgetDelegate: | 35 // Overridden from views::WidgetDelegate: |
36 virtual base::string16 GetWindowTitle() const override; | 36 base::string16 GetWindowTitle() const override; |
37 virtual void SaveWindowPlacement( | 37 void SaveWindowPlacement(const gfx::Rect& bounds, |
38 const gfx::Rect& bounds, | 38 ui::WindowShowState show_state) override; |
39 ui::WindowShowState show_state) override; | 39 bool GetSavedWindowPlacement(const views::Widget* widget, |
40 virtual bool GetSavedWindowPlacement( | 40 gfx::Rect* bounds, |
41 const views::Widget* widget, | 41 ui::WindowShowState* show_state) const override; |
42 gfx::Rect* bounds, | 42 View* GetContentsView() override; |
43 ui::WindowShowState* show_state) const override; | 43 bool CanResize() const override; |
44 virtual View* GetContentsView() override; | 44 bool CanMaximize() const override; |
45 virtual bool CanResize() const override; | 45 bool CanMinimize() const override; |
46 virtual bool CanMaximize() const override; | |
47 virtual bool CanMinimize() const override; | |
48 | 46 |
49 const CreateParams params_; | 47 const CreateParams params_; |
50 | 48 |
51 DISALLOW_COPY_AND_ASSIGN(ToplevelWindow); | 49 DISALLOW_COPY_AND_ASSIGN(ToplevelWindow); |
52 }; | 50 }; |
53 | 51 |
54 } // namespace shell | 52 } // namespace shell |
55 } // namespace ash | 53 } // namespace ash |
56 | 54 |
57 #endif // ASH_SHELL_TOPLEVEL_WINDOW_H_ | 55 #endif // ASH_SHELL_TOPLEVEL_WINDOW_H_ |
OLD | NEW |