| 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/ui/ash/ash_init.h" | 5 #include "chrome/browser/ui/ash/ash_init.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/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
| 10 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/wm/key_rewriter_event_filter.h" | 12 #include "ash/wm/key_rewriter_event_filter.h" |
| 13 #include "ash/wm/property_util.h" | 13 #include "ash/wm/property_util.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 16 #include "chrome/browser/lifetime/application_lifetime.h" | 16 #include "chrome/browser/lifetime/application_lifetime.h" |
| 17 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" | 17 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" |
| 18 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" | 18 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" |
| 19 #include "chrome/browser/ui/views/ash/key_rewriter.h" | 19 #include "chrome/browser/ui/views/ash/key_rewriter.h" |
| 20 #include "chrome/browser/ui/views/ash/screenshot_taker.h" | |
| 21 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 22 #include "ui/aura/aura_switches.h" | 21 #include "ui/aura/aura_switches.h" |
| 23 #include "ui/aura/env.h" | 22 #include "ui/aura/env.h" |
| 24 #include "ui/aura/display_manager.h" | 23 #include "ui/aura/display_manager.h" |
| 25 #include "ui/aura/root_window.h" | 24 #include "ui/aura/root_window.h" |
| 26 #include "ui/compositor/compositor_setup.h" | 25 #include "ui/compositor/compositor_setup.h" |
| 27 | 26 |
| 28 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
| 29 #include "base/chromeos/chromeos_version.h" | 28 #include "base/chromeos/chromeos_version.h" |
| 30 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 61 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) | 60 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) |
| 62 ash::Shell::set_initially_hide_cursor(true); | 61 ash::Shell::set_initially_hide_cursor(true); |
| 63 #endif | 62 #endif |
| 64 } | 63 } |
| 65 | 64 |
| 66 // Its easier to mark all windows as persisting and exclude the ones we care | 65 // Its easier to mark all windows as persisting and exclude the ones we care |
| 67 // about (browser windows), rather than explicitly excluding certain windows. | 66 // about (browser windows), rather than explicitly excluding certain windows. |
| 68 ash::SetDefaultPersistsAcrossAllWorkspaces(true); | 67 ash::SetDefaultPersistsAcrossAllWorkspaces(true); |
| 69 | 68 |
| 70 // Shell takes ownership of ChromeShellDelegate. | 69 // Shell takes ownership of ChromeShellDelegate. |
| 71 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 70 ChromeShellDelegate* delegate = new ChromeShellDelegate; |
| 71 ash::Shell* shell = ash::Shell::CreateInstance(delegate); |
| 72 shell->key_rewriter_filter()->SetKeyRewriterDelegate( | 72 shell->key_rewriter_filter()->SetKeyRewriterDelegate( |
| 73 scoped_ptr<ash::KeyRewriterDelegate>(new KeyRewriter).Pass()); | 73 scoped_ptr<ash::KeyRewriterDelegate>(new KeyRewriter).Pass()); |
| 74 shell->accelerator_controller()->SetScreenshotDelegate( | |
| 75 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | |
| 76 #if defined(OS_CHROMEOS) | 74 #if defined(OS_CHROMEOS) |
| 75 delegate->UpdateScreenshotDelegate(); |
| 77 shell->accelerator_controller()->SetBrightnessControlDelegate( | 76 shell->accelerator_controller()->SetBrightnessControlDelegate( |
| 78 scoped_ptr<ash::BrightnessControlDelegate>( | 77 scoped_ptr<ash::BrightnessControlDelegate>( |
| 79 new BrightnessController).Pass()); | 78 new BrightnessController).Pass()); |
| 80 chromeos::input_method::XKeyboard* xkeyboard = | 79 chromeos::input_method::XKeyboard* xkeyboard = |
| 81 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard(); | 80 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard(); |
| 82 shell->accelerator_controller()->SetCapsLockDelegate( | 81 shell->accelerator_controller()->SetCapsLockDelegate( |
| 83 scoped_ptr<ash::CapsLockDelegate>(new CapsLockHandler(xkeyboard)).Pass()); | 82 scoped_ptr<ash::CapsLockDelegate>(new CapsLockHandler(xkeyboard)).Pass()); |
| 84 shell->accelerator_controller()->SetImeControlDelegate( | 83 shell->accelerator_controller()->SetImeControlDelegate( |
| 85 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 84 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
| 86 shell->accelerator_controller()->SetVolumeControlDelegate( | 85 shell->accelerator_controller()->SetVolumeControlDelegate( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 99 #endif | 98 #endif |
| 100 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 99 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
| 101 } | 100 } |
| 102 | 101 |
| 103 void CloseAsh() { | 102 void CloseAsh() { |
| 104 if (ash::Shell::GetInstance()) | 103 if (ash::Shell::GetInstance()) |
| 105 ash::Shell::DeleteInstance(); | 104 ash::Shell::DeleteInstance(); |
| 106 } | 105 } |
| 107 | 106 |
| 108 } // namespace chrome | 107 } // namespace chrome |
| OLD | NEW |