| 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/widget/native_widget_mac.h" | 5 #include "ui/views/widget/native_widget_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "ui/views/test/widget_test.h" | 9 #include "ui/views/test/widget_test.h" |
| 10 #include "ui/views/test/test_widget_observer.h" | 10 #include "ui/views/test/test_widget_observer.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMacInteractiveUITest); | 46 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMacInteractiveUITest); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class NativeWidgetMacInteractiveUITest::Observer : public TestWidgetObserver { | 49 class NativeWidgetMacInteractiveUITest::Observer : public TestWidgetObserver { |
| 50 public: | 50 public: |
| 51 Observer(NativeWidgetMacInteractiveUITest* parent, Widget* widget) | 51 Observer(NativeWidgetMacInteractiveUITest* parent, Widget* widget) |
| 52 : TestWidgetObserver(widget), parent_(parent) {} | 52 : TestWidgetObserver(widget), parent_(parent) {} |
| 53 | 53 |
| 54 virtual void OnWidgetActivationChanged(Widget* widget, bool active) OVERRIDE { | 54 virtual void OnWidgetActivationChanged(Widget* widget, bool active) override { |
| 55 if (active) | 55 if (active) |
| 56 parent_->activationCount_++; | 56 parent_->activationCount_++; |
| 57 else | 57 else |
| 58 parent_->deactivationCount_++; | 58 parent_->deactivationCount_++; |
| 59 } | 59 } |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 NativeWidgetMacInteractiveUITest* parent_; | 62 NativeWidgetMacInteractiveUITest* parent_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(Observer); | 64 DISALLOW_COPY_AND_ASSIGN(Observer); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 widget2->CloseNow(); | 137 widget2->CloseNow(); |
| 138 widget->CloseNow(); | 138 widget->CloseNow(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 INSTANTIATE_TEST_CASE_P(NativeWidgetMacInteractiveUITestInstance, | 141 INSTANTIATE_TEST_CASE_P(NativeWidgetMacInteractiveUITestInstance, |
| 142 NativeWidgetMacInteractiveUITest, | 142 NativeWidgetMacInteractiveUITest, |
| 143 ::testing::Bool()); | 143 ::testing::Bool()); |
| 144 | 144 |
| 145 } // namespace test | 145 } // namespace test |
| 146 } // namespace views | 146 } // namespace views |
| OLD | NEW |