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