| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // If |draw_frame| is true, the view draws its own window title area and | 48 // If |draw_frame| is true, the view draws its own window title area and |
| 49 // controls, using |frame_color|. If |draw_frame| is not true, no frame is | 49 // controls, using |frame_color|. If |draw_frame| is not true, no frame is |
| 50 // drawn. | 50 // drawn. |
| 51 // TODO(benwells): Refactor this to split out frameless and colored frame | 51 // TODO(benwells): Refactor this to split out frameless and colored frame |
| 52 // views. See http://crbug.com/359432. | 52 // views. See http://crbug.com/359432. |
| 53 AppWindowFrameView(views::Widget* widget, | 53 AppWindowFrameView(views::Widget* widget, |
| 54 extensions::NativeAppWindow* window, | 54 extensions::NativeAppWindow* window, |
| 55 bool draw_frame, | 55 bool draw_frame, |
| 56 const SkColor& active_frame_color, | 56 const SkColor& active_frame_color, |
| 57 const SkColor& inactive_frame_color); | 57 const SkColor& inactive_frame_color); |
| 58 virtual ~AppWindowFrameView(); | 58 ~AppWindowFrameView() override; |
| 59 | 59 |
| 60 void Init(); | 60 void Init(); |
| 61 | 61 |
| 62 void SetResizeSizes(int resize_inside_bounds_size, | 62 void SetResizeSizes(int resize_inside_bounds_size, |
| 63 int resize_outside_bounds_size, | 63 int resize_outside_bounds_size, |
| 64 int resize_area_corner_size); | 64 int resize_area_corner_size); |
| 65 int resize_inside_bounds_size() const { | 65 int resize_inside_bounds_size() const { |
| 66 return resize_inside_bounds_size_; | 66 return resize_inside_bounds_size_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // views::NonClientFrameView implementation. | 70 // views::NonClientFrameView implementation. |
| 71 virtual gfx::Rect GetBoundsForClientView() const override; | 71 gfx::Rect GetBoundsForClientView() const override; |
| 72 virtual gfx::Rect GetWindowBoundsForClientBounds( | 72 gfx::Rect GetWindowBoundsForClientBounds( |
| 73 const gfx::Rect& client_bounds) const override; | 73 const gfx::Rect& client_bounds) const override; |
| 74 virtual int NonClientHitTest(const gfx::Point& point) override; | 74 int NonClientHitTest(const gfx::Point& point) override; |
| 75 virtual void GetWindowMask(const gfx::Size& size, | 75 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 76 gfx::Path* window_mask) override; | 76 void ResetWindowControls() override {} |
| 77 virtual void ResetWindowControls() override {} | 77 void UpdateWindowIcon() override {} |
| 78 virtual void UpdateWindowIcon() override {} | 78 void UpdateWindowTitle() override {} |
| 79 virtual void UpdateWindowTitle() override {} | 79 void SizeConstraintsChanged() override; |
| 80 virtual void SizeConstraintsChanged() override; | |
| 81 | 80 |
| 82 // views::View implementation. | 81 // views::View implementation. |
| 83 virtual gfx::Size GetPreferredSize() const override; | 82 gfx::Size GetPreferredSize() const override; |
| 84 virtual void Layout() override; | 83 void Layout() override; |
| 85 virtual const char* GetClassName() const override; | 84 const char* GetClassName() const override; |
| 86 virtual void OnPaint(gfx::Canvas* canvas) override; | 85 void OnPaint(gfx::Canvas* canvas) override; |
| 87 virtual gfx::Size GetMinimumSize() const override; | 86 gfx::Size GetMinimumSize() const override; |
| 88 virtual gfx::Size GetMaximumSize() const override; | 87 gfx::Size GetMaximumSize() const override; |
| 89 | 88 |
| 90 // views::ButtonListener implementation. | 89 // views::ButtonListener implementation. |
| 91 virtual void ButtonPressed(views::Button* sender, | 90 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 92 const ui::Event& event) override; | |
| 93 | 91 |
| 94 // Some button images we use depend on the color of the frame. This | 92 // Some button images we use depend on the color of the frame. This |
| 95 // will set these images based on the color of the frame. | 93 // will set these images based on the color of the frame. |
| 96 void SetButtonImagesForFrame(); | 94 void SetButtonImagesForFrame(); |
| 97 | 95 |
| 98 // Return the current frame color based on the active state of the window. | 96 // Return the current frame color based on the active state of the window. |
| 99 SkColor CurrentFrameColor(); | 97 SkColor CurrentFrameColor(); |
| 100 | 98 |
| 101 views::Widget* widget_; | 99 views::Widget* widget_; |
| 102 extensions::NativeAppWindow* window_; | 100 extensions::NativeAppWindow* window_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 116 | 114 |
| 117 // Size in pixels of the lower-right corner resize handle. | 115 // Size in pixels of the lower-right corner resize handle. |
| 118 int resize_area_corner_size_; | 116 int resize_area_corner_size_; |
| 119 | 117 |
| 120 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); | 118 DISALLOW_COPY_AND_ASSIGN(AppWindowFrameView); |
| 121 }; | 119 }; |
| 122 | 120 |
| 123 } // namespace apps | 121 } // namespace apps |
| 124 | 122 |
| 125 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ | 123 #endif // APPS_UI_VIEWS_APP_WINDOW_FRAME_VIEW_H_ |
| OLD | NEW |