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

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

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