| 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 "ui/views/background.h" | 7 #include "ui/views/background.h" |
| 8 #include "ui/views/layout/box_layout.h" | 8 #include "ui/views/layout/box_layout.h" |
| 9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 // views::View: | 35 // views::View: |
| 36 virtual gfx::Size GetPreferredSize() const OVERRIDE { | 36 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
| 37 const int kDragHandleWidth = 80; | 37 const int kDragHandleWidth = 80; |
| 38 const int kDragHandleHeight = 4; | 38 const int kDragHandleHeight = 4; |
| 39 return gfx::Size(kDragHandleWidth, kDragHandleHeight); | 39 return gfx::Size(kDragHandleWidth, kDragHandleHeight); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { | 42 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { |
| 43 if (event.IsLeftMouseButton() && event.GetClickCount() > 1) { | 43 if (event.IsLeftMouseButton() && event.GetClickCount() == 1) { |
| 44 delegate_->OnDragUpCompleted(); | 44 delegate_->OnDragUpCompleted(); |
| 45 SetColor(kDragHandleColorNormal); | 45 SetColor(kDragHandleColorNormal); |
| 46 return true; | 46 return true; |
| 47 } | 47 } |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 | 50 |
| 51 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { | 51 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE { |
| 52 SetColor(kDragHandleColorHot); | 52 SetColor(kDragHandleColorHot); |
| 53 } | 53 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 2, 0); | 101 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 2, 0); |
| 102 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); | 102 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); |
| 103 content_view->SetLayoutManager(layout); | 103 content_view->SetLayoutManager(layout); |
| 104 | 104 |
| 105 views::View* view = new MinimizedHomeView(delegate); | 105 views::View* view = new MinimizedHomeView(delegate); |
| 106 content_view->AddChildView(view); | 106 content_view->AddChildView(view); |
| 107 return content_view; | 107 return content_view; |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace athena | 110 } // namespace athena |
| OLD | NEW |