Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: ui/wm/core/nested_accelerator_controller_unittest.cc

Issue 838253004: MacViews: Fix duplicate definition of ExtensionKeyBindingRegistry::SetShortcutHandlingSuspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DragBookmarks2
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« ui/views/focus/focus_manager.cc ('K') | « ui/views/views.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/wm/core/nested_accelerator_controller.h" 5 #include "ui/wm/core/nested_accelerator_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/event_types.h" 8 #include "base/event_types.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "ui/aura/test/aura_test_base.h" 10 #include "ui/aura/test/aura_test_base.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 class MockNestedAcceleratorDelegate : public NestedAcceleratorDelegate { 100 class MockNestedAcceleratorDelegate : public NestedAcceleratorDelegate {
101 public: 101 public:
102 MockNestedAcceleratorDelegate() 102 MockNestedAcceleratorDelegate()
103 : accelerator_manager_(new ui::AcceleratorManager) {} 103 : accelerator_manager_(new ui::AcceleratorManager) {}
104 ~MockNestedAcceleratorDelegate() override {} 104 ~MockNestedAcceleratorDelegate() override {}
105 105
106 // NestedAcceleratorDelegate: 106 // NestedAcceleratorDelegate:
107 Result ProcessAccelerator(const ui::Accelerator& accelerator) override { 107 Result ProcessAccelerator(const ui::Accelerator& accelerator) override {
108 return accelerator_manager_->Process(accelerator) ? 108 return accelerator_manager_->ProcessAccelerator(accelerator)
109 RESULT_PROCESSED : RESULT_NOT_PROCESSED; 109 ? RESULT_PROCESSED
110 : RESULT_NOT_PROCESSED;
110 } 111 }
111 112
112 void Register(const ui::Accelerator& accelerator, 113 void Register(const ui::Accelerator& accelerator,
113 ui::AcceleratorTarget* target) { 114 ui::AcceleratorTarget* target) {
114 accelerator_manager_->Register( 115 accelerator_manager_->Register(
115 accelerator, ui::AcceleratorManager::kNormalPriority, target); 116 accelerator, ui::AcceleratorManager::kNormalPriority, target);
116 } 117 }
117 118
118 private: 119 private:
119 scoped_ptr<ui::AcceleratorManager> accelerator_manager_; 120 scoped_ptr<ui::AcceleratorManager> accelerator_manager_;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 &inner_dispatcher); 198 &inner_dispatcher);
198 aura::client::DispatcherRunLoop run_loop( 199 aura::client::DispatcherRunLoop run_loop(
199 aura::client::GetDispatcherClient(root_window()), NULL); 200 aura::client::GetDispatcherClient(root_window()), NULL);
200 run_loop.Run(); 201 run_loop.Run();
201 EXPECT_EQ(0, inner_dispatcher.num_key_events_dispatched()); 202 EXPECT_EQ(0, inner_dispatcher.num_key_events_dispatched());
202 EXPECT_EQ(1, target.accelerator_pressed_count()); 203 EXPECT_EQ(1, target.accelerator_pressed_count());
203 } 204 }
204 205
205 } // namespace test 206 } // namespace test
206 } // namespace wm 207 } // namespace wm
OLDNEW
« ui/views/focus/focus_manager.cc ('K') | « ui/views/views.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698