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

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

Issue 2891263002: chromeos: Remove some IME methods from ash::SystemTrayDelegate (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/ash/ime_controller_chromeos.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/accelerators/accelerator_controller_delegate_aura.h" 8 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
9 #include "ash/accessibility_types.h" 9 #include "ash/accessibility_types.h"
10 #include "ash/aura/shell_port_classic.h" 10 #include "ash/aura/shell_port_classic.h"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/browser/browser_process.h" 25 #include "chrome/browser/browser_process.h"
26 #include "chrome/browser/browser_process_platform_part.h" 26 #include "chrome/browser/browser_process_platform_part.h"
27 #include "chrome/browser/browser_shutdown.h" 27 #include "chrome/browser/browser_shutdown.h"
28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
30 #include "chrome/browser/chromeos/ash_config.h" 30 #include "chrome/browser/chromeos/ash_config.h"
31 #include "chrome/browser/lifetime/application_lifetime.h" 31 #include "chrome/browser/lifetime/application_lifetime.h"
32 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" 32 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
33 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" 33 #include "chrome/browser/ui/ash/chrome_shell_content_state.h"
34 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 34 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
35 #include "chrome/browser/ui/ash/ime_controller_chromeos.h"
36 #include "chrome/common/chrome_switches.h" 35 #include "chrome/common/chrome_switches.h"
37 #include "chromeos/accelerometer/accelerometer_reader.h" 36 #include "chromeos/accelerometer/accelerometer_reader.h"
38 #include "chromeos/chromeos_switches.h" 37 #include "chromeos/chromeos_switches.h"
39 #include "chromeos/login/login_state.h" 38 #include "chromeos/login/login_state.h"
40 #include "content/public/browser/browser_thread.h" 39 #include "content/public/browser/browser_thread.h"
41 #include "content/public/browser/context_factory.h" 40 #include "content/public/browser/context_factory.h"
42 #include "content/public/common/service_manager_connection.h" 41 #include "content/public/common/service_manager_connection.h"
43 #include "ui/aura/env.h" 42 #include "ui/aura/env.h"
44 #include "ui/aura/mus/window_tree_client.h" 43 #include "ui/aura/mus/window_tree_client.h"
45 #include "ui/aura/window_tree_host.h" 44 #include "ui/aura/window_tree_host.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 std::unique_ptr<ChromeScreenshotGrabber> screenshot_delegate = 128 std::unique_ptr<ChromeScreenshotGrabber> screenshot_delegate =
130 base::MakeUnique<ChromeScreenshotGrabber>(); 129 base::MakeUnique<ChromeScreenshotGrabber>();
131 accelerator_controller_delegate->SetScreenshotDelegate( 130 accelerator_controller_delegate->SetScreenshotDelegate(
132 std::move(screenshot_delegate)); 131 std::move(screenshot_delegate));
133 } 132 }
134 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. 133 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos.
135 chromeos::AccelerometerReader::GetInstance()->Initialize( 134 chromeos::AccelerometerReader::GetInstance()->Initialize(
136 base::CreateSequencedTaskRunnerWithTraits( 135 base::CreateSequencedTaskRunnerWithTraits(
137 {base::MayBlock(), base::TaskPriority::BACKGROUND, 136 {base::MayBlock(), base::TaskPriority::BACKGROUND,
138 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})); 137 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}));
139 shell->accelerator_controller()->SetImeControlDelegate(
140 std::unique_ptr<ash::ImeControlDelegate>(new ImeController));
141 shell->high_contrast_controller()->SetEnabled( 138 shell->high_contrast_controller()->SetEnabled(
142 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); 139 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled());
143 140
144 DCHECK(chromeos::MagnificationManager::Get()); 141 DCHECK(chromeos::MagnificationManager::Get());
145 bool magnifier_enabled = 142 bool magnifier_enabled =
146 chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); 143 chromeos::MagnificationManager::Get()->IsMagnifierEnabled();
147 ash::MagnifierType magnifier_type = 144 ash::MagnifierType magnifier_type =
148 chromeos::MagnificationManager::Get()->GetMagnifierType(); 145 chromeos::MagnificationManager::Get()->GetMagnifierType();
149 shell->magnification_controller()->SetEnabled( 146 shell->magnification_controller()->SetEnabled(
150 magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); 147 magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL);
151 shell->partial_magnification_controller()->SetEnabled( 148 shell->partial_magnification_controller()->SetEnabled(
152 magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); 149 magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL);
153 150
154 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 151 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
155 switches::kDisableZeroBrowsersOpenForTests)) { 152 switches::kDisableZeroBrowsersOpenForTests)) {
156 g_browser_process->platform_part()->RegisterKeepAlive(); 153 g_browser_process->platform_part()->RegisterKeepAlive();
157 } 154 }
158 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); 155 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
159 } 156 }
160 157
161 AshInit::~AshInit() { 158 AshInit::~AshInit() {
162 // |window_manager_| deletes the Shell. 159 // |window_manager_| deletes the Shell.
163 if (!window_manager_ && ash::Shell::HasInstance()) { 160 if (!window_manager_ && ash::Shell::HasInstance()) {
164 ash::Shell::DeleteInstance(); 161 ash::Shell::DeleteInstance();
165 ash::ShellContentState::DestroyInstance(); 162 ash::ShellContentState::DestroyInstance();
166 } 163 }
167 } 164 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/ash/ime_controller_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698