| 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/magnifier/partial_magnification_controller.h" | 11 #include "ash/magnifier/partial_magnification_controller.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/wm/event_rewriter_event_filter.h" | 13 #include "ash/wm/event_rewriter_event_filter.h" |
| 14 #include "ash/wm/property_util.h" | 14 #include "ash/wm/property_util.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "chrome/browser/browser_shutdown.h" | 16 #include "chrome/browser/browser_shutdown.h" |
| 17 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 17 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 19 #include "chrome/browser/lifetime/application_lifetime.h" | 19 #include "chrome/browser/lifetime/application_lifetime.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | |
| 21 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 22 #include "chrome/browser/ui/ash/event_rewriter.h" | 21 #include "chrome/browser/ui/ash/event_rewriter.h" |
| 23 #include "chrome/browser/ui/ash/screenshot_taker.h" | 22 #include "chrome/browser/ui/ash/screenshot_taker.h" |
| 24 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 25 #include "ui/aura/env.h" | 24 #include "ui/aura/env.h" |
| 26 #include "ui/aura/root_window.h" | 25 #include "ui/aura/root_window.h" |
| 27 #include "ui/compositor/compositor_setup.h" | 26 #include "ui/compositor/compositor_setup.h" |
| 28 | 27 |
| 29 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 30 #include "base/chromeos/chromeos_version.h" | 29 #include "base/chromeos/chromeos_version.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 61 |
| 63 // Its easier to mark all windows as persisting and exclude the ones we care | 62 // Its easier to mark all windows as persisting and exclude the ones we care |
| 64 // about (browser windows), rather than explicitly excluding certain windows. | 63 // about (browser windows), rather than explicitly excluding certain windows. |
| 65 ash::SetDefaultPersistsAcrossAllWorkspaces(true); | 64 ash::SetDefaultPersistsAcrossAllWorkspaces(true); |
| 66 | 65 |
| 67 // Shell takes ownership of ChromeShellDelegate. | 66 // Shell takes ownership of ChromeShellDelegate. |
| 68 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 67 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
| 69 shell->event_rewriter_filter()->SetEventRewriterDelegate( | 68 shell->event_rewriter_filter()->SetEventRewriterDelegate( |
| 70 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); | 69 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); |
| 71 shell->accelerator_controller()->SetScreenshotDelegate( | 70 shell->accelerator_controller()->SetScreenshotDelegate( |
| 72 scoped_ptr<ash::ScreenshotDelegate>( | 71 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
| 73 new ScreenshotTaker( | |
| 74 ProfileManager::GetDefaultProfileOrOffTheRecord())).Pass()); | |
| 75 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
| 76 shell->accelerator_controller()->SetBrightnessControlDelegate( | 73 shell->accelerator_controller()->SetBrightnessControlDelegate( |
| 77 scoped_ptr<ash::BrightnessControlDelegate>( | 74 scoped_ptr<ash::BrightnessControlDelegate>( |
| 78 new BrightnessController).Pass()); | 75 new BrightnessController).Pass()); |
| 79 shell->accelerator_controller()->SetImeControlDelegate( | 76 shell->accelerator_controller()->SetImeControlDelegate( |
| 80 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 77 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
| 81 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( | 78 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( |
| 82 chromeos::accessibility::IsHighContrastEnabled()); | 79 chromeos::accessibility::IsHighContrastEnabled()); |
| 83 | 80 |
| 84 DCHECK(chromeos::MagnificationManager::Get()); | 81 DCHECK(chromeos::MagnificationManager::Get()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 102 void CloseAsh() { | 99 void CloseAsh() { |
| 103 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 100 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
| 104 // try to cleanup resources. | 101 // try to cleanup resources. |
| 105 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 102 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
| 106 ash::Shell::HasInstance()) { | 103 ash::Shell::HasInstance()) { |
| 107 ash::Shell::DeleteInstance(); | 104 ash::Shell::DeleteInstance(); |
| 108 } | 105 } |
| 109 } | 106 } |
| 110 | 107 |
| 111 } // namespace chrome | 108 } // namespace chrome |
| OLD | NEW |