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

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

Issue 518673007: Make activities have a thick border when in overview mode part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_overview2
Patch Set: Created 6 years, 3 months 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/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;
57 int NonClientBorderThickness() const;
46 int NonClientTopBorderHeight() const; 58 int NonClientTopBorderHeight() const;
47 59
48 // Not owned. 60 // Not owned.
49 views::Widget* frame_; 61 views::Widget* frame_;
50 ActivityViewModel* view_model_; 62 ActivityViewModel* view_model_;
51 views::Label* title_; 63 views::Label* title_;
64 views::ImageView* icon_;
65
66 // Whether overview mode is active.
67 bool in_overview_;
52 68
53 DISALLOW_COPY_AND_ASSIGN(ActivityFrameView); 69 DISALLOW_COPY_AND_ASSIGN(ActivityFrameView);
54 }; 70 };
55 71
56 } // namespace athena 72 } // namespace athena
57 73
58 #endif // ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_ 74 #endif // ATHENA_ACTIVITY_ACTIVITY_FRAME_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698