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_manager.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/ui/ash/chrome_shell_delegate.h" | 20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
21 #include "chrome/browser/ui/ash/event_rewriter.h" | 21 #include "chrome/browser/ui/ash/event_rewriter.h" |
22 #include "chrome/browser/ui/ash/screenshot_taker.h" | 22 #include "chrome/browser/ui/ash/screenshot_taker.h" |
23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
24 #include "ui/aura/env.h" | 24 #include "ui/aura/env.h" |
25 #include "ui/aura/root_window.h" | 25 #include "ui/aura/root_window.h" |
26 #include "ui/compositor/compositor_setup.h" | 26 #include "ui/compositor/compositor_setup.h" |
27 | 27 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); | 69 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); |
70 shell->accelerator_controller()->SetScreenshotDelegate( | 70 shell->accelerator_controller()->SetScreenshotDelegate( |
71 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 71 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
72 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
73 shell->accelerator_controller()->SetBrightnessControlDelegate( | 73 shell->accelerator_controller()->SetBrightnessControlDelegate( |
74 scoped_ptr<ash::BrightnessControlDelegate>( | 74 scoped_ptr<ash::BrightnessControlDelegate>( |
75 new BrightnessController).Pass()); | 75 new BrightnessController).Pass()); |
76 shell->accelerator_controller()->SetImeControlDelegate( | 76 shell->accelerator_controller()->SetImeControlDelegate( |
77 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 77 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
78 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( | 78 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( |
79 chromeos::accessibility::IsHighContrastEnabled()); | 79 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
80 | 80 |
81 DCHECK(chromeos::MagnificationManager::Get()); | 81 DCHECK(chromeos::MagnificationManager::Get()); |
82 bool magnifier_enabled = | 82 bool magnifier_enabled = |
83 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | 83 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
84 ash::MagnifierType magnifier_type = | 84 ash::MagnifierType magnifier_type = |
85 chromeos::MagnificationManager::Get()->GetMagnifierType(); | 85 chromeos::MagnificationManager::Get()->GetMagnifierType(); |
86 ash::Shell::GetInstance()->magnification_controller()-> | 86 ash::Shell::GetInstance()->magnification_controller()-> |
87 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); | 87 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); |
88 ash::Shell::GetInstance()->partial_magnification_controller()-> | 88 ash::Shell::GetInstance()->partial_magnification_controller()-> |
89 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); | 89 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); |
90 | 90 |
91 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 91 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
92 switches::kDisableZeroBrowsersOpenForTests)) { | 92 switches::kDisableZeroBrowsersOpenForTests)) { |
93 chrome::StartKeepAlive(); | 93 chrome::StartKeepAlive(); |
94 } | 94 } |
95 #endif | 95 #endif |
96 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 96 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
97 } | 97 } |
98 | 98 |
99 void CloseAsh() { | 99 void CloseAsh() { |
100 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 100 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
101 // try to cleanup resources. | 101 // try to cleanup resources. |
102 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 102 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
103 ash::Shell::HasInstance()) { | 103 ash::Shell::HasInstance()) { |
104 ash::Shell::DeleteInstance(); | 104 ash::Shell::DeleteInstance(); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 } // namespace chrome | 108 } // namespace chrome |
OLD | NEW |