Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: athena/activity/activity_frame_view.h

Issue 694413005: athena: Introduce ActivityView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/activity/public/activity_view.h"
9 #include "athena/activity/public/activity_view_model.h"
oshima 2014/11/04 23:42:41 nit: do you need this?
sadrul 2014/11/05 03:36:43 Nope. Removed.
8 #include "athena/wm/public/window_manager_observer.h" 10 #include "athena/wm/public/window_manager_observer.h"
9 #include "ui/gfx/insets.h" 11 #include "ui/gfx/insets.h"
10 #include "ui/views/window/non_client_view.h" 12 #include "ui/views/window/non_client_view.h"
11 13
12 namespace views { 14 namespace views {
13 class ImageView; 15 class ImageView;
14 class Label; 16 class Label;
15 class Widget; 17 class Widget;
16 } 18 }
17 19
18 namespace athena { 20 namespace athena {
19 21
20 class ActivityViewModel; 22 class ActivityViewModel;
21 23
22 // A NonClientFrameView used for activity. 24 // A NonClientFrameView used for activity.
23 class ActivityFrameView : public views::NonClientFrameView, 25 class ActivityFrameView : public views::NonClientFrameView,
24 public WindowManagerObserver { 26 public WindowManagerObserver,
27 public ActivityView {
25 public: 28 public:
26 // The frame class name. 29 // The frame class name.
27 static const char kViewClassName[]; 30 static const char kViewClassName[];
28 31
29 ActivityFrameView(views::Widget* frame, ActivityViewModel* view_model); 32 ActivityFrameView(views::Widget* frame, ActivityViewModel* view_model);
30 ~ActivityFrameView() override; 33 ~ActivityFrameView() override;
31 34
32 // views::NonClientFrameView: 35 // views::NonClientFrameView:
33 gfx::Rect GetBoundsForClientView() const override; 36 gfx::Rect GetBoundsForClientView() const override;
34 gfx::Rect GetWindowBoundsForClientBounds( 37 gfx::Rect GetWindowBoundsForClientBounds(
35 const gfx::Rect& client_bounds) const override; 38 const gfx::Rect& client_bounds) const override;
36 int NonClientHitTest(const gfx::Point& point) override; 39 int NonClientHitTest(const gfx::Point& point) override;
37 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; 40 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override;
38 void ResetWindowControls() override; 41 void ResetWindowControls() override;
39 void UpdateWindowIcon() override; 42 void UpdateWindowIcon() override;
40 void UpdateWindowTitle() override; 43 void UpdateWindowTitle() override;
41 void SizeConstraintsChanged() override; 44 void SizeConstraintsChanged() override;
42 45
43 // views::View: 46 // views::View:
44 gfx::Size GetPreferredSize() const override; 47 gfx::Size GetPreferredSize() const override;
45 const char* GetClassName() const override; 48 const char* GetClassName() const override;
46 void Layout() override; 49 void Layout() override;
47 void OnPaintBackground(gfx::Canvas* canvas) override; 50 void OnPaintBackground(gfx::Canvas* canvas) override;
48 51
49 private: 52 private:
53 // ActivityView:
54 void UpdateTitle() override;
55 void UpdateIcon() override;
56 void UpdateRepresentativeColor() override;
57
50 // WindowManagerObserver: 58 // WindowManagerObserver:
51 void OnOverviewModeEnter() override; 59 void OnOverviewModeEnter() override;
52 void OnOverviewModeExit() override; 60 void OnOverviewModeExit() override;
53 void OnSplitViewModeEnter() override; 61 void OnSplitViewModeEnter() override;
54 void OnSplitViewModeExit() override; 62 void OnSplitViewModeExit() override;
55 63
56 gfx::Insets NonClientBorderInsets() const; 64 gfx::Insets NonClientBorderInsets() const;
57 int NonClientBorderThickness() const; 65 int NonClientBorderThickness() const;
58 int NonClientTopBorderHeight() const; 66 int NonClientTopBorderHeight() const;
59 67
60 // Not owned. 68 // Not owned.
61 views::Widget* frame_; 69 views::Widget* frame_;
62 ActivityViewModel* view_model_; 70 ActivityViewModel* view_model_;
63 views::Label* title_; 71 views::Label* title_;
64 views::ImageView* icon_; 72 views::ImageView* icon_;
65 73
66 // Whether overview mode is active. 74 // Whether overview mode is active.
67 bool in_overview_; 75 bool in_overview_;
68 76
69 DISALLOW_COPY_AND_ASSIGN(ActivityFrameView); 77 DISALLOW_COPY_AND_ASSIGN(ActivityFrameView);
70 }; 78 };
71 79
72 } // namespace athena 80 } // namespace athena
73 81
74 #endif // ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ 82 #endif // ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | athena/activity/activity_frame_view.cc » ('j') | athena/activity/activity_frame_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698