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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 void Quit() { | 140 void Quit() { |
141 window_manager_->Quit(); | 141 window_manager_->Quit(); |
142 } | 142 } |
143 | 143 |
144 // PlatformWindowDelegate: | 144 // PlatformWindowDelegate: |
145 void OnBoundsChanged(const gfx::Rect& new_bounds) override {} | 145 void OnBoundsChanged(const gfx::Rect& new_bounds) override {} |
146 void OnDamageRect(const gfx::Rect& damaged_region) override {} | 146 void OnDamageRect(const gfx::Rect& damaged_region) override {} |
147 void DispatchEvent(ui::Event* event) override { | 147 void DispatchEvent(ui::Event* event) override { |
148 if (event->IsKeyEvent() && | 148 if (event->IsKeyEvent() && |
149 static_cast<ui::KeyEvent*>(event)->code() == ui::DomCode::KEY_Q) | 149 static_cast<ui::KeyEvent*>(event)->code() == ui::DomCode::US_Q) |
150 Quit(); | 150 Quit(); |
151 } | 151 } |
152 void OnCloseRequest() override { Quit(); } | 152 void OnCloseRequest() override { Quit(); } |
153 void OnClosed() override {} | 153 void OnClosed() override {} |
154 void OnWindowStateChanged(ui::PlatformWindowState new_state) override {} | 154 void OnWindowStateChanged(ui::PlatformWindowState new_state) override {} |
155 void OnLostCapture() override {} | 155 void OnLostCapture() override {} |
156 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, | 156 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget, |
157 float device_pixel_ratio) override { | 157 float device_pixel_ratio) override { |
158 DCHECK_NE(widget, gfx::kNullAcceleratedWidget); | 158 DCHECK_NE(widget, gfx::kNullAcceleratedWidget); |
159 widget_ = widget; | 159 widget_ = widget; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 ->SetCurrentLayoutByName("us"); | 337 ->SetCurrentLayoutByName("us"); |
338 | 338 |
339 base::RunLoop run_loop; | 339 base::RunLoop run_loop; |
340 | 340 |
341 WindowManager window_manager(run_loop.QuitClosure()); | 341 WindowManager window_manager(run_loop.QuitClosure()); |
342 | 342 |
343 run_loop.Run(); | 343 run_loop.Run(); |
344 | 344 |
345 return 0; | 345 return 0; |
346 } | 346 } |
OLD | NEW |