Chromium Code Reviews| 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_delegate_aura.h" | 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 8 #include "ash/aura/wm_shell_aura.h" | 8 #include "ash/aura/wm_shell_aura.h" |
| 9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
| 10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 29 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
| 30 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| 31 #include "chromeos/accelerometer/accelerometer_reader.h" | 31 #include "chromeos/accelerometer/accelerometer_reader.h" |
| 32 #include "chromeos/chromeos_switches.h" | 32 #include "chromeos/chromeos_switches.h" |
| 33 #include "chromeos/login/login_state.h" | 33 #include "chromeos/login/login_state.h" |
| 34 #include "content/public/browser/browser_thread.h" | 34 #include "content/public/browser/browser_thread.h" |
| 35 #include "content/public/browser/context_factory.h" | 35 #include "content/public/browser/context_factory.h" |
| 36 #include "ui/aura/env.h" | 36 #include "ui/aura/env.h" |
| 37 #include "ui/aura/window_tree_host.h" | 37 #include "ui/aura/window_tree_host.h" |
| 38 | 38 |
| 39 #include "ash/common/wallpaper/wallpaper_controller.h" | |
| 40 #include "components/wallpaper/pref_based_wallpaper_color_cache.h" | |
| 41 | |
| 39 #if defined(USE_X11) | 42 #if defined(USE_X11) |
| 40 #include "ui/base/x/x11_util.h" // nogncheck | 43 #include "ui/base/x/x11_util.h" // nogncheck |
| 41 #endif | 44 #endif |
| 42 | 45 |
| 43 namespace chrome { | 46 namespace chrome { |
| 44 | 47 |
| 45 void OpenAsh(gfx::AcceleratedWidget remote_window) { | 48 void OpenAsh(gfx::AcceleratedWidget remote_window) { |
| 46 #if defined(USE_X11) | 49 #if defined(USE_X11) |
| 47 if (base::SysInfo::IsRunningOnChromeOS()) { | 50 if (base::SysInfo::IsRunningOnChromeOS()) { |
| 48 // Hides the cursor outside of the Aura root window. The cursor will be | 51 // Hides the cursor outside of the Aura root window. The cursor will be |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 shell->magnification_controller()->SetEnabled( | 94 shell->magnification_controller()->SetEnabled( |
| 92 magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); | 95 magnifier_enabled && magnifier_type == ash::MAGNIFIER_FULL); |
| 93 shell->partial_magnification_controller()->SetEnabled( | 96 shell->partial_magnification_controller()->SetEnabled( |
| 94 magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); | 97 magnifier_enabled && magnifier_type == ash::MAGNIFIER_PARTIAL); |
| 95 | 98 |
| 96 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 99 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 97 switches::kDisableZeroBrowsersOpenForTests)) { | 100 switches::kDisableZeroBrowsersOpenForTests)) { |
| 98 g_browser_process->platform_part()->RegisterKeepAlive(); | 101 g_browser_process->platform_part()->RegisterKeepAlive(); |
| 99 } | 102 } |
| 100 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 103 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
| 104 | |
| 105 // TODO(bruthig): Is this the right place to initialize the cache? Maybe | |
| 106 // it be initialized Ash side and wrap ash::Shell::pref_store() some how? | |
| 107 // TODO(bruthig): Merge with master. | |
| 108 // TODO(bruthig): Don't leak the cache. | |
| 109 ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperColorCache( | |
|
jonross
2017/03/28 14:33:28
This may be more appropriate in the chromeos::Wall
bruthig
2017/03/28 15:18:50
I tried to initialize the cache in the WallpaperMa
jonross
2017/03/28 18:24:35
That's a bit scary. A lot of login screen code rel
| |
| 110 new wallpaper::PrefBasedWallpaperColorCache( | |
| 111 g_browser_process->local_state())); | |
| 101 } | 112 } |
| 102 | 113 |
| 103 void CloseAsh() { | 114 void CloseAsh() { |
| 104 if (ash::Shell::HasInstance()) { | 115 if (ash::Shell::HasInstance()) { |
| 105 ash::Shell::DeleteInstance(); | 116 ash::Shell::DeleteInstance(); |
| 106 ash::ShellContentState::DestroyInstance(); | 117 ash::ShellContentState::DestroyInstance(); |
| 107 } | 118 } |
| 108 } | 119 } |
| 109 | 120 |
| 110 } // namespace chrome | 121 } // namespace chrome |
| OLD | NEW |