| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 5 #ifndef ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| 6 #define ASH_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 6 #define ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
| 13 #include "ui/views/window/non_client_view.h" | 13 #include "ui/views/window/non_client_view.h" |
| 14 | 14 |
| 15 namespace ash { | 15 namespace ash { |
| 16 class FrameBorderHitTestController; | |
| 17 class FrameCaptionButtonContainerView; | 16 class FrameCaptionButtonContainerView; |
| 18 class ImmersiveFullscreenController; | 17 class WmImmersiveFullscreenController; |
| 19 } | 18 } |
| 20 namespace views { | 19 namespace views { |
| 21 class Widget; | 20 class Widget; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace ash { | 23 namespace ash { |
| 25 | 24 |
| 26 // A NonClientFrameView used for packaged apps, dialogs and other non-browser | 25 // A NonClientFrameView used for packaged apps, dialogs and other non-browser |
| 27 // windows. It supports immersive fullscreen. When in immersive fullscreen, the | 26 // windows. It supports immersive fullscreen. When in immersive fullscreen, the |
| 28 // client view takes up the entire widget and the window header is an overlay. | 27 // client view takes up the entire widget and the window header is an overlay. |
| 29 // The window header overlay slides onscreen when the user hovers the mouse at | 28 // The window header overlay slides onscreen when the user hovers the mouse at |
| 30 // the top of the screen. See also views::CustomFrameView and | 29 // the top of the screen. See also views::CustomFrameView and |
| 31 // BrowserNonClientFrameViewAsh. | 30 // BrowserNonClientFrameViewAsh. |
| 32 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView { | 31 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView { |
| 33 public: | 32 public: |
| 34 // Internal class name. | 33 // Internal class name. |
| 35 static const char kViewClassName[]; | 34 static const char kViewClassName[]; |
| 36 | 35 |
| 37 explicit CustomFrameViewAsh(views::Widget* frame); | 36 explicit CustomFrameViewAsh(views::Widget* frame); |
| 38 ~CustomFrameViewAsh() override; | 37 ~CustomFrameViewAsh() override; |
| 39 | 38 |
| 40 // Inits |immersive_fullscreen_controller| so that the controller reveals | 39 // Inits |immersive_fullscreen_controller| so that the controller reveals |
| 41 // and hides |header_view_| in immersive fullscreen. | 40 // and hides |header_view_| in immersive fullscreen. |
| 42 // CustomFrameViewAsh does not take ownership of | 41 // CustomFrameViewAsh does not take ownership of |
| 43 // |immersive_fullscreen_controller|. | 42 // |immersive_fullscreen_controller|. |
| 44 void InitImmersiveFullscreenControllerForView( | 43 void InitImmersiveFullscreenControllerForView( |
| 45 ImmersiveFullscreenController* immersive_fullscreen_controller); | 44 WmImmersiveFullscreenController* immersive_fullscreen_controller); |
| 46 | 45 |
| 47 // Sets the active and inactive frame colors. Note the inactive frame color | 46 // Sets the active and inactive frame colors. Note the inactive frame color |
| 48 // will have some transparency added when the frame is drawn. | 47 // will have some transparency added when the frame is drawn. |
| 49 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); | 48 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); |
| 50 | 49 |
| 51 // views::NonClientFrameView: | 50 // views::NonClientFrameView: |
| 52 gfx::Rect GetBoundsForClientView() const override; | 51 gfx::Rect GetBoundsForClientView() const override; |
| 53 gfx::Rect GetWindowBoundsForClientBounds( | 52 gfx::Rect GetWindowBoundsForClientBounds( |
| 54 const gfx::Rect& client_bounds) const override; | 53 const gfx::Rect& client_bounds) const override; |
| 55 int NonClientHitTest(const gfx::Point& point) override; | 54 int NonClientHitTest(const gfx::Point& point) override; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // Height from top of window to top of client area. | 87 // Height from top of window to top of client area. |
| 89 int NonClientTopBorderHeight() const; | 88 int NonClientTopBorderHeight() const; |
| 90 | 89 |
| 91 // Not owned. | 90 // Not owned. |
| 92 views::Widget* frame_; | 91 views::Widget* frame_; |
| 93 | 92 |
| 94 // View which contains the title and window controls. | 93 // View which contains the title and window controls. |
| 95 class HeaderView; | 94 class HeaderView; |
| 96 HeaderView* header_view_; | 95 HeaderView* header_view_; |
| 97 | 96 |
| 98 // Updates the hittest bounds overrides based on the window state type. | |
| 99 std::unique_ptr<FrameBorderHitTestController> | |
| 100 frame_border_hit_test_controller_; | |
| 101 | |
| 102 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); | 97 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); |
| 103 }; | 98 }; |
| 104 | 99 |
| 105 } // namespace ash | 100 } // namespace ash |
| 106 | 101 |
| 107 #endif // ASH_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 102 #endif // ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| OLD | NEW |