| 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 12 matching lines...) Expand all Loading... |
| 23 #include "content/public/common/service_manager_connection.h" | 23 #include "content/public/common/service_manager_connection.h" |
| 24 #include "mojo/public/cpp/bindings/strong_binding.h" | 24 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 25 #include "services/service_manager/public/cpp/connector.h" | 25 #include "services/service_manager/public/cpp/connector.h" |
| 26 #include "services/ui/public/interfaces/ime.mojom.h" | 26 #include "services/ui/public/interfaces/ime.mojom.h" |
| 27 #include "ui/aura/env.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 | 30 |
| 31 #if defined(OS_CHROMEOS) | 31 #if defined(OS_CHROMEOS) |
| 32 #include "chrome/browser/ui/ash/system_tray_client.h" | 32 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 33 #include "chrome/browser/ui/ash/vpn_list_forwarder.h" |
| 33 #include "chrome/browser/ui/views/select_file_dialog_extension.h" | 34 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 34 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" | 35 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" |
| 35 #endif // defined(OS_CHROMEOS) | 36 #endif // defined(OS_CHROMEOS) |
| 36 | 37 |
| 37 namespace { | 38 namespace { |
| 38 | 39 |
| 39 void RegisterIMEDriver() { | 40 void RegisterIMEDriver() { |
| 40 // Instantiate the IME driver and register it to the UI service. | 41 // Instantiate the IME driver and register it to the UI service. |
| 41 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 42 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 42 ui::mojom::IMEDriverPtr ime_driver_ptr; | 43 ui::mojom::IMEDriverPtr ime_driver_ptr; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 64 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); | 65 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); |
| 65 // IME driver must be available at login screen, so initialize before | 66 // IME driver must be available at login screen, so initialize before |
| 66 // profile. | 67 // profile. |
| 67 RegisterIMEDriver(); | 68 RegisterIMEDriver(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
| 71 // Must be available at login screen, so initialize before profile. | 72 // Must be available at login screen, so initialize before profile. |
| 72 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); | 73 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); |
| 73 | 74 |
| 75 vpn_list_forwarder_ = base::MakeUnique<VpnListForwarder>(); |
| 76 |
| 74 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile | 77 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile |
| 75 // initialized. Otherwise, virtual keyboard extension will not load at login | 78 // initialized. Otherwise, virtual keyboard extension will not load at login |
| 76 // screen. | 79 // screen. |
| 77 keyboard::InitializeKeyboard(); | 80 keyboard::InitializeKeyboard(); |
| 78 | 81 |
| 79 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); | 82 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); |
| 80 #endif // defined(OS_CHROMEOS) | 83 #endif // defined(OS_CHROMEOS) |
| 81 } | 84 } |
| 82 | 85 |
| 83 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { | 86 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 95 // Initialize TabScrubber after the Ash Shell has been initialized. | 98 // Initialize TabScrubber after the Ash Shell has been initialized. |
| 96 TabScrubber::GetInstance(); | 99 TabScrubber::GetInstance(); |
| 97 // Activate virtual keyboard after profile is initialized. It depends on the | 100 // Activate virtual keyboard after profile is initialized. It depends on the |
| 98 // default profile. | 101 // default profile. |
| 99 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( | 102 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( |
| 100 keyboard::KeyboardController::GetInstance()); | 103 keyboard::KeyboardController::GetInstance()); |
| 101 } | 104 } |
| 102 | 105 |
| 103 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { | 106 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { |
| 104 #if defined(OS_CHROMEOS) | 107 #if defined(OS_CHROMEOS) |
| 108 vpn_list_forwarder_.reset(); |
| 105 system_tray_client_.reset(); | 109 system_tray_client_.reset(); |
| 106 #endif | 110 #endif |
| 107 chrome::CloseAsh(); | 111 chrome::CloseAsh(); |
| 108 } | 112 } |
| OLD | NEW |