OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/views/controls/single_split_view.h" | 5 #include "ui/views/controls/single_split_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/views/controls/single_split_view_listener.h" | 9 #include "ui/views/controls/single_split_view_listener.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 split.bounds().height()); | 38 split.bounds().height()); |
39 } else { | 39 } else { |
40 NOTREACHED(); | 40 NOTREACHED(); |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 class SingleSplitViewListenerImpl : public views::SingleSplitViewListener { | 44 class SingleSplitViewListenerImpl : public views::SingleSplitViewListener { |
45 public: | 45 public: |
46 SingleSplitViewListenerImpl() : count_(0) {} | 46 SingleSplitViewListenerImpl() : count_(0) {} |
47 | 47 |
48 virtual bool SplitHandleMoved(views::SingleSplitView* sender) OVERRIDE { | 48 virtual bool SplitHandleMoved(views::SingleSplitView* sender) override { |
49 ++count_; | 49 ++count_; |
50 return false; | 50 return false; |
51 } | 51 } |
52 | 52 |
53 int count() const { return count_; } | 53 int count() const { return count_; } |
54 | 54 |
55 private: | 55 private: |
56 int count_; | 56 int count_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(SingleSplitViewListenerImpl); | 58 DISALLOW_COPY_AND_ASSIGN(SingleSplitViewListenerImpl); |
59 }; | 59 }; |
60 | 60 |
61 class MinimumSizedView: public views::View { | 61 class MinimumSizedView: public views::View { |
62 public: | 62 public: |
63 MinimumSizedView(gfx::Size min_size) : min_size_(min_size) {} | 63 MinimumSizedView(gfx::Size min_size) : min_size_(min_size) {} |
64 | 64 |
65 private: | 65 private: |
66 gfx::Size min_size_; | 66 gfx::Size min_size_; |
67 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 67 virtual gfx::Size GetMinimumSize() const override; |
68 }; | 68 }; |
69 | 69 |
70 gfx::Size MinimumSizedView::GetMinimumSize() const { | 70 gfx::Size MinimumSizedView::GetMinimumSize() const { |
71 return min_size_; | 71 return min_size_; |
72 } | 72 } |
73 | 73 |
74 } // namespace | 74 } // namespace |
75 | 75 |
76 namespace views { | 76 namespace views { |
77 | 77 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 split.divider_offset()); | 221 split.divider_offset()); |
222 | 222 |
223 // Expect intial offset after a system/user gesture cancels the drag. | 223 // Expect intial offset after a system/user gesture cancels the drag. |
224 // This shouldn't occur after mouse release, but it's sufficient for testing. | 224 // This shouldn't occur after mouse release, but it's sufficient for testing. |
225 split.OnMouseCaptureLost(); | 225 split.OnMouseCaptureLost(); |
226 EXPECT_EQ(kInitialDividerOffset, split.divider_offset()); | 226 EXPECT_EQ(kInitialDividerOffset, split.divider_offset()); |
227 EXPECT_EQ(5, listener.count()); | 227 EXPECT_EQ(5, listener.count()); |
228 } | 228 } |
229 | 229 |
230 } // namespace views | 230 } // namespace views |
OLD | NEW |