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" |
20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 21 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
21 #include "chrome/browser/ui/ash/event_rewriter.h" | 22 #include "chrome/browser/ui/ash/event_rewriter.h" |
22 #include "chrome/browser/ui/ash/screenshot_taker.h" | 23 #include "chrome/browser/ui/ash/screenshot_taker.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "ui/aura/env.h" | 25 #include "ui/aura/env.h" |
25 #include "ui/aura/root_window.h" | 26 #include "ui/aura/root_window.h" |
26 #include "ui/compositor/compositor_setup.h" | 27 #include "ui/compositor/compositor_setup.h" |
27 | 28 |
28 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
29 #include "base/chromeos/chromeos_version.h" | 30 #include "base/chromeos/chromeos_version.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 71 |
71 // Its easier to mark all windows as persisting and exclude the ones we care | 72 // Its easier to mark all windows as persisting and exclude the ones we care |
72 // about (browser windows), rather than explicitly excluding certain windows. | 73 // about (browser windows), rather than explicitly excluding certain windows. |
73 ash::SetDefaultPersistsAcrossAllWorkspaces(true); | 74 ash::SetDefaultPersistsAcrossAllWorkspaces(true); |
74 | 75 |
75 // Shell takes ownership of ChromeShellDelegate. | 76 // Shell takes ownership of ChromeShellDelegate. |
76 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 77 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
77 shell->event_rewriter_filter()->SetEventRewriterDelegate( | 78 shell->event_rewriter_filter()->SetEventRewriterDelegate( |
78 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); | 79 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); |
79 shell->accelerator_controller()->SetScreenshotDelegate( | 80 shell->accelerator_controller()->SetScreenshotDelegate( |
80 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 81 scoped_ptr<ash::ScreenshotDelegate>( |
| 82 new ScreenshotTaker( |
| 83 ProfileManager::GetDefaultProfileOrOffTheRecord())).Pass()); |
81 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
82 shell->accelerator_controller()->SetBrightnessControlDelegate( | 85 shell->accelerator_controller()->SetBrightnessControlDelegate( |
83 scoped_ptr<ash::BrightnessControlDelegate>( | 86 scoped_ptr<ash::BrightnessControlDelegate>( |
84 new BrightnessController).Pass()); | 87 new BrightnessController).Pass()); |
85 shell->accelerator_controller()->SetImeControlDelegate( | 88 shell->accelerator_controller()->SetImeControlDelegate( |
86 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 89 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
87 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( | 90 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( |
88 chromeos::accessibility::IsHighContrastEnabled()); | 91 chromeos::accessibility::IsHighContrastEnabled()); |
89 | 92 |
90 DCHECK(chromeos::MagnificationManager::Get()); | 93 DCHECK(chromeos::MagnificationManager::Get()); |
(...skipping 17 matching lines...) Expand all Loading... |
108 void CloseAsh() { | 111 void CloseAsh() { |
109 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 112 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
110 // try to cleanup resources. | 113 // try to cleanup resources. |
111 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 114 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
112 ash::Shell::HasInstance()) { | 115 ash::Shell::HasInstance()) { |
113 ash::Shell::DeleteInstance(); | 116 ash::Shell::DeleteInstance(); |
114 } | 117 } |
115 } | 118 } |
116 | 119 |
117 } // namespace chrome | 120 } // namespace chrome |
OLD | NEW |