| 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" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Shell takes ownership of ChromeShellDelegate. | 59 // Shell takes ownership of ChromeShellDelegate. |
| 60 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); | 60 ash::Shell* shell = ash::Shell::CreateInstance(new ChromeShellDelegate); |
| 61 shell->event_rewriter_filter()->SetEventRewriterDelegate( | 61 shell->event_rewriter_filter()->SetEventRewriterDelegate( |
| 62 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); | 62 scoped_ptr<ash::EventRewriterDelegate>(new EventRewriter).Pass()); |
| 63 shell->accelerator_controller()->SetScreenshotDelegate( | 63 shell->accelerator_controller()->SetScreenshotDelegate( |
| 64 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 64 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
| 65 #if defined(OS_CHROMEOS) | 65 #if defined(OS_CHROMEOS) |
| 66 shell->accelerator_controller()->SetImeControlDelegate( | 66 shell->accelerator_controller()->SetImeControlDelegate( |
| 67 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 67 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
| 68 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( | 68 shell->high_contrast_controller()->SetEnabled( |
| 69 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 69 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
| 70 | 70 |
| 71 DCHECK(chromeos::MagnificationManager::Get()); | 71 DCHECK(chromeos::MagnificationManager::Get()); |
| 72 bool magnifier_enabled = | 72 bool magnifier_enabled = |
| 73 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | 73 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
| 74 ash::MagnifierType magnifier_type = | 74 ash::MagnifierType magnifier_type = |
| 75 chromeos::MagnificationManager::Get()->GetMagnifierType(); | 75 chromeos::MagnificationManager::Get()->GetMagnifierType(); |
| 76 ash::Shell::GetInstance()->magnification_controller()-> | 76 shell->magnification_controller()-> |
| 77 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); | 77 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); |
| 78 ash::Shell::GetInstance()->partial_magnification_controller()-> | 78 shell->partial_magnification_controller()-> |
| 79 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); | 79 SetEnabled(magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); |
| 80 | 80 |
| 81 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 81 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 82 switches::kDisableZeroBrowsersOpenForTests)) { | 82 switches::kDisableZeroBrowsersOpenForTests)) { |
| 83 chrome::StartKeepAlive(); | 83 chrome::StartKeepAlive(); |
| 84 } | 84 } |
| 85 #endif | 85 #endif |
| 86 ash::Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->Show(); | 86 ash::Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->Show(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void CloseAsh() { | 89 void CloseAsh() { |
| 90 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't | 90 // If shutdown is initiated by |BrowserX11IOErrorHandler|, don't |
| 91 // try to cleanup resources. | 91 // try to cleanup resources. |
| 92 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && | 92 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers() && |
| 93 ash::Shell::HasInstance()) { | 93 ash::Shell::HasInstance()) { |
| 94 ash::Shell::DeleteInstance(); | 94 ash::Shell::DeleteInstance(); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace chrome | 98 } // namespace chrome |
| OLD | NEW |