| 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 "ui/views/window/custom_frame_view.h" | 5 #include "ui/views/window/custom_frame_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ui/views/controls/button/image_button.h" | 9 #include "ui/views/controls/button/image_button.h" |
| 10 #include "ui/views/test/views_test_base.h" | 10 #include "ui/views/test/views_test_base.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 MaximizeStateControlDelegate() : can_maximize_(true) {} | 24 MaximizeStateControlDelegate() : can_maximize_(true) {} |
| 25 virtual ~MaximizeStateControlDelegate() {} | 25 virtual ~MaximizeStateControlDelegate() {} |
| 26 | 26 |
| 27 void set_can_maximize(bool can_maximize) { | 27 void set_can_maximize(bool can_maximize) { |
| 28 can_maximize_ = can_maximize; | 28 can_maximize_ = can_maximize; |
| 29 } | 29 } |
| 30 | 30 |
| 31 // WidgetDelegate: | 31 // WidgetDelegate: |
| 32 virtual bool CanMaximize() const OVERRIDE { return can_maximize_; } | 32 virtual bool CanMaximize() const OVERRIDE { return can_maximize_; } |
| 33 virtual bool CanMinimize() const OVERRIDE { return can_maximize_; } |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 bool can_maximize_; | 36 bool can_maximize_; |
| 36 | 37 |
| 37 DISALLOW_COPY_AND_ASSIGN(MaximizeStateControlDelegate); | 38 DISALLOW_COPY_AND_ASSIGN(MaximizeStateControlDelegate); |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 } // namespace | 41 } // namespace |
| 41 | 42 |
| 42 class CustomFrameViewTest : public ViewsTestBase { | 43 class CustomFrameViewTest : public ViewsTestBase { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 parent->Maximize(); | 244 parent->Maximize(); |
| 244 view->Layout(); | 245 view->Layout(); |
| 245 | 246 |
| 246 EXPECT_GT(close_button()->bounds().width(), | 247 EXPECT_GT(close_button()->bounds().width(), |
| 247 close_button_initial_bounds.width()); | 248 close_button_initial_bounds.width()); |
| 248 EXPECT_GT(minimize_button()->bounds().width(), | 249 EXPECT_GT(minimize_button()->bounds().width(), |
| 249 minimize_button_initial_bounds.width()); | 250 minimize_button_initial_bounds.width()); |
| 250 } | 251 } |
| 251 | 252 |
| 252 } // namespace views | 253 } // namespace views |
| OLD | NEW |