| 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/test/views_test_helper_mac.h" | 5 #include "ui/views/test/views_test_helper_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> |
| 8 |
| 7 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 9 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 8 #include "ui/views/test/event_generator_delegate_mac.h" | 10 #include "ui/views/test/event_generator_delegate_mac.h" |
| 9 | 11 |
| 10 namespace views { | 12 namespace views { |
| 11 | 13 |
| 12 // static | 14 // static |
| 13 ViewsTestHelper* ViewsTestHelper::Create(base::MessageLoopForUI* message_loop, | 15 ViewsTestHelper* ViewsTestHelper::Create(base::MessageLoopForUI* message_loop, |
| 14 ui::ContextFactory* context_factory) { | 16 ui::ContextFactory* context_factory) { |
| 15 return new ViewsTestHelperMac; | 17 return new ViewsTestHelperMac; |
| 16 } | 18 } |
| 17 | 19 |
| 18 ViewsTestHelperMac::ViewsTestHelperMac() | 20 ViewsTestHelperMac::ViewsTestHelperMac() |
| 19 : zero_duration_mode_(new ui::ScopedAnimationDurationScaleMode( | 21 : zero_duration_mode_(new ui::ScopedAnimationDurationScaleMode( |
| 20 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)) { | 22 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)) { |
| 21 test::InitializeMacEventGeneratorDelegate(); | 23 test::InitializeMacEventGeneratorDelegate(); |
| 24 |
| 25 // Unbundled applications (those without Info.plist) default to |
| 26 // NSApplicationActivationPolicyProhibited, which prohibits the application |
| 27 // obtaining key status or activating windows without user interaction. |
| 28 [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; |
| 22 } | 29 } |
| 23 | 30 |
| 24 ViewsTestHelperMac::~ViewsTestHelperMac() { | 31 ViewsTestHelperMac::~ViewsTestHelperMac() { |
| 25 } | 32 } |
| 26 | 33 |
| 27 } // namespace views | 34 } // namespace views |
| OLD | NEW |