OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 APPS_UI_VIEWS_SHELL_WINDOW_FRAME_VIEW_H_ | 5 #ifndef APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ |
6 #define APPS_UI_VIEWS_SHELL_WINDOW_FRAME_VIEW_H_ | 6 #define APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ui/gfx/path.h" | 10 #include "ui/gfx/path.h" |
11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
13 #include "ui/views/controls/button/button.h" | 13 #include "ui/views/controls/button/button.h" |
14 #include "ui/views/window/non_client_view.h" | 14 #include "ui/views/window/non_client_view.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Canvas; | 17 class Canvas; |
18 class Point; | 18 class Point; |
19 } | 19 } |
20 | 20 |
21 namespace ui { | 21 namespace ui { |
22 class Event; | 22 class Event; |
23 } | 23 } |
24 | 24 |
25 namespace views { | 25 namespace views { |
26 class ImageButton; | 26 class ImageButton; |
27 class Widget; | 27 class Widget; |
28 } | 28 } |
29 | 29 |
30 namespace apps { | 30 namespace apps { |
31 | 31 |
32 class NativeAppWindow; | 32 class NativeAppWindow; |
33 | 33 |
34 // A frameless or non-Ash, non-panel NonClientFrameView for app windows. | 34 // A frameless or non-Ash, non-panel NonClientFrameView for app windows. |
35 class ShellWindowFrameView : public views::NonClientFrameView, | 35 class AppWindowFrameView : public views::NonClientFrameView, |
36 public views::ButtonListener { | 36 public views::ButtonListener { |
37 public: | 37 public: |
38 static const char kViewClassName[]; | 38 static const char kViewClassName[]; |
39 | 39 |
40 explicit ShellWindowFrameView(NativeAppWindow* window); | 40 explicit AppWindowFrameView(NativeAppWindow* window); |
41 virtual ~ShellWindowFrameView(); | 41 virtual ~AppWindowFrameView(); |
42 | 42 |
43 // Initializes this for the window |frame|. Sets the number of pixels for | 43 // Initializes this for the window |frame|. Sets the number of pixels for |
44 // which a click is interpreted as a resize for the inner and outer border of | 44 // which a click is interpreted as a resize for the inner and outer border of |
45 // the window and the lower-right corner resize handle. | 45 // the window and the lower-right corner resize handle. |
46 void Init(views::Widget* frame, | 46 void Init(views::Widget* frame, |
47 int resize_inside_bounds_size, | 47 int resize_inside_bounds_size, |
48 int resize_outside_bounds_size, | 48 int resize_outside_bounds_size, |
49 int resize_outside_scale_for_touch, | 49 int resize_outside_scale_for_touch, |
50 int resize_area_corner_size); | 50 int resize_area_corner_size); |
51 | 51 |
(...skipping 11 matching lines...) Expand all Loading... |
63 | 63 |
64 // views::View implementation. | 64 // views::View implementation. |
65 virtual gfx::Size GetPreferredSize() OVERRIDE; | 65 virtual gfx::Size GetPreferredSize() OVERRIDE; |
66 virtual void Layout() OVERRIDE; | 66 virtual void Layout() OVERRIDE; |
67 virtual const char* GetClassName() const OVERRIDE; | 67 virtual const char* GetClassName() const OVERRIDE; |
68 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 68 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
69 virtual gfx::Size GetMinimumSize() OVERRIDE; | 69 virtual gfx::Size GetMinimumSize() OVERRIDE; |
70 virtual gfx::Size GetMaximumSize() OVERRIDE; | 70 virtual gfx::Size GetMaximumSize() OVERRIDE; |
71 | 71 |
72 // views::ButtonListener implementation. | 72 // views::ButtonListener implementation. |
73 virtual void ButtonPressed(views::Button* sender, const ui::Event& event) | 73 virtual void ButtonPressed(views::Button* sender, |
74 OVERRIDE; | 74 const ui::Event& event) OVERRIDE; |
75 | 75 |
76 NativeAppWindow* window_; | 76 NativeAppWindow* window_; |
77 views::Widget* frame_; | 77 views::Widget* frame_; |
78 views::ImageButton* close_button_; | 78 views::ImageButton* close_button_; |
79 views::ImageButton* maximize_button_; | 79 views::ImageButton* maximize_button_; |
80 views::ImageButton* restore_button_; | 80 views::ImageButton* restore_button_; |
81 views::ImageButton* minimize_button_; | 81 views::ImageButton* minimize_button_; |
82 | 82 |
83 // Allow resize for clicks this many pixels inside the bounds. | 83 // Allow resize for clicks this many pixels inside the bounds. |
84 int resize_inside_bounds_size_; | 84 int resize_inside_bounds_size_; |
85 | 85 |
86 // Allow resize for clicks this many pixels outside the bounds. | 86 // Allow resize for clicks this many pixels outside the bounds. |
87 int resize_outside_bounds_size_; | 87 int resize_outside_bounds_size_; |
88 | 88 |
89 // Size in pixels of the lower-right corner resize handle. | 89 // Size in pixels of the lower-right corner resize handle. |
90 int resize_area_corner_size_; | 90 int resize_area_corner_size_; |
91 | 91 |
92 DISALLOW_COPY_AND_ASSIGN(ShellWindowFrameView); | 92 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); |
93 }; | 93 }; |
94 | 94 |
95 } // namespace apps | 95 } // namespace apps |
96 | 96 |
97 #endif // APPS_UI_VIEWS_SHELL_WINDOW_FRAME_VIEW_H_ | 97 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ |
OLD | NEW |