Chromium Code Reviews| 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_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 5 #ifndef ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| 6 #define ASH_COMMON_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 views { | 15 namespace views { |
| 16 class Widget; | 16 class Widget; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ash { | 19 namespace ash { |
| 20 | 20 |
| 21 class FrameCaptionButtonContainerView; | 21 class FrameCaptionButtonContainerView; |
| 22 class HeaderView; | 22 class HeaderView; |
| 23 class ImmersiveFullscreenController; | 23 class ImmersiveFullscreenController; |
| 24 class ImmersiveFullscreenControllerDelegate; | |
| 24 | 25 |
| 25 // A NonClientFrameView used for packaged apps, dialogs and other non-browser | 26 // A NonClientFrameView used for packaged apps, dialogs and other non-browser |
| 26 // windows. It supports immersive fullscreen. When in immersive fullscreen, the | 27 // windows. It supports immersive fullscreen. When in immersive fullscreen, the |
| 27 // client view takes up the entire widget and the window header is an overlay. | 28 // client view takes up the entire widget and the window header is an overlay. |
| 28 // The window header overlay slides onscreen when the user hovers the mouse at | 29 // The window header overlay slides onscreen when the user hovers the mouse at |
| 29 // the top of the screen. See also views::CustomFrameView and | 30 // the top of the screen. See also views::CustomFrameView and |
| 30 // BrowserNonClientFrameViewAsh. | 31 // BrowserNonClientFrameViewAsh. |
| 31 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView { | 32 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView { |
| 32 public: | 33 public: |
| 33 // Internal class name. | 34 // Internal class name. |
| 34 static const char kViewClassName[]; | 35 static const char kViewClassName[]; |
| 35 | 36 |
| 36 explicit CustomFrameViewAsh(views::Widget* frame); | 37 // |enable_immersive| controls whether ImmersiveFullscreenController is |
| 38 // created for the CustomFrameViewAsh; if true and a WindowStateDelegate has | |
| 39 // not been set on the WindowState associated with |frame|, then an | |
| 40 // ImmersiveFullscreenController is created. | |
| 41 // If ImmersiveFullscreenControllerDelegate is not supplied, HeaderView is | |
| 42 // used as the ImmersiveFullscreenControllerDelegate. | |
| 43 explicit CustomFrameViewAsh( | |
|
James Cook
2016/08/24 17:00:32
I think this would be clearer with two constructor
sky
2016/08/24 19:23:28
Can you outline why you feel having two constructo
James Cook
2016/08/24 19:56:29
This allows "new CustomFrameViewAsh(frame, delegat
| |
| 44 views::Widget* frame, | |
| 45 ImmersiveFullscreenControllerDelegate* immersive_delegate = nullptr, | |
| 46 bool enable_immersive = true); | |
| 37 ~CustomFrameViewAsh() override; | 47 ~CustomFrameViewAsh() override; |
| 38 | 48 |
| 39 // Inits |immersive_fullscreen_controller| so that the controller reveals | 49 // Inits |immersive_fullscreen_controller| so that the controller reveals |
| 40 // and hides |header_view_| in immersive fullscreen. | 50 // and hides |header_view_| in immersive fullscreen. |
| 41 // CustomFrameViewAsh does not take ownership of | 51 // CustomFrameViewAsh does not take ownership of |
| 42 // |immersive_fullscreen_controller|. | 52 // |immersive_fullscreen_controller|. |
| 43 void InitImmersiveFullscreenControllerForView( | 53 void InitImmersiveFullscreenControllerForView( |
| 44 ImmersiveFullscreenController* immersive_fullscreen_controller); | 54 ImmersiveFullscreenController* immersive_fullscreen_controller); |
| 45 | 55 |
| 46 // Sets the active and inactive frame colors. Note the inactive frame color | 56 // Sets the active and inactive frame colors. Note the inactive frame color |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 | 97 |
| 88 // Height from top of window to top of client area. | 98 // Height from top of window to top of client area. |
| 89 int NonClientTopBorderHeight() const; | 99 int NonClientTopBorderHeight() const; |
| 90 | 100 |
| 91 // Not owned. | 101 // Not owned. |
| 92 views::Widget* frame_; | 102 views::Widget* frame_; |
| 93 | 103 |
| 94 // View which contains the title and window controls. | 104 // View which contains the title and window controls. |
| 95 HeaderView* header_view_; | 105 HeaderView* header_view_; |
| 96 | 106 |
| 107 ImmersiveFullscreenControllerDelegate* immersive_delegate_; | |
| 108 | |
| 97 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); | 109 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); |
| 98 }; | 110 }; |
| 99 | 111 |
| 100 } // namespace ash | 112 } // namespace ash |
| 101 | 113 |
| 102 #endif // ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 114 #endif // ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| OLD | NEW |