| 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 ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ | 5 #ifndef ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ |
| 6 #define ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ | 6 #define ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "athena/wm/public/window_manager_observer.h" | 8 #include "athena/wm/public/window_manager_observer.h" |
| 9 #include "ui/gfx/insets.h" | 9 #include "ui/gfx/insets.h" |
| 10 #include "ui/views/window/non_client_view.h" | 10 #include "ui/views/window/non_client_view.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 class ImageView; | 13 class ImageView; |
| 14 class Label; | 14 class Label; |
| 15 class Widget; | 15 class Widget; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace athena { | 18 namespace athena { |
| 19 | 19 |
| 20 class ActivityViewModel; | 20 class ActivityViewModel; |
| 21 | 21 |
| 22 // A NonClientFrameView used for activity. | 22 // A NonClientFrameView used for activity. |
| 23 class ActivityFrameView : public views::NonClientFrameView, | 23 class ActivityFrameView : public views::NonClientFrameView, |
| 24 public WindowManagerObserver { | 24 public WindowManagerObserver { |
| 25 public: | 25 public: |
| 26 // The frame class name. | 26 // The frame class name. |
| 27 static const char kViewClassName[]; | 27 static const char kViewClassName[]; |
| 28 | 28 |
| 29 ActivityFrameView(views::Widget* frame, ActivityViewModel* view_model); | 29 ActivityFrameView(views::Widget* frame, ActivityViewModel* view_model); |
| 30 virtual ~ActivityFrameView(); | 30 ~ActivityFrameView() override; |
| 31 | 31 |
| 32 // views::NonClientFrameView: | 32 // views::NonClientFrameView: |
| 33 virtual gfx::Rect GetBoundsForClientView() const override; | 33 gfx::Rect GetBoundsForClientView() const override; |
| 34 virtual gfx::Rect GetWindowBoundsForClientBounds( | 34 gfx::Rect GetWindowBoundsForClientBounds( |
| 35 const gfx::Rect& client_bounds) const override; | 35 const gfx::Rect& client_bounds) const override; |
| 36 virtual int NonClientHitTest(const gfx::Point& point) override; | 36 int NonClientHitTest(const gfx::Point& point) override; |
| 37 virtual void GetWindowMask(const gfx::Size& size, | 37 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 38 gfx::Path* window_mask) override; | 38 void ResetWindowControls() override; |
| 39 virtual void ResetWindowControls() override; | 39 void UpdateWindowIcon() override; |
| 40 virtual void UpdateWindowIcon() override; | 40 void UpdateWindowTitle() override; |
| 41 virtual void UpdateWindowTitle() override; | 41 void SizeConstraintsChanged() override; |
| 42 virtual void SizeConstraintsChanged() override; | |
| 43 | 42 |
| 44 // views::View: | 43 // views::View: |
| 45 virtual gfx::Size GetPreferredSize() const override; | 44 gfx::Size GetPreferredSize() const override; |
| 46 virtual const char* GetClassName() const override; | 45 const char* GetClassName() const override; |
| 47 virtual void Layout() override; | 46 void Layout() override; |
| 48 virtual void OnPaintBackground(gfx::Canvas* canvas) override; | 47 void OnPaintBackground(gfx::Canvas* canvas) override; |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 // WindowManagerObserver: | 50 // WindowManagerObserver: |
| 52 virtual void OnOverviewModeEnter() override; | 51 void OnOverviewModeEnter() override; |
| 53 virtual void OnOverviewModeExit() override; | 52 void OnOverviewModeExit() override; |
| 54 virtual void OnSplitViewModeEnter() override; | 53 void OnSplitViewModeEnter() override; |
| 55 virtual void OnSplitViewModeExit() override; | 54 void OnSplitViewModeExit() override; |
| 56 | 55 |
| 57 gfx::Insets NonClientBorderInsets() const; | 56 gfx::Insets NonClientBorderInsets() const; |
| 58 int NonClientBorderThickness() const; | 57 int NonClientBorderThickness() const; |
| 59 int NonClientTopBorderHeight() const; | 58 int NonClientTopBorderHeight() const; |
| 60 | 59 |
| 61 // Not owned. | 60 // Not owned. |
| 62 views::Widget* frame_; | 61 views::Widget* frame_; |
| 63 ActivityViewModel* view_model_; | 62 ActivityViewModel* view_model_; |
| 64 views::Label* title_; | 63 views::Label* title_; |
| 65 views::ImageView* icon_; | 64 views::ImageView* icon_; |
| 66 | 65 |
| 67 // Whether overview mode is active. | 66 // Whether overview mode is active. |
| 68 bool in_overview_; | 67 bool in_overview_; |
| 69 | 68 |
| 70 DISALLOW_COPY_AND_ASSIGN(ActivityFrameView); | 69 DISALLOW_COPY_AND_ASSIGN(ActivityFrameView); |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 } // namespace athena | 72 } // namespace athena |
| 74 | 73 |
| 75 #endif // ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ | 74 #endif // ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ |
| OLD | NEW |