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 #include "athena/home/minimized_home.h" | 5 #include "athena/home/minimized_home.h" |
6 | 6 |
| 7 #include "athena/wm/public/window_manager.h" |
7 #include "ui/views/background.h" | 8 #include "ui/views/background.h" |
8 #include "ui/views/layout/box_layout.h" | 9 #include "ui/views/layout/box_layout.h" |
9 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
10 #include "ui/views/widget/widget.h" | 11 #include "ui/views/widget/widget.h" |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 const SkColor kDragHandleColorNormal = SK_ColorGRAY; | 15 const SkColor kDragHandleColorNormal = SK_ColorGRAY; |
15 const SkColor kDragHandleColorHot = SK_ColorWHITE; | 16 const SkColor kDragHandleColorHot = SK_ColorWHITE; |
16 | 17 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 AddChildView(bar_); | 66 AddChildView(bar_); |
66 } | 67 } |
67 virtual ~MinimizedHomeView() {} | 68 virtual ~MinimizedHomeView() {} |
68 | 69 |
69 private: | 70 private: |
70 // TODO(mukai): unify mouse event handling to the HomeCardGestureManager. | 71 // TODO(mukai): unify mouse event handling to the HomeCardGestureManager. |
71 // views::View: | 72 // views::View: |
72 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { | 73 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { |
73 if (event.IsLeftMouseButton() && event.GetClickCount() == 1) { | 74 if (event.IsLeftMouseButton() && event.GetClickCount() == 1) { |
74 bar_->SetActive(false); | 75 bar_->SetActive(false); |
| 76 athena::WindowManager::GetInstance()->ToggleOverview(); |
75 return true; | 77 return true; |
76 } | 78 } |
77 return false; | 79 return false; |
78 } | 80 } |
79 | 81 |
80 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { | 82 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { |
81 bar_->SetActive(true); | 83 bar_->SetActive(true); |
82 } | 84 } |
83 | 85 |
84 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE { | 86 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE { |
85 bar_->SetActive(false); | 87 bar_->SetActive(false); |
86 } | 88 } |
87 | 89 |
88 SmallBarView* bar_; | 90 SmallBarView* bar_; |
89 | 91 |
90 DISALLOW_COPY_AND_ASSIGN(MinimizedHomeView); | 92 DISALLOW_COPY_AND_ASSIGN(MinimizedHomeView); |
91 }; | 93 }; |
92 | 94 |
93 } // namespace | 95 } // namespace |
94 | 96 |
95 namespace athena { | 97 namespace athena { |
96 | 98 |
97 views::View* CreateMinimizedHome() { | 99 views::View* CreateMinimizedHome() { |
98 return new MinimizedHomeView(); | 100 return new MinimizedHomeView(); |
99 } | 101 } |
100 | 102 |
101 } // namespace athena | 103 } // namespace athena |
OLD | NEW |