| 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 "ui/gfx/path.h" | 10 #include "ui/gfx/path.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 static const char kViewClassName[]; | 38 static const char kViewClassName[]; |
| 39 | 39 |
| 40 explicit AppWindowFrameView(NativeAppWindow* window); | 40 explicit AppWindowFrameView(NativeAppWindow* window); |
| 41 virtual ~AppWindowFrameView(); | 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 const SkColor& frame_color, |
| 47 int resize_inside_bounds_size, | 48 int resize_inside_bounds_size, |
| 48 int resize_outside_bounds_size, | 49 int resize_outside_bounds_size, |
| 49 int resize_outside_scale_for_touch, | 50 int resize_outside_scale_for_touch, |
| 50 int resize_area_corner_size); | 51 int resize_area_corner_size); |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 // views::NonClientFrameView implementation. | 54 // views::NonClientFrameView implementation. |
| 54 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 55 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
| 55 virtual gfx::Rect GetWindowBoundsForClientBounds( | 56 virtual gfx::Rect GetWindowBoundsForClientBounds( |
| 56 const gfx::Rect& client_bounds) const OVERRIDE; | 57 const gfx::Rect& client_bounds) const OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 68 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 69 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 69 virtual gfx::Size GetMinimumSize() OVERRIDE; | 70 virtual gfx::Size GetMinimumSize() OVERRIDE; |
| 70 virtual gfx::Size GetMaximumSize() OVERRIDE; | 71 virtual gfx::Size GetMaximumSize() OVERRIDE; |
| 71 | 72 |
| 72 // views::ButtonListener implementation. | 73 // views::ButtonListener implementation. |
| 73 virtual void ButtonPressed(views::Button* sender, | 74 virtual void ButtonPressed(views::Button* sender, |
| 74 const ui::Event& event) OVERRIDE; | 75 const ui::Event& event) OVERRIDE; |
| 75 | 76 |
| 76 NativeAppWindow* window_; | 77 NativeAppWindow* window_; |
| 77 views::Widget* frame_; | 78 views::Widget* frame_; |
| 79 SkColor frame_color_; |
| 78 views::ImageButton* close_button_; | 80 views::ImageButton* close_button_; |
| 79 views::ImageButton* maximize_button_; | 81 views::ImageButton* maximize_button_; |
| 80 views::ImageButton* restore_button_; | 82 views::ImageButton* restore_button_; |
| 81 views::ImageButton* minimize_button_; | 83 views::ImageButton* minimize_button_; |
| 82 | 84 |
| 83 // Allow resize for clicks this many pixels inside the bounds. | 85 // Allow resize for clicks this many pixels inside the bounds. |
| 84 int resize_inside_bounds_size_; | 86 int resize_inside_bounds_size_; |
| 85 | 87 |
| 86 // Allow resize for clicks this many pixels outside the bounds. | 88 // Allow resize for clicks this many pixels outside the bounds. |
| 87 int resize_outside_bounds_size_; | 89 int resize_outside_bounds_size_; |
| 88 | 90 |
| 89 // Size in pixels of the lower-right corner resize handle. | 91 // Size in pixels of the lower-right corner resize handle. |
| 90 int resize_area_corner_size_; | 92 int resize_area_corner_size_; |
| 91 | 93 |
| 92 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); | 94 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); |
| 93 }; | 95 }; |
| 94 | 96 |
| 95 } // namespace apps | 97 } // namespace apps |
| 96 | 98 |
| 97 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ | 99 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ |
| OLD | NEW |