Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/ui/ash/ash_init.cc

Issue 1778873002: Replace Increment/DecrementKeepAliveCount by ScopedKeepAlives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KAObserver
Patch Set: replace the commented dcheck by a dlog Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "build/build_config.h" 15 #include "build/build_config.h"
16 #include "chrome/browser/browser_shutdown.h" 16 #include "chrome/browser/browser_shutdown.h"
17 #include "chrome/browser/lifetime/application_lifetime.h" 17 #include "chrome/browser/lifetime/application_lifetime.h"
18 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" 18 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
19 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" 19 #include "chrome/browser/ui/ash/chrome_shell_content_state.h"
20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
21 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
22 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
23 #include "content/public/browser/context_factory.h" 23 #include "content/public/browser/context_factory.h"
24 #include "ui/aura/env.h" 24 #include "ui/aura/env.h"
25 #include "ui/aura/window_tree_host.h" 25 #include "ui/aura/window_tree_host.h"
26 26
27 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
28 #include "base/sys_info.h" 28 #include "base/sys_info.h"
29 #include "chrome/browser/browser_process.h"
30 #include "chrome/browser/browser_process_platform_part.h"
29 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
30 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 32 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
31 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" 33 #include "chrome/browser/ui/ash/ime_controller_chromeos.h"
32 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 34 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
33 #include "chromeos/accelerometer/accelerometer_reader.h" 35 #include "chromeos/accelerometer/accelerometer_reader.h"
34 #include "chromeos/chromeos_switches.h" 36 #include "chromeos/chromeos_switches.h"
35 #include "chromeos/login/login_state.h" 37 #include "chromeos/login/login_state.h"
36 #include "ui/base/x/x11_util.h" 38 #include "ui/base/x/x11_util.h"
37 #endif 39 #endif
38 40
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); 88 chromeos::MagnificationManager::Get()->IsMagnifierEnabled();
87 ui::MagnifierType magnifier_type = 89 ui::MagnifierType magnifier_type =
88 chromeos::MagnificationManager::Get()->GetMagnifierType(); 90 chromeos::MagnificationManager::Get()->GetMagnifierType();
89 shell->magnification_controller()-> 91 shell->magnification_controller()->
90 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_FULL); 92 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_FULL);
91 shell->partial_magnification_controller()-> 93 shell->partial_magnification_controller()->
92 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_PARTIAL); 94 SetEnabled(magnifier_enabled && magnifier_type == ui::MAGNIFIER_PARTIAL);
93 95
94 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 96 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
95 switches::kDisableZeroBrowsersOpenForTests)) { 97 switches::kDisableZeroBrowsersOpenForTests)) {
96 chrome::IncrementKeepAliveCount(); 98 g_browser_process->platform_part()->RegisterKeepAlive();
97 } 99 }
98 #endif 100 #endif
99 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); 101 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
100 } 102 }
101 103
102 void CloseAsh() { 104 void CloseAsh() {
103 if (ash::Shell::HasInstance()) { 105 if (ash::Shell::HasInstance()) {
104 ash::Shell::DeleteInstance(); 106 ash::Shell::DeleteInstance();
105 ash::ShellContentState::DestroyInstance(); 107 ash::ShellContentState::DestroyInstance();
106 } 108 }
107 } 109 }
108 110
109 } // namespace chrome 111 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_views_browsertest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698