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

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

Issue 2619943002: Revert "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/launcher/chrome_launcher_controller_mus.h" 19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h"
16 #include "chrome/browser/ui/ash/media_client.h" 20 #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/browser/ui/views/select_file_dialog_extension.h" 25 #include "chrome/common/chrome_switches.h"
26 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" 26 #include "ui/aura/env.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
32 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh( 41 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh(
33 ChromeBrowserMainExtraPartsViews* extra_parts_views) 42 ChromeBrowserMainExtraPartsViews* extra_parts_views)
34 : extra_parts_views_(extra_parts_views) {} 43 : extra_parts_views_(extra_parts_views) {}
35 44
36 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {} 45 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {}
37 46
38 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { 47 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() {
39 if (chrome::ShouldOpenAshOnStartup()) 48 if (chrome::ShouldOpenAshOnStartup())
40 chrome::OpenAsh(gfx::kNullAcceleratedWidget); 49 chrome::OpenAsh(gfx::kNullAcceleratedWidget);
41 50
42 if (chrome::IsRunningInMash()) { 51 if (chrome::IsRunningInMash()) {
43 immersive_context_ = base::MakeUnique<ImmersiveContextMus>( 52 immersive_context_ = base::MakeUnique<ImmersiveContextMus>(
44 extra_parts_views_->wm_state()->capture_controller()); 53 extra_parts_views_->wm_state()->capture_controller());
45 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); 54 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>();
46 } 55 }
47 56
48 session_controller_client_ = base::MakeUnique<SessionControllerClient>(); 57 #if defined(OS_CHROMEOS)
58 // TODO(xiyuan): Update after SesssionStateDelegate is deprecated.
59 if (chrome::IsRunningInMash())
60 session_controller_client_ = base::MakeUnique<SessionControllerClient>();
49 61
50 // Must be available at login screen, so initialize before profile. 62 // Must be available at login screen, so initialize before profile.
51 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); 63 system_tray_client_ = base::MakeUnique<SystemTrayClient>();
52 new_window_client_ = base::MakeUnique<ChromeNewWindowClient>(); 64 new_window_client_ = base::MakeUnique<ChromeNewWindowClient>();
53 volume_controller_ = base::MakeUnique<VolumeController>(); 65 volume_controller_ = base::MakeUnique<VolumeController>();
54 vpn_list_forwarder_ = base::MakeUnique<VpnListForwarder>(); 66 vpn_list_forwarder_ = base::MakeUnique<VpnListForwarder>();
55 67
56 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile 68 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile
57 // initialized. Otherwise, virtual keyboard extension will not load at login 69 // initialized. Otherwise, virtual keyboard extension will not load at login
58 // screen. 70 // screen.
59 keyboard::InitializeKeyboard(); 71 keyboard::InitializeKeyboard();
60 72
61 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); 73 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory);
74 #endif // defined(OS_CHROMEOS)
62 } 75 }
63 76
64 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { 77 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() {
65 if (chrome::IsRunningInMash()) { 78 if (chrome::IsRunningInMash()) {
66 DCHECK(!ash::Shell::HasInstance()); 79 DCHECK(!ash::Shell::HasInstance());
67 DCHECK(!ChromeLauncherController::instance()); 80 DCHECK(!ChromeLauncherController::instance());
68 chrome_launcher_controller_mus_ = 81 chrome_launcher_controller_mus_ =
69 base::MakeUnique<ChromeLauncherControllerMus>(); 82 base::MakeUnique<ChromeLauncherControllerMus>();
70 chrome_launcher_controller_mus_->Init(); 83 chrome_launcher_controller_mus_->Init();
71 } 84 }
72 85
73 cast_config_client_media_router_ = 86 cast_config_client_media_router_ =
74 base::MakeUnique<CastConfigClientMediaRouter>(); 87 base::MakeUnique<CastConfigClientMediaRouter>();
75 media_client_ = base::MakeUnique<MediaClient>(); 88 media_client_ = base::MakeUnique<MediaClient>();
76 89
77 if (!ash::Shell::HasInstance()) 90 if (!ash::Shell::HasInstance())
78 return; 91 return;
79 92
80 // Initialize TabScrubber after the Ash Shell has been initialized. 93 // Initialize TabScrubber after the Ash Shell has been initialized.
81 TabScrubber::GetInstance(); 94 TabScrubber::GetInstance();
82 // Activate virtual keyboard after profile is initialized. It depends on the 95 // Activate virtual keyboard after profile is initialized. It depends on the
83 // default profile. 96 // default profile.
84 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( 97 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard(
85 keyboard::KeyboardController::GetInstance()); 98 keyboard::KeyboardController::GetInstance());
86 } 99 }
87 100
88 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { 101 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() {
102 #if defined(OS_CHROMEOS)
89 vpn_list_forwarder_.reset(); 103 vpn_list_forwarder_.reset();
90 volume_controller_.reset(); 104 volume_controller_.reset();
91 new_window_client_.reset(); 105 new_window_client_.reset();
92 system_tray_client_.reset(); 106 system_tray_client_.reset();
93 media_client_.reset(); 107 media_client_.reset();
94 cast_config_client_media_router_.reset(); 108 cast_config_client_media_router_.reset();
95 session_controller_client_.reset(); 109 session_controller_client_.reset();
96 110 #endif
97 chrome::CloseAsh(); 111 chrome::CloseAsh();
98 } 112 }
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