OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_APP_WINDOW_FRAME_VIEW_H_ | 5 #ifndef APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ |
6 #define APPS_UI_VIEWS_APP_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 "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 namespace apps { | 33 namespace apps { |
34 | 34 |
35 class NativeAppWindow; | 35 class NativeAppWindow; |
36 | 36 |
37 // A frameless or non-Ash, non-panel NonClientFrameView for app windows. | 37 // A frameless or non-Ash, non-panel NonClientFrameView for app windows. |
38 class AppWindowFrameView : public views::NonClientFrameView, | 38 class AppWindowFrameView : public views::NonClientFrameView, |
39 public views::ButtonListener { | 39 public views::ButtonListener { |
40 public: | 40 public: |
41 static const char kViewClassName[]; | 41 static const char kViewClassName[]; |
42 | 42 |
43 explicit AppWindowFrameView(); | 43 // AppWindowFrameView is used to draw frames for app windows when a non |
44 // standard frame is needed. This occurs if there is no frame needed, or if | |
45 // there is a frame color. | |
46 // If |draw_frame| is true, the view draws its own window title area and | |
47 // controls, using |frame_color|. If |draw_frame| is not true, no frame is | |
48 // drawn. | |
49 // TODO(benwells): Refactor this to split out frameless and colored frame | |
50 // views. See http://crbug.com/359432. | |
51 AppWindowFrameView(views::Widget* widget, | |
tapted
2014/04/03 19:40:24
I think the separate Init(..) is the prevailing st
benwells
2014/04/04 06:50:43
Done.
| |
52 NativeAppWindow* window, | |
53 bool draw_frame, | |
54 const SkColor& frame_color); | |
44 virtual ~AppWindowFrameView(); | 55 virtual ~AppWindowFrameView(); |
45 | 56 |
46 // Initializes this for |widget|. Sets the number of pixels for which a click | 57 void SetResizeSizes(int resize_inside_bounds_size, |
47 // is interpreted as a resize for the inner and outer border of the window | 58 int resize_outside_bounds_size, |
48 // and the lower-right corner resize handle. If |draw_frame|, the view draws | 59 int resize_area_corner_size); |
49 // its own window title area and controls, using |frame_color| (otherwise | 60 int resize_inside_bounds_size() { |
tapted
2014/04/03 19:40:24
nit: const method?
benwells
2014/04/04 06:50:43
Done.
| |
50 // |frame_color| is ignored). | 61 return resize_inside_bounds_size_; |
51 void Init(views::Widget* widget, | 62 }; |
52 NativeAppWindow* window, | |
53 bool draw_frame, | |
54 const SkColor& frame_color, | |
55 int resize_inside_bounds_size, | |
56 int resize_outside_bounds_size, | |
57 int resize_outside_scale_for_touch, | |
58 int resize_area_corner_size); | |
59 | 63 |
60 private: | 64 private: |
61 // views::NonClientFrameView implementation. | 65 // views::NonClientFrameView implementation. |
62 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 66 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
63 virtual gfx::Rect GetWindowBoundsForClientBounds( | 67 virtual gfx::Rect GetWindowBoundsForClientBounds( |
64 const gfx::Rect& client_bounds) const OVERRIDE; | 68 const gfx::Rect& client_bounds) const OVERRIDE; |
65 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 69 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
66 virtual void GetWindowMask(const gfx::Size& size, | 70 virtual void GetWindowMask(const gfx::Size& size, |
67 gfx::Path* window_mask) OVERRIDE; | 71 gfx::Path* window_mask) OVERRIDE; |
68 virtual void ResetWindowControls() OVERRIDE {} | 72 virtual void ResetWindowControls() OVERRIDE {} |
(...skipping 29 matching lines...) Expand all Loading... | |
98 | 102 |
99 // Size in pixels of the lower-right corner resize handle. | 103 // Size in pixels of the lower-right corner resize handle. |
100 int resize_area_corner_size_; | 104 int resize_area_corner_size_; |
101 | 105 |
102 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); | 106 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); |
103 }; | 107 }; |
104 | 108 |
105 } // namespace apps | 109 } // namespace apps |
106 | 110 |
107 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ | 111 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ |
OLD | NEW |