| 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_ash.h" | 5 #include "chrome/browser/chrome_browser_main_extra_parts_ash.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/key_rewriter_event_filter.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
| 13 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" | 14 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" |
| 14 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" | 15 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" |
| 16 #include "chrome/browser/ui/views/ash/key_rewriter.h" |
| 15 #include "chrome/browser/ui/views/ash/screen_orientation_listener.h" | 17 #include "chrome/browser/ui/views/ash/screen_orientation_listener.h" |
| 16 #include "chrome/browser/ui/views/ash/screenshot_taker.h" | 18 #include "chrome/browser/ui/views/ash/screenshot_taker.h" |
| 17 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" | 19 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" |
| 18 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
| 19 #include "ui/aura/aura_switches.h" | 21 #include "ui/aura/aura_switches.h" |
| 20 #include "ui/aura/monitor_manager.h" | 22 #include "ui/aura/monitor_manager.h" |
| 21 #include "ui/aura/root_window.h" | 23 #include "ui/aura/root_window.h" |
| 22 #include "ui/gfx/compositor/compositor_setup.h" | 24 #include "ui/gfx/compositor/compositor_setup.h" |
| 23 | 25 |
| 24 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 42 aura::MonitorManager::set_use_fullscreen_host_window(true); | 44 aura::MonitorManager::set_use_fullscreen_host_window(true); |
| 43 aura::RootWindow::set_hide_host_cursor(true); | 45 aura::RootWindow::set_hide_host_cursor(true); |
| 44 // Hide the mouse cursor completely at boot. | 46 // Hide the mouse cursor completely at boot. |
| 45 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) | 47 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) |
| 46 ash::Shell::set_initially_hide_cursor(true); | 48 ash::Shell::set_initially_hide_cursor(true); |
| 47 } | 49 } |
| 48 #endif | 50 #endif |
| 49 | 51 |
| 50 // Shell takes ownership of ChromeShellDelegate. | 52 // Shell takes ownership of ChromeShellDelegate. |
| 51 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 53 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
| 54 shell->key_rewriter_filter()->SetKeyRewriterDelegate( |
| 55 scoped_ptr<ash::KeyRewriterDelegate>(new KeyRewriter).Pass()); |
| 52 shell->accelerator_controller()->SetScreenshotDelegate( | 56 shell->accelerator_controller()->SetScreenshotDelegate( |
| 53 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 57 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
| 54 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 55 shell->accelerator_controller()->SetBrightnessControlDelegate( | 59 shell->accelerator_controller()->SetBrightnessControlDelegate( |
| 56 scoped_ptr<ash::BrightnessControlDelegate>( | 60 scoped_ptr<ash::BrightnessControlDelegate>( |
| 57 new BrightnessController).Pass()); | 61 new BrightnessController).Pass()); |
| 58 chromeos::input_method::XKeyboard* xkeyboard = | 62 chromeos::input_method::XKeyboard* xkeyboard = |
| 59 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard(); | 63 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard(); |
| 60 shell->accelerator_controller()->SetCapsLockDelegate( | 64 shell->accelerator_controller()->SetCapsLockDelegate( |
| 61 scoped_ptr<ash::CapsLockDelegate>(new CapsLockHandler(xkeyboard)).Pass()); | 65 scoped_ptr<ash::CapsLockDelegate>(new CapsLockHandler(xkeyboard)).Pass()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 77 // Add the status area buttons after Profile has been initialized. | 81 // Add the status area buttons after Profile has been initialized. |
| 78 if (CommandLine::ForCurrentProcess()->HasSwitch( | 82 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 79 ash::switches::kDisableAshUberTray)) { | 83 ash::switches::kDisableAshUberTray)) { |
| 80 ChromeShellDelegate::instance()->status_area_host()->AddButtons(); | 84 ChromeShellDelegate::instance()->status_area_host()->AddButtons(); |
| 81 } | 85 } |
| 82 } | 86 } |
| 83 | 87 |
| 84 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { | 88 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { |
| 85 ash::Shell::DeleteInstance(); | 89 ash::Shell::DeleteInstance(); |
| 86 } | 90 } |
| OLD | NEW |