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/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" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 | 32 |
33 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {} | 33 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {} |
34 | 34 |
35 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { | 35 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { |
36 if (chrome::ShouldOpenAshOnStartup()) | 36 if (chrome::ShouldOpenAshOnStartup()) |
37 chrome::OpenAsh(gfx::kNullAcceleratedWidget); | 37 chrome::OpenAsh(gfx::kNullAcceleratedWidget); |
38 | 38 |
39 if (chrome::IsRunningInMash()) { | 39 if (chrome::IsRunningInMash()) { |
40 immersive_context_ = base::MakeUnique<ImmersiveContextMus>(); | 40 immersive_context_ = base::MakeUnique<ImmersiveContextMus>(); |
41 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); | 41 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); |
42 #if defined(OS_CHROMEOS) | |
43 // Must be available at login screen, so initialize before profile. | |
44 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); | |
45 #endif | |
46 } | 42 } |
47 | 43 |
48 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
45 // Must be available at login screen, so initialize before profile. | |
46 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); | |
47 | |
49 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile | 48 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile |
50 // initialized. Otherwise, virtual keyboard extension will not load at login | 49 // initialized. Otherwise, virtual keyboard extension will not load at login |
51 // screen. | 50 // screen. |
52 keyboard::InitializeKeyboard(); | 51 keyboard::InitializeKeyboard(); |
53 #endif | |
54 | 52 |
55 #if defined(OS_CHROMEOS) | |
msw
2016/09/30 23:26:49
nice :)
| |
56 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); | 53 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); |
57 #endif | 54 #endif // defined(OS_CHROMEOS) |
58 } | 55 } |
59 | 56 |
60 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { | 57 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { |
61 if (chrome::IsRunningInMash()) | 58 if (chrome::IsRunningInMash()) |
62 chrome::InitializeMash(); | 59 chrome::InitializeMash(); |
63 | 60 |
64 if (!ash::Shell::HasInstance()) | 61 if (!ash::Shell::HasInstance()) |
65 return; | 62 return; |
66 | 63 |
67 // Initialize TabScrubber after the Ash Shell has been initialized. | 64 // Initialize TabScrubber after the Ash Shell has been initialized. |
68 TabScrubber::GetInstance(); | 65 TabScrubber::GetInstance(); |
69 // Activate virtual keyboard after profile is initialized. It depends on the | 66 // Activate virtual keyboard after profile is initialized. It depends on the |
70 // default profile. | 67 // default profile. |
71 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( | 68 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( |
72 keyboard::KeyboardController::GetInstance()); | 69 keyboard::KeyboardController::GetInstance()); |
73 } | 70 } |
74 | 71 |
75 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { | 72 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { |
76 #if defined(OS_CHROMEOS) | 73 #if defined(OS_CHROMEOS) |
77 system_tray_client_.reset(); | 74 system_tray_client_.reset(); |
78 #endif | 75 #endif |
79 chrome::CloseAsh(); | 76 chrome::CloseAsh(); |
80 } | 77 } |
OLD | NEW |