| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MUS_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_ | 5 #ifndef ASH_MUS_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_ |
| 6 #define ASH_MUS_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_ | 6 #define ASH_MUS_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "services/ui/public/cpp/window_observer.h" | 9 #include "services/ui/public/cpp/window_observer.h" |
| 10 #include "services/ui/public/cpp/window_tree_client_observer.h" | 10 #include "services/ui/public/cpp/window_tree_client_observer.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace views { | 23 namespace views { |
| 24 class Widget; | 24 class Widget; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace ash { | 27 namespace ash { |
| 28 namespace mus { | 28 namespace mus { |
| 29 | 29 |
| 30 class FrameCaptionButtonContainerView; | 30 class FrameCaptionButtonContainerView; |
| 31 | 31 |
| 32 class NonClientFrameViewMash : public views::NonClientFrameView, | 32 class NonClientFrameViewMash : public views::NonClientFrameView, |
| 33 public ::ui::WindowObserver, | 33 public ui::WindowObserver, |
| 34 public ::ui::WindowTreeClientObserver { | 34 public ui::WindowTreeClientObserver { |
| 35 public: | 35 public: |
| 36 // Internal class name. | 36 // Internal class name. |
| 37 static const char kViewClassName[]; | 37 static const char kViewClassName[]; |
| 38 | 38 |
| 39 NonClientFrameViewMash(views::Widget* frame, ::ui::Window* window); | 39 NonClientFrameViewMash(views::Widget* frame, ui::Window* window); |
| 40 ~NonClientFrameViewMash() override; | 40 ~NonClientFrameViewMash() override; |
| 41 | 41 |
| 42 static gfx::Insets GetPreferredClientAreaInsets(); | 42 static gfx::Insets GetPreferredClientAreaInsets(); |
| 43 static int GetMaxTitleBarButtonWidth(); | 43 static int GetMaxTitleBarButtonWidth(); |
| 44 | 44 |
| 45 // Sets the active and inactive frame colors. Note the inactive frame color | 45 // Sets the active and inactive frame colors. Note the inactive frame color |
| 46 // will have some transparency added when the frame is drawn. | 46 // will have some transparency added when the frame is drawn. |
| 47 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); | 47 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); |
| 48 | 48 |
| 49 // views::NonClientFrameView: | 49 // views::NonClientFrameView: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 61 void Layout() override; | 61 void Layout() override; |
| 62 gfx::Size GetPreferredSize() const override; | 62 gfx::Size GetPreferredSize() const override; |
| 63 const char* GetClassName() const override; | 63 const char* GetClassName() const override; |
| 64 gfx::Size GetMinimumSize() const override; | 64 gfx::Size GetMinimumSize() const override; |
| 65 gfx::Size GetMaximumSize() const override; | 65 gfx::Size GetMaximumSize() const override; |
| 66 void OnPaint(gfx::Canvas* canvas) override; | 66 void OnPaint(gfx::Canvas* canvas) override; |
| 67 void PaintChildren(const ui::PaintContext& context) override; | 67 void PaintChildren(const ui::PaintContext& context) override; |
| 68 | 68 |
| 69 // ui::WindowObserver: | 69 // ui::WindowObserver: |
| 70 void OnWindowClientAreaChanged( | 70 void OnWindowClientAreaChanged( |
| 71 ::ui::Window* window, | 71 ui::Window* window, |
| 72 const gfx::Insets& old_client_area, | 72 const gfx::Insets& old_client_area, |
| 73 const std::vector<gfx::Rect>& old_additional_client_area) override; | 73 const std::vector<gfx::Rect>& old_additional_client_area) override; |
| 74 void OnWindowDestroyed(::ui::Window* window) override; | 74 void OnWindowDestroyed(ui::Window* window) override; |
| 75 void OnWindowSharedPropertyChanged( | 75 void OnWindowSharedPropertyChanged( |
| 76 ::ui::Window* window, | 76 ui::Window* window, |
| 77 const std::string& name, | 77 const std::string& name, |
| 78 const std::vector<uint8_t>* old_data, | 78 const std::vector<uint8_t>* old_data, |
| 79 const std::vector<uint8_t>* new_data) override; | 79 const std::vector<uint8_t>* new_data) override; |
| 80 | 80 |
| 81 // Get the view of the header. | 81 // Get the view of the header. |
| 82 views::View* GetHeaderView(); | 82 views::View* GetHeaderView(); |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 class OverlayView; | 85 class OverlayView; |
| 86 | 86 |
| 87 // Height from top of window to top of client area. | 87 // Height from top of window to top of client area. |
| 88 int NonClientTopBorderHeight() const; | 88 int NonClientTopBorderHeight() const; |
| 89 | 89 |
| 90 void RemoveObservers(); | 90 void RemoveObservers(); |
| 91 | 91 |
| 92 // ui::WindowTreeClientObserver: | 92 // ui::WindowTreeClientObserver: |
| 93 void OnWindowTreeFocusChanged(::ui::Window* gained_focus, | 93 void OnWindowTreeFocusChanged(ui::Window* gained_focus, |
| 94 ::ui::Window* lost_focus) override; | 94 ui::Window* lost_focus) override; |
| 95 | 95 |
| 96 // Not owned. | 96 // Not owned. |
| 97 views::Widget* frame_; | 97 views::Widget* frame_; |
| 98 | 98 |
| 99 ::ui::Window* window_; | 99 ui::Window* window_; |
| 100 ui::PaintCache paint_cache_; | 100 ui::PaintCache paint_cache_; |
| 101 | 101 |
| 102 // View which contains the title and window controls. | 102 // View which contains the title and window controls. |
| 103 class HeaderView; | 103 class HeaderView; |
| 104 HeaderView* header_view_; | 104 HeaderView* header_view_; |
| 105 | 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewMash); | 106 DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewMash); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace mus | 109 } // namespace mus |
| 110 } // namespace ash | 110 } // namespace ash |
| 111 | 111 |
| 112 #endif // ASH_MUS_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_ | 112 #endif // ASH_MUS_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_ |
| OLD | NEW |