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

Side by Side Diff: chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc

Issue 2628933003: Revert of Reland: chromeos: Fix shelf appearing at login screen under mash (Closed)
Patch Set: Created 3 years, 11 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/views/ash/chrome_browser_main_extra_parts_ash.h ('k') | no next file » | 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/views/ash/chrome_browser_main_extra_parts_ash.h" 5 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/command_line.h"
10 #include "base/lazy_instance.h"
11 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "build/build_config.h"
10 #include "chrome/browser/chrome_browser_main.h" 14 #include "chrome/browser/chrome_browser_main.h"
11 #include "chrome/browser/ui/ash/ash_init.h" 15 #include "chrome/browser/ui/ash/ash_init.h"
12 #include "chrome/browser/ui/ash/ash_util.h" 16 #include "chrome/browser/ui/ash/ash_util.h"
13 #include "chrome/browser/ui/ash/cast_config_client_media_router.h" 17 #include "chrome/browser/ui/ash/cast_config_client_media_router.h"
14 #include "chrome/browser/ui/ash/chrome_new_window_client.h" 18 #include "chrome/browser/ui/ash/chrome_new_window_client.h"
15 #include "chrome/browser/ui/ash/chrome_shell_content_state.h" 19 #include "chrome/browser/ui/ash/chrome_shell_content_state.h"
16 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h" 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h"
17 #include "chrome/browser/ui/ash/media_client.h" 21 #include "chrome/browser/ui/ash/media_client.h"
18 #include "chrome/browser/ui/ash/session_controller_client.h"
19 #include "chrome/browser/ui/ash/system_tray_client.h"
20 #include "chrome/browser/ui/ash/volume_controller.h"
21 #include "chrome/browser/ui/ash/vpn_list_forwarder.h"
22 #include "chrome/browser/ui/views/ash/tab_scrubber.h" 22 #include "chrome/browser/ui/views/ash/tab_scrubber.h"
23 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" 23 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
24 #include "chrome/browser/ui/views/frame/immersive_context_mus.h" 24 #include "chrome/browser/ui/views/frame/immersive_context_mus.h"
25 #include "chrome/browser/ui/views/frame/immersive_handler_factory_mus.h" 25 #include "chrome/browser/ui/views/frame/immersive_handler_factory_mus.h"
26 #include "chrome/browser/ui/views/select_file_dialog_extension.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" 27 #include "ui/aura/env.h"
28 #include "ui/keyboard/content/keyboard.h" 28 #include "ui/keyboard/content/keyboard.h"
29 #include "ui/keyboard/keyboard_controller.h" 29 #include "ui/keyboard/keyboard_controller.h"
30 #include "ui/wm/core/capture_controller.h" 30 #include "ui/wm/core/capture_controller.h"
31 #include "ui/wm/core/wm_state.h" 31 #include "ui/wm/core/wm_state.h"
32 32
33 #if defined(OS_CHROMEOS)
34 #include "chrome/browser/ui/ash/session_controller_client.h"
35 #include "chrome/browser/ui/ash/system_tray_client.h"
36 #include "chrome/browser/ui/ash/volume_controller.h"
37 #include "chrome/browser/ui/ash/vpn_list_forwarder.h"
38 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
39 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h"
40 #endif // defined(OS_CHROMEOS)
41
33 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh( 42 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh(
34 ChromeBrowserMainExtraPartsViews* extra_parts_views) 43 ChromeBrowserMainExtraPartsViews* extra_parts_views)
35 : extra_parts_views_(extra_parts_views) {} 44 : extra_parts_views_(extra_parts_views) {}
36 45
37 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {} 46 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {}
38 47
39 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { 48 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() {
40 if (chrome::ShouldOpenAshOnStartup()) 49 if (chrome::ShouldOpenAshOnStartup())
41 chrome::OpenAsh(gfx::kNullAcceleratedWidget); 50 chrome::OpenAsh(gfx::kNullAcceleratedWidget);
42 51
43 if (chrome::IsRunningInMash()) { 52 if (chrome::IsRunningInMash()) {
44 immersive_context_ = base::MakeUnique<ImmersiveContextMus>( 53 immersive_context_ = base::MakeUnique<ImmersiveContextMus>(
45 extra_parts_views_->wm_state()->capture_controller()); 54 extra_parts_views_->wm_state()->capture_controller());
46 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); 55 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>();
47 } 56 }
48 57
49 session_controller_client_ = base::MakeUnique<SessionControllerClient>(); 58 #if defined(OS_CHROMEOS)
59 // TODO(xiyuan): Update after SesssionStateDelegate is deprecated.
60 if (chrome::IsRunningInMash())
61 session_controller_client_ = base::MakeUnique<SessionControllerClient>();
50 62
51 // Must be available at login screen, so initialize before profile. 63 // Must be available at login screen, so initialize before profile.
52 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); 64 system_tray_client_ = base::MakeUnique<SystemTrayClient>();
53 new_window_client_ = base::MakeUnique<ChromeNewWindowClient>(); 65 new_window_client_ = base::MakeUnique<ChromeNewWindowClient>();
54 volume_controller_ = base::MakeUnique<VolumeController>(); 66 volume_controller_ = base::MakeUnique<VolumeController>();
55 vpn_list_forwarder_ = base::MakeUnique<VpnListForwarder>(); 67 vpn_list_forwarder_ = base::MakeUnique<VpnListForwarder>();
56 68
57 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile 69 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile
58 // initialized. Otherwise, virtual keyboard extension will not load at login 70 // initialized. Otherwise, virtual keyboard extension will not load at login
59 // screen. 71 // screen.
60 keyboard::InitializeKeyboard(); 72 keyboard::InitializeKeyboard();
61 73
62 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); 74 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory);
75 #endif // defined(OS_CHROMEOS)
63 } 76 }
64 77
65 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { 78 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() {
66 if (chrome::IsRunningInMash()) { 79 if (chrome::IsRunningInMash()) {
67 DCHECK(!ash::Shell::HasInstance()); 80 DCHECK(!ash::Shell::HasInstance());
68 DCHECK(!ChromeLauncherController::instance()); 81 DCHECK(!ChromeLauncherController::instance());
69 chrome_launcher_controller_mus_ = 82 chrome_launcher_controller_mus_ =
70 base::MakeUnique<ChromeLauncherControllerMus>(); 83 base::MakeUnique<ChromeLauncherControllerMus>();
71 chrome_launcher_controller_mus_->Init(); 84 chrome_launcher_controller_mus_->Init();
72 chrome_shell_content_state_ = base::MakeUnique<ChromeShellContentState>(); 85 chrome_shell_content_state_ = base::MakeUnique<ChromeShellContentState>();
73 } 86 }
74 87
75 cast_config_client_media_router_ = 88 cast_config_client_media_router_ =
76 base::MakeUnique<CastConfigClientMediaRouter>(); 89 base::MakeUnique<CastConfigClientMediaRouter>();
77 media_client_ = base::MakeUnique<MediaClient>(); 90 media_client_ = base::MakeUnique<MediaClient>();
78 91
79 if (!ash::Shell::HasInstance()) 92 if (!ash::Shell::HasInstance())
80 return; 93 return;
81 94
82 // Initialize TabScrubber after the Ash Shell has been initialized. 95 // Initialize TabScrubber after the Ash Shell has been initialized.
83 TabScrubber::GetInstance(); 96 TabScrubber::GetInstance();
84 // Activate virtual keyboard after profile is initialized. It depends on the 97 // Activate virtual keyboard after profile is initialized. It depends on the
85 // default profile. 98 // default profile.
86 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( 99 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard(
87 keyboard::KeyboardController::GetInstance()); 100 keyboard::KeyboardController::GetInstance());
88 } 101 }
89 102
90 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { 103 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() {
104 #if defined(OS_CHROMEOS)
91 vpn_list_forwarder_.reset(); 105 vpn_list_forwarder_.reset();
92 volume_controller_.reset(); 106 volume_controller_.reset();
93 new_window_client_.reset(); 107 new_window_client_.reset();
94 system_tray_client_.reset(); 108 system_tray_client_.reset();
95 media_client_.reset(); 109 media_client_.reset();
96 cast_config_client_media_router_.reset(); 110 cast_config_client_media_router_.reset();
97 session_controller_client_.reset(); 111 session_controller_client_.reset();
98 112 #endif
99 chrome::CloseAsh(); 113 chrome::CloseAsh();
100 } 114 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698