OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chrome_browser_main_extra_parts_aura.h" | 5 #include "chrome/browser/chrome_browser_main_extra_parts_aura.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "chrome/browser/ui/views/aura/caps_lock_handler.h" |
11 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" | 12 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" |
12 #include "chrome/browser/ui/views/aura/screen_orientation_listener.h" | 13 #include "chrome/browser/ui/views/aura/screen_orientation_listener.h" |
13 #include "chrome/browser/ui/views/aura/screenshot_taker.h" | 14 #include "chrome/browser/ui/views/aura/screenshot_taker.h" |
14 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
15 | 16 |
16 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
| 18 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
17 #include "chrome/browser/chromeos/system/runtime_environment.h" | 19 #include "chrome/browser/chromeos/system/runtime_environment.h" |
18 #endif | 20 #endif |
19 | 21 |
20 #if defined(USE_WEBKIT_COMPOSITOR) | 22 #if defined(USE_WEBKIT_COMPOSITOR) |
21 #include "ui/gfx/compositor/compositor_setup.h" | 23 #include "ui/gfx/compositor/compositor_setup.h" |
22 #else | 24 #else |
23 #include "ui/gfx/test/gfx_test_utils.h" | 25 #include "ui/gfx/test/gfx_test_utils.h" |
24 #endif | 26 #endif |
25 | 27 |
26 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() | 28 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() |
(...skipping 11 matching lines...) Expand all Loading... |
38 | 40 |
39 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
40 if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) | 42 if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) |
41 aura::RootWindow::set_use_fullscreen_host_window(true); | 43 aura::RootWindow::set_use_fullscreen_host_window(true); |
42 #endif | 44 #endif |
43 | 45 |
44 // Shell takes ownership of ChromeShellDelegate. | 46 // Shell takes ownership of ChromeShellDelegate. |
45 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 47 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
46 shell->accelerator_controller()->SetScreenshotDelegate( | 48 shell->accelerator_controller()->SetScreenshotDelegate( |
47 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 49 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
| 50 #if defined(OS_CHROMEOS) |
| 51 chromeos::input_method::XKeyboard* xkeyboard = |
| 52 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard(); |
| 53 shell->accelerator_controller()->SetCapsLockDelegate( |
| 54 scoped_ptr<ash::CapsLockDelegate>(new CapsLockHandler(xkeyboard)).Pass()); |
| 55 #endif |
48 | 56 |
49 // Make sure the singleton ScreenOrientationListener object is created. | 57 // Make sure the singleton ScreenOrientationListener object is created. |
50 ScreenOrientationListener::GetInstance(); | 58 ScreenOrientationListener::GetInstance(); |
51 } | 59 } |
52 | 60 |
53 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { | 61 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { |
54 ash::Shell::DeleteInstance(); | 62 ash::Shell::DeleteInstance(); |
55 aura::RootWindow::DeleteInstance(); | 63 aura::RootWindow::DeleteInstance(); |
56 } | 64 } |
OLD | NEW |