| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef UI_BASE_TEST_SCOPED_PREFERRED_SCROLLER_STYLE_LEGACY_MAC_H_ | 5 #ifndef UI_BASE_TEST_SCOPED_PREFERRED_SCROLLER_STYLE_LEGACY_MAC_H_ |
| 6 #define UI_BASE_TEST_SCOPED_PREFERRED_SCROLLER_STYLE_LEGACY_MAC_H_ | 6 #define UI_BASE_TEST_SCOPED_PREFERRED_SCROLLER_STYLE_LEGACY_MAC_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 namespace base { | 11 namespace base { |
| 12 namespace mac { | 12 namespace mac { |
| 13 class ScopedObjCClassSwizzler; | 13 class ScopedObjCClassSwizzler; |
| 14 } | 14 } |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 namespace test { | 18 namespace test { |
| 19 | 19 |
| 20 // Overrides system setting for scrollbar style with NSScrollerStyleLegacy, | 20 // Overrides system setting for scrollbar style with NSScrollerOverlay if we |
| 21 // which means "always show scrollbars". | 21 // want the scrollbar to overlay. Otherwise, override with |
| 22 class ScopedPreferredScrollerStyleLegacy { | 22 // NSScrollerStyleLegacy which means "always show scrollbars". |
| 23 class ScopedPreferredScrollerStyle { |
| 23 public: | 24 public: |
| 24 ScopedPreferredScrollerStyleLegacy(); | 25 explicit ScopedPreferredScrollerStyle(bool overlay); |
| 25 ~ScopedPreferredScrollerStyleLegacy(); | 26 ~ScopedPreferredScrollerStyle(); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 scoped_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_; | 29 scoped_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_; |
| 29 | 30 |
| 30 DISALLOW_COPY_AND_ASSIGN(ScopedPreferredScrollerStyleLegacy); | 31 // True if the scrollbar style should overlay. |
| 32 bool overlay_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(ScopedPreferredScrollerStyle); |
| 31 }; | 35 }; |
| 32 | 36 |
| 33 } // namespace test | 37 } // namespace test |
| 34 } // namespace ui | 38 } // namespace ui |
| 35 | 39 |
| 36 #endif // UI_BASE_TEST_SCOPED_PREFERRED_SCROLLER_STYLE_LEGACY_MAC_H_ | 40 #endif // UI_BASE_TEST_SCOPED_PREFERRED_SCROLLER_STYLE_LEGACY_MAC_H_ |
| OLD | NEW |