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/shell_init_params.h" | 13 #include "ash/shell_init_params.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "chrome/browser/browser_shutdown.h" | 15 #include "chrome/browser/browser_shutdown.h" |
16 #include "chrome/browser/lifetime/application_lifetime.h" | 16 #include "chrome/browser/lifetime/application_lifetime.h" |
| 17 #include "chrome/browser/lifetime/browser_keep_alive.h" |
17 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" | 18 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" |
18 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" | 19 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" |
19 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
20 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
21 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
22 #include "content/public/browser/context_factory.h" | 23 #include "content/public/browser/context_factory.h" |
23 #include "ui/aura/env.h" | 24 #include "ui/aura/env.h" |
24 #include "ui/aura/window_tree_host.h" | 25 #include "ui/aura/window_tree_host.h" |
25 | 26 |
26 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); | 86 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); |
86 ui::MagnifierType magnifier_type = | 87 ui::MagnifierType magnifier_type = |
87 chromeos::MagnificationManager::Get()->GetMagnifierType(); | 88 chromeos::MagnificationManager::Get()->GetMagnifierType(); |
88 shell->magnification_controller()-> | 89 shell->magnification_controller()-> |
89 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_FULL); | 90 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_FULL); |
90 shell->partial_magnification_controller()-> | 91 shell->partial_magnification_controller()-> |
91 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_PARTIAL); | 92 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_PARTIAL); |
92 | 93 |
93 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 94 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
94 switches::kDisableZeroBrowsersOpenForTests)) { | 95 switches::kDisableZeroBrowsersOpenForTests)) { |
95 chrome::IncrementKeepAliveCount(); | 96 browser_lifetime::IncrementKeepAliveCount(); |
96 } | 97 } |
97 #endif | 98 #endif |
98 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 99 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
99 } | 100 } |
100 | 101 |
101 void CloseAsh() { | 102 void CloseAsh() { |
102 if (ash::Shell::HasInstance()) { | 103 if (ash::Shell::HasInstance()) { |
103 ash::Shell::DeleteInstance(); | 104 ash::Shell::DeleteInstance(); |
104 ash::ShellContentState::DestroyInstance(); | 105 ash::ShellContentState::DestroyInstance(); |
105 } | 106 } |
106 } | 107 } |
107 | 108 |
108 } // namespace chrome | 109 } // namespace chrome |
OLD | NEW |